# Spaces

A space is a folder of packs (a Git repo when you want one) with a `space.yaml`. Format: [packs.md](pack-format.md).

## The easy way: lp push

`lp push [folder]` needs no setup. If the folder has no `pack.yaml`, lp writes one (name from the folder, summary from the
README, key NAMES it finds in the code, checks it can infer: `npm test`, `python -m unittest`, compile checks, files present).
It then scans for secrets (stops on any), lints, runs the checks, records the result, and pushes to your default private
space `<handle>-packs` (shown as `@handle/packs`). `--space <id>` pushes to another space you own or can write to;
`--public` asks for public listing, which an admin approves first.

Pushing again after changes bumps the patch version and adds a `CHANGELOG.md` line listing the changed files.

Your copy lives in `~/.logicpacks/spaces/<space-id>/`. `lp packs` shows counts; `lp edit <space>/<pack>` prints a pack's folder.

## Visibility

| visibility | who sees it |
|---|---|
| `private` (default) | you, and people who accepted an invite (space or single pack) |
| `team` | same as private, meant for spaces shared with a team |
| `public-approved` | everyone, after an admin approves it (`public-pending` until then) |

Private packs never show in anyone else's `lp spaces search` or `lp pack find`.

## Finding and getting packs

```sh
lp spaces search invoice --category data   # spaces you can see (public + shared with you)
lp spaces categories
lp pack find reconcile
lp pack use waleed-packs/invoice-reconciliation   # downloads it if needed, shows spec, needs, route
lp pack check waleed-packs/invoice-reconciliation # runs its checks here
```

## Keeping current

- `lp space sync --all`: spaces shared with you are downloaded again when the owner pushed a newer version. A file you changed
  locally is never overwritten: sync stops and names it. Git spaces: fast-forward only; on divergence lp rebases if that is clean,
  otherwise it aborts and leaves your work alone.
- `lp status`: per space, ahead/behind, uncommitted packs, lint and scan state.
- `lp docs build`: rewrites the part of README.md / AGENTS.md between `<!-- lp:generated:start -->` and
  `<!-- lp:generated:end -->` (pack index, check status, levels). Text outside the markers is yours. Spaces with git get a
  pre-commit hook that runs it, plus lint and `lp scan --staged`.
- `lp pack bump <pack> patch|minor|major -m "<what changed>"`, `lp pack diff <space>/<pack>@0.1.0..0.1.1`.
- Contributors without write access: `lp pack propose <pack> -m "..."` (a GitHub PR when the space has a GitHub remote,
  otherwise a registry proposal); the owner runs `lp review proposals` and `lp accept <id>`.

## Git spaces (optional)

`lp space init <dir> --id <id> --category <slug> --owner <handle>`, `lp space clone <git-url>`, `lp space publish <dir>`
(sends metadata only: names, summaries, check status, never file contents or key values).


---

Canonical URL: https://logicpacks.io/spaces.md

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
