sow repo
sow repo creates, lists, inspects, upgrades, and removes Repositories. Each Repository stores its packages in pool/ and its indexes in dists/. Packages are shared among Dists in the same Repository.
Synopsis
repo new, repo rm, and repo migrate accept --passfile PATH for signing preflights, signing, or recovery of interrupted operations. Priority is CLI, per-key config, then SOW_GPG_PASSFILE. The other query subcommands on this page do not read password files. See Password files.
Naming
A Repository name must match [a-z0-9][a-z0-9._-]* and may not be ., .., .sow, pool,
dists, or collide with a Workspace reserved file.
SOW creates each Repository at <workspace>/<NAME>/.
sow repo ls
Read-only listing of every Repository in the Workspace.
| Flag | Description | Default |
|---|---|---|
-C, --workdir DIR |
Workspace discovery start directory | current directory |
--json |
Output JSON | false |
STATUS is one of clean, dirty, recovering or error. See
Transactions & Recovery for what each one implies for clients.
sow repo new
sow repo new updates sow.yml, then creates <workspace>/<NAME>/{pool,dists}, the SQLite database and
the private state directory. A new Repository is Generation 0 and clean.
| Flag | Description | Default |
|---|---|---|
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-T, --timeout DUR |
Maximum lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--passfile PATH |
Password file for this invocation | per-key config, then SOW_GPG_PASSFILE |
--json |
Output JSON | false |
Pass the new Repository name as NAME.
Running it again on an existing Repository reports the current state without creating another Repository.
sow repo show
Read-only detail for one Repository. With NAME omitted, the usual
Repository selection rules apply.
| Flag | Description | Default |
|---|---|---|
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-r, --repo NAME |
Select the repository when NAME is omitted |
selection rules |
--json |
Output JSON | false |
If you give both NAME and -r, use the same name:
sow repo migrate
Use repo migrate to upgrade a 0.3 or 0.4 workspace to SOW 0.9.0.
Workspaces on 0.5.0 through 0.8.0 already use the v13 schema. See the upgrade guide.
- Stop Workspace writers.
- Back up the whole Workspace, preserving hard links.
- Migrate each configured Repository.
- Run
buildandcheckfor each Repository.
Repeat the last three commands for each Repository. The migration reports schema_from and schema_to; a repeated migration reports 13 -> 13. Schema v13 adds pool-path lookup indexes. Migration from v0.3 also applies the intervening state and publication repairs. When a C2 layout migration finishes, SOW binds the migration anchor to the newly migrated Generation so subsequent build, add, check, gc, and repo rm commands succeed without reporting an anchor mismatch.
Writes require the current schema. Compatible read-only commands can inspect older state without upgrading it. After migration, use SOW 0.5 or later; restore the backup to return to the older schema.
If a completed migration leaves stage files whose ownership cannot be proven, SOW 0.7.1 and later preserve them under .sow/<repo>/abandoned/ and report the path.
Rerun sow repo migrate NAME to recover this state and unblock local GC. Inspect the retained files before removing them.
--abort abandons an unfinished layout plan before its commit decision. It does not undo a completed schema migration.
For an earlier C2 transition, SOW checks the repository identity and available journal and database control records.
Conflicting records stop the abort. A journal-bound plan also requires its recorded base manifest.
An abort can complete before the first journal or base manifest was written, provided the trusted transition marker already exists.
SOW keeps that marker so another sow repo migrate NAME can plan and resume the transition.
After commit intent, SOW allows only forward recovery.
SOW moves a nonempty temporary stage intact into .sow/<repo>/abandoned/.
It reports retained paths or cleanup problems on stderr and in JSON warnings.
A stage-cleanup warning does not prevent abandonment. Inspect the reported paths before removing files you no longer need.
The public tree remains unchanged.
A fresh development-era C2 repository still cannot start a migration. If an older abort already removed the trusted marker, restore a complete matching backup or import the original packages into a new workspace.
| Flag | Description | Default |
|---|---|---|
-j, --jobs N |
Parallel verification/render workers | logical CPUs |
--abort |
Abandon a maintenance attempt before its commit decision | false |
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-r, --repo NAME |
Select the repository when NAME is omitted |
selection rules |
-T, --timeout DUR |
Maximum lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--passfile PATH |
Password file for this invocation | per-key config, then SOW_GPG_PASSFILE |
--json |
Output JSON | false |
sow repo rm
sow repo rm removes a Repository, including its sow.yml entry, database, package files in pool/, indexes in dists/, and private state.
Without -f, SOW removes only an empty Repository — no Dists, no Memberships, and no Package Objects:
| Flag | Description | Default |
|---|---|---|
-f, --force |
Remove a non-empty unprotected repository | false |
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-T, --timeout DUR |
Maximum lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--passfile PATH |
Password file for this invocation | per-key config, then SOW_GPG_PASSFILE |
--json |
Output JSON | false |
Force removal
Use -f to remove a non-empty Repository. A protected Repository remains protected when you use -f.
protected
protected: true in sow.yml blocks Repository deletion outright, -f included:
To remove a protected Repository, set its protected value to false in sow.yml. Run sow config check, then retry the removal.
protected applies only to Repository deletion. add, rm, build, and dist rm continue to work:
Examples
Create the Repositories for a two-tier layout:
Create a Repository without waiting for a held lock:
Print each Repository’s name, state, and Generation:
Exit codes
| Code | Trigger |
|---|---|
0 |
Listed, created, shown, migrated, abandoned a pre-commit transition, or removed; or repo new reported an existing Repository |
1 |
Runtime I/O error creating or removing the tree |
2 |
Usage error, Workspace not found, or an ambiguous Repository selection |
4 |
Workspace lock held and --no-wait given or --timeout expired |
5 |
Integrity or recovery error in the Workspace journal |
6 |
Invalid name, unknown Repository, non-empty without -f, protected, or NAME conflicting with -r |
See also
- sow dist — the layer below
- Managed Workspaces — the three-layer model and discovery rules
- Transactions & Recovery — lock scopes and the
recoveringstate - sow.yml Reference —
protectedand per-Repository signing - Repository Layout — the fixed directory structure