@sous-io/sous 0.2.37 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.md +14 -256
  2. package/dist/bin.js +11 -0
  3. package/dist/sous.js +1094 -0
  4. package/docs/markdown/README.md +5 -4
  5. package/docs/markdown/_sidebar.md +21 -1
  6. package/docs/markdown/commands.md +294 -431
  7. package/docs/markdown/config-discovery.md +25 -14
  8. package/docs/markdown/config-inspection.md +53 -31
  9. package/docs/markdown/config-layers.md +168 -66
  10. package/docs/markdown/config-variables.md +44 -11
  11. package/docs/markdown/configuration.md +104 -17
  12. package/docs/markdown/design-principles.md +4 -1
  13. package/docs/markdown/repositories-authoring.md +30 -0
  14. package/docs/markdown/repositories-consuming.md +72 -14
  15. package/docs/markdown/repositories-file-formats.md +31 -13
  16. package/docs/markdown/repositories-providers.md +48 -57
  17. package/docs/markdown/repositories-quickstart.md +3 -2
  18. package/docs/markdown/repositories-troubleshooting.md +27 -1
  19. package/docs/markdown/repositories-variables.md +6 -1
  20. package/docs/markdown/repositories.md +18 -8
  21. package/package.json +48 -107
  22. package/recipes/core/sous-skills/skills/about-liquid-templates/SKILL.tpl.md +4 -6
  23. package/recipes/core/sous-skills/skills/about-liquid-templates/references/liquid-filters.tpl.md +2 -0
  24. package/recipes/core/sous-skills/skills/about-sous/SKILL.tpl.md +10 -9
  25. package/recipes/core/sous-skills/skills/about-sous-configuration/SKILL.tpl.md +35 -14
  26. package/recipes/core/sous-skills/skills/about-sous-recipes/SKILL.tpl.md +51 -20
  27. package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
  28. package/sous.config.schema.json +351 -132
  29. package/bin/run.js +0 -51
  30. package/src/base-command.ts +0 -457
  31. package/src/commands/build.ts +0 -181
  32. package/src/commands/clear.ts +0 -79
  33. package/src/commands/compile.ts +0 -155
  34. package/src/commands/config/get.ts +0 -110
  35. package/src/commands/config/show.ts +0 -32
  36. package/src/commands/config/validate.ts +0 -53
  37. package/src/commands/help.ts +0 -46
  38. package/src/commands/init.ts +0 -289
  39. package/src/commands/launch.ts +0 -139
  40. package/src/commands/lock/rebuild.ts +0 -239
  41. package/src/commands/lock/show.ts +0 -115
  42. package/src/commands/namespace/list.ts +0 -138
  43. package/src/commands/namespace/show.ts +0 -130
  44. package/src/commands/prune.ts +0 -43
  45. package/src/commands/recipe/list.ts +0 -112
  46. package/src/commands/recipe/show.ts +0 -439
  47. package/src/commands/repo/add.ts +0 -145
  48. package/src/commands/repo/contribute.ts +0 -604
  49. package/src/commands/repo/gc.ts +0 -173
  50. package/src/commands/repo/init.ts +0 -136
  51. package/src/commands/repo/link.ts +0 -899
  52. package/src/commands/repo/list.ts +0 -236
  53. package/src/commands/repo/release.ts +0 -685
  54. package/src/commands/repo/remove.ts +0 -194
  55. package/src/commands/repo/search.ts +0 -243
  56. package/src/commands/repo/submit.ts +0 -341
  57. package/src/commands/repo/unlink.ts +0 -461
  58. package/src/commands/subscription/add.ts +0 -286
  59. package/src/commands/subscription/list.ts +0 -208
  60. package/src/commands/subscription/remove.ts +0 -182
  61. package/src/commands/subscription/update.ts +0 -216
  62. package/src/commands/update.ts +0 -178
  63. package/src/commands/vars/ask.ts +0 -417
  64. package/src/commands/vars/index.ts +0 -79
  65. package/src/commands/vars/list.ts +0 -67
  66. package/src/commands/vars/show.ts +0 -77
  67. package/src/config-command.ts +0 -30
  68. package/src/lib/build-preparation.ts +0 -128
  69. package/src/lib/build-service.ts +0 -580
  70. package/src/lib/config-discovery.ts +0 -378
  71. package/src/lib/config-inspect.ts +0 -145
  72. package/src/lib/config-kernel.mjs +0 -379
  73. package/src/lib/config-schema.ts +0 -401
  74. package/src/lib/env-file.ts +0 -328
  75. package/src/lib/env-local.ts +0 -212
  76. package/src/lib/errors.ts +0 -32
  77. package/src/lib/glob-pattern.ts +0 -24
  78. package/src/lib/include-resolver.ts +0 -523
  79. package/src/lib/interactive.ts +0 -165
  80. package/src/lib/markdown-compiler.ts +0 -947
  81. package/src/lib/package-info.ts +0 -25
  82. package/src/lib/pid-service.ts +0 -99
  83. package/src/lib/project-install.d.mts +0 -44
  84. package/src/lib/project-install.mjs +0 -234
  85. package/src/lib/project-scaffold/index.ts +0 -332
  86. package/src/lib/project-scaffold/templates.ts +0 -240
  87. package/src/lib/repos/catalog-display.ts +0 -215
  88. package/src/lib/repos/catalog-inputs.ts +0 -288
  89. package/src/lib/repos/catalog.ts +0 -842
  90. package/src/lib/repos/contribute.ts +0 -452
  91. package/src/lib/repos/core-recipe.ts +0 -105
  92. package/src/lib/repos/declarations.ts +0 -187
  93. package/src/lib/repos/defaults.ts +0 -175
  94. package/src/lib/repos/formats/common.ts +0 -440
  95. package/src/lib/repos/formats/index-file.ts +0 -253
  96. package/src/lib/repos/formats/links-map.ts +0 -98
  97. package/src/lib/repos/formats/lockfile.ts +0 -169
  98. package/src/lib/repos/formats/patterns.ts +0 -57
  99. package/src/lib/repos/formats/recipe-manifest.ts +0 -205
  100. package/src/lib/repos/formats/repo-manifest.ts +0 -97
  101. package/src/lib/repos/formats/store-entry.ts +0 -84
  102. package/src/lib/repos/formats/variable-definition.ts +0 -268
  103. package/src/lib/repos/freshness.ts +0 -264
  104. package/src/lib/repos/git-clone.ts +0 -850
  105. package/src/lib/repos/identity.ts +0 -89
  106. package/src/lib/repos/index.ts +0 -57
  107. package/src/lib/repos/links.ts +0 -356
  108. package/src/lib/repos/load-manifest.ts +0 -237
  109. package/src/lib/repos/lock-service.ts +0 -454
  110. package/src/lib/repos/locked-namespace-resolver.ts +0 -232
  111. package/src/lib/repos/locked-recipe-lookup.ts +0 -123
  112. package/src/lib/repos/locked-recipes.ts +0 -254
  113. package/src/lib/repos/managed-layer.ts +0 -422
  114. package/src/lib/repos/memories-hash-name.ts +0 -33
  115. package/src/lib/repos/namespace-resolver.ts +0 -527
  116. package/src/lib/repos/providers/base.ts +0 -268
  117. package/src/lib/repos/providers/git.ts +0 -245
  118. package/src/lib/repos/providers/github.ts +0 -589
  119. package/src/lib/repos/providers/gitlab.ts +0 -332
  120. package/src/lib/repos/providers/http.ts +0 -128
  121. package/src/lib/repos/providers/index-cache.ts +0 -421
  122. package/src/lib/repos/providers/index.ts +0 -106
  123. package/src/lib/repos/providers/local.ts +0 -410
  124. package/src/lib/repos/providers/provider.ts +0 -615
  125. package/src/lib/repos/recipe-config-layers.ts +0 -316
  126. package/src/lib/repos/recipe-key-matcher.ts +0 -62
  127. package/src/lib/repos/recipe-memories.ts +0 -178
  128. package/src/lib/repos/recipe-targets.ts +0 -236
  129. package/src/lib/repos/ref-search.ts +0 -46
  130. package/src/lib/repos/release/bump.ts +0 -161
  131. package/src/lib/repos/release/changelog.ts +0 -461
  132. package/src/lib/repos/release/git-state.ts +0 -460
  133. package/src/lib/repos/release/index-builder.ts +0 -1108
  134. package/src/lib/repos/release/index.ts +0 -19
  135. package/src/lib/repos/release/plan.ts +0 -521
  136. package/src/lib/repos/release/settle.ts +0 -154
  137. package/src/lib/repos/release/submissions.ts +0 -214
  138. package/src/lib/repos/release/submit-checkout.ts +0 -290
  139. package/src/lib/repos/release/submit-questions.ts +0 -153
  140. package/src/lib/repos/release/submit-service.ts +0 -898
  141. package/src/lib/repos/release/tags.ts +0 -239
  142. package/src/lib/repos/release/validate.ts +0 -463
  143. package/src/lib/repos/resolver.ts +0 -1028
  144. package/src/lib/repos/scaffold/index.ts +0 -245
  145. package/src/lib/repos/scaffold/templates.ts +0 -517
  146. package/src/lib/repos/seed.ts +0 -473
  147. package/src/lib/repos/store/contract.ts +0 -64
  148. package/src/lib/repos/store/hash.ts +0 -191
  149. package/src/lib/repos/store/recipe-store.ts +0 -599
  150. package/src/lib/repos/store/settings.ts +0 -58
  151. package/src/lib/repos/subscription-service.ts +0 -3859
  152. package/src/lib/repos/trust.ts +0 -447
  153. package/src/lib/repos/update-plan.ts +0 -235
  154. package/src/lib/self-update/index.ts +0 -14
  155. package/src/lib/self-update/installs.ts +0 -413
  156. package/src/lib/self-update/managers.ts +0 -126
  157. package/src/lib/self-update/plan.ts +0 -315
  158. package/src/lib/self-update/registry.ts +0 -99
  159. package/src/lib/self-update/run.ts +0 -506
  160. package/src/lib/self-update/versions.ts +0 -243
  161. package/src/lib/settings.ts +0 -1107
  162. package/src/lib/sous-home.ts +0 -104
  163. package/src/lib/state.ts +0 -167
  164. package/src/lib/vars/answers.ts +0 -192
  165. package/src/lib/vars/ask.ts +0 -1152
  166. package/src/lib/vars/definition-source.ts +0 -261
  167. package/src/lib/vars/display.ts +0 -231
  168. package/src/lib/vars/index.ts +0 -20
  169. package/src/lib/vars/ladder.ts +0 -282
  170. package/src/lib/vars/mappings.ts +0 -260
  171. package/src/lib/vars/names.ts +0 -94
  172. package/src/lib/vars/preanswers.ts +0 -395
  173. package/src/lib/vars/question-plan.ts +0 -241
  174. package/src/lib/vars/report.ts +0 -228
  175. package/src/lib/vars/safe-regex.ts +0 -235
  176. package/src/lib/vars/secrets.ts +0 -131
  177. package/src/lib/vars/validate.ts +0 -312
  178. package/src/lib/version-report.ts +0 -90
  179. package/src/lib/watch-loop.ts +0 -148
  180. package/src/lib/watch-service.ts +0 -116
  181. package/src/services/ref-resolver/container.ts +0 -107
  182. package/src/services/ref-resolver/dependency.ts +0 -60
  183. package/src/services/ref-resolver/format.ts +0 -197
  184. package/src/services/ref-resolver/glob.ts +0 -115
  185. package/src/services/ref-resolver/hash-names.ts +0 -155
  186. package/src/services/ref-resolver/index.ts +0 -55
  187. package/src/services/ref-resolver/injectable.ts +0 -36
  188. package/src/services/ref-resolver/location.ts +0 -62
  189. package/src/services/ref-resolver/lookups/cached-index-lookup.ts +0 -53
  190. package/src/services/ref-resolver/lookups/catalog-lookup.ts +0 -23
  191. package/src/services/ref-resolver/lookups/catalog-matcher.ts +0 -261
  192. package/src/services/ref-resolver/lookups/chained-lookup.ts +0 -27
  193. package/src/services/ref-resolver/lookups/env-var-lookup.ts +0 -65
  194. package/src/services/ref-resolver/lookups/fetched-index-lookup.ts +0 -150
  195. package/src/services/ref-resolver/lookups/recorded-dependency-lookup.ts +0 -62
  196. package/src/services/ref-resolver/lookups/ref-lookup.ts +0 -54
  197. package/src/services/ref-resolver/lookups/variable-lookup.ts +0 -123
  198. package/src/services/ref-resolver/named-refs.ts +0 -144
  199. package/src/services/ref-resolver/parser/env-var-splitter.ts +0 -27
  200. package/src/services/ref-resolver/parser/location-splitter.ts +0 -239
  201. package/src/services/ref-resolver/parser/name-path-splitter.ts +0 -200
  202. package/src/services/ref-resolver/parser/partial-ref.ts +0 -84
  203. package/src/services/ref-resolver/parser/query-splitter.ts +0 -61
  204. package/src/services/ref-resolver/parser/range-splitter.ts +0 -52
  205. package/src/services/ref-resolver/parser/ref-parser.ts +0 -115
  206. package/src/services/ref-resolver/parser/repo-qualifier-splitter.ts +0 -51
  207. package/src/services/ref-resolver/parts.ts +0 -115
  208. package/src/services/ref-resolver/pruners/command-line-pruner.ts +0 -47
  209. package/src/services/ref-resolver/pruners/include-pruner.ts +0 -66
  210. package/src/services/ref-resolver/pruners/manifest-pruner.ts +0 -130
  211. package/src/services/ref-resolver/pruners/ref-pruner.ts +0 -135
  212. package/src/services/ref-resolver/pruners/rule-helpers.ts +0 -44
  213. package/src/services/ref-resolver/pruners/stored-key-pruner.ts +0 -136
  214. package/src/services/ref-resolver/ref-helpers.ts +0 -62
  215. package/src/services/ref-resolver/ref-picker-service.ts +0 -204
  216. package/src/services/ref-resolver/ref-report.ts +0 -84
  217. package/src/services/ref-resolver/ref-resolve-arguments.ts +0 -47
  218. package/src/services/ref-resolver/ref-resolve-result.ts +0 -36
  219. package/src/services/ref-resolver/ref-resolver-service.ts +0 -323
  220. package/src/services/ref-resolver/source.ts +0 -48
  221. package/src/services/ref-resolver/tokens.ts +0 -25
  222. package/src/services/ref-resolver/types.ts +0 -155
  223. package/src/templating/filters/bullet-list.ts +0 -9
  224. package/src/templating/filters/index.ts +0 -8
  225. package/src/templating/init-liquid-engine.ts +0 -139
  226. package/src/templating/lib/glob-files.ts +0 -74
  227. package/src/templating/lib/import-export.ts +0 -32
  228. package/src/templating/lib/secret-scope.ts +0 -41
  229. package/src/templating/lib/tag-args.ts +0 -19
  230. package/src/templating/tags/exportScalarVarsJs.ts +0 -46
  231. package/src/templating/tags/getFiles.ts +0 -89
  232. package/src/templating/tags/index.ts +0 -14
  233. package/src/templating/tags/listFiles.ts +0 -54
  234. package/src/templating/tags/showVars.ts +0 -28
  235. package/src/utils/choice-prompt.ts +0 -143
  236. package/src/utils/command-errors.ts +0 -186
  237. package/src/utils/command-help.ts +0 -45
  238. package/src/utils/confirm-prompt.ts +0 -110
  239. package/src/utils/flags.ts +0 -177
  240. package/src/utils/formatting.ts +0 -849
  241. package/src/utils/prompts.ts +0 -53
  242. package/src/utils/sous-directory.ts +0 -245
  243. package/src/utils/table.ts +0 -603
  244. package/src/utils/value-prompt.ts +0 -119
@@ -1,502 +1,373 @@
1
1
  # Command Reference
2
2
 
3
- Every command the `sous` CLI ships, with its arguments, its own flags and one example. The same text is in your
4
- terminal: `sous <command> --help`, or `sous help <command>`. Flags that mean the same thing everywhere are
5
- explained once, below, and only named under the commands that take them.
3
+ What each `sous` command is for, the flags you will reach for most, and an example. This page does not list
4
+ every flag: the full, current list for any command is in your terminal, with `sous <command> --help` or
5
+ `sous help <command>`.
6
6
 
7
- ## Flags that locate the configuration
7
+ Plugins can add commands of their own. They appear in `sous --help` beside the built-in ones, and every command
8
+ is also a tool that `sous mcp` offers an agent.
8
9
 
9
- | Flag | What it does |
10
- |------|--------------|
11
- | `-c, --config <path>` | A sous config file, or a directory holding one. Overrides `.sous/` discovery |
12
- | `--sous-config <path>` | Alias of `--config` |
13
- | `--sous-dir <path>` | The `.sous` directory to use, overriding walk-up discovery |
14
- | `--sous-confd <path>` | The `conf.d/` drop-in layer directory, overriding `<sousDir>/conf.d` |
10
+ ## Flags that locate the configuration
15
11
 
16
- Every command that works on a project takes these four. `SOUS_CONFIG`, `SOUS_DIR` and `SOUS_CONFD` do the same;
17
- a flag beats its variable, and both beat walk-up discovery. See [Discovery and overrides](config-discovery.md).
12
+ Every command that works on a project takes `-c, --config <path>` (also `--sous-config`), `--sous-dir <path>`
13
+ and `--sous-confd <path>`. They point sous at a config file, a `.sous/` directory or a `conf.d/` directory
14
+ instead of the one walk-up discovery would find. The environment variables `SOUS_CONFIG`, `SOUS_DIR` and
15
+ `SOUS_CONFD` do the same; a flag beats its variable. See [Discovery and overrides](config-discovery.md).
18
16
 
19
17
  ?> `repo init`, `repo release` and `repo submit` take none of these. They run inside a recipe repository, which
20
- has no `.sous/` directory to discover. All three still take `--non-interactive`. `repo submit` may also be run
21
- from a project, which it finds by walking up from the working directory.
18
+ has no `.sous/` directory to discover. `repo submit` may also be run from a project, which it finds by walking up
19
+ from the working directory.
22
20
 
23
21
  ## Flags that answer questions
24
22
 
25
- | Flag | What it does |
26
- |------|--------------|
27
- | `-y, --yes` | Answer yes to every confirmation the command would ask. `-f` and `--force` are the same flag, and so is `--trust` on the commands that trust a repository |
28
- | `--non-interactive` | Never ask anything. A run that would have prompted fails instead, naming the question and the flag that would have answered it |
29
- | `--dry-run` | Print what the command would do, and write, download and ask nothing |
30
- | `-h, --help` | Print this command's help and exit |
23
+ - `-y, --yes` answers yes to every confirmation the command would ask. `-f`, `--force` and, on the commands that
24
+ trust a repository, `--trust` are the same flag.
25
+ - `--non-interactive` never asks anything. A run that would have asked fails instead, naming the question and
26
+ the flag that would have answered it.
27
+ - `--dry-run` prints what the command would do, and writes, downloads and asks nothing.
28
+
29
+ Sous asks a question only when it can. Piping output, redirecting it to a file and running in CI therefore do
30
+ what `--non-interactive` does; see [When sous cannot ask](repositories-consuming.md#when-sous-cannot-ask).
31
+
32
+ !> `sous clear` is the exception: without `-f` it asks even under `--non-interactive` or in CI, so pass `-f`
33
+ whenever you script it. And `sous repo init --force` is not a confirmation; it overwrites a repository that
34
+ already exists.
35
+
36
+ ## Flags that control output
31
37
 
32
- `sous clear` spells its confirmation `-f, --force` first, with `-y` and `--yes` as aliases of it, and is the one
33
- exception to the rule above: without `-f` it asks even under `--non-interactive` or `CI`, so pass `-f` whenever
34
- you script it. `sous repo init --force` is not a confirmation; it overwrites a repository that already exists.
38
+ - `--log-level <level>` shows messages at that level and above (`debug` through `emergency`); `--debug` is the
39
+ same as `--log-level debug`.
40
+ - `--timings` prints how long each step of the run took.
41
+ - `--json`, on the commands that print a listing or a report, prints it as JSON instead.
35
42
 
36
- Sous asks a question only when it can; piping output, redirecting it to a file and running in CI therefore do
37
- what `--non-interactive` does, and a run that needs an answer fails saying why. The exact conditions are listed
38
- under [When sous cannot ask](repositories-consuming.md#when-sous-cannot-ask).
43
+ Sous warns on standard error when a step takes longer than its time budget, so the warning never mixes with
44
+ `--json` output. The `budgets` config key changes a budget, and `false` turns its warning off.
39
45
 
40
- Help has four spellings. `sous --help` prints the root screen; `sous repo add --help`, `sous repo add -h` and
41
- `sous help repo add` all print that one command's. `sous help` alone lists the topics and commands, and
42
- `sous --version` prints the version alone, as `v1.2.3`; `sous --version --verbose` adds the package name, where
43
- it is installed, the platform and the Node build under it.
46
+ `sous --version` prints the version (`v1.2.3`); add `--verbose` for where it is installed, the platform and
47
+ the Node build.
44
48
 
45
49
  ## Flags that browse
46
50
 
47
- Every command that shows published versions takes the same two flags: `sous recipe list`, `sous recipe show`,
48
- `sous namespace list`, `sous namespace show`, `sous repo list`, `sous repo search` (and `sous search`) and
49
- `sous subscription list`. The flags combine.
51
+ The commands that show published versions (`recipe list` and `show`, `namespace list` and `show`, `repo list`,
52
+ `search` and `subscription list`) read only the cached repository indexes by default, so they work offline and
53
+ fast. Two flags change that, and they combine:
50
54
 
51
- | Flag | What it does |
52
- |------|--------------|
53
- | `--latest` | Read each repository's index from upstream instead of the cache. `--remote` is the same flag. What it fetches is never written to the cache; a repository that cannot be reached is shown from the cache and named as not checked |
54
- | `--installed` | Show only what this project has installed, at the version its lockfile pins. A recipe whose repository is linked is marked `linked`, because builds read it from the checkout rather than the pinned version |
55
+ - `--latest` (also `--remote`) reads each repository's index from upstream instead of the cache, without
56
+ writing it to the cache. A repository that cannot be reached is shown from the cache and named as not
57
+ checked.
58
+ - `--installed` shows only what this project has installed, at the version its lockfile pins.
55
59
 
56
- Without either flag a browsing command reads only the cached indexes, so it works offline and fast.
57
- `sous recipe list --installed --latest` is the out-of-date view: each installed recipe with upstream's newest
58
- version beside the installed one. With `--installed`, `recipe show` and `namespace show` look the reference up
59
- among installed recipes only, and a reference to something published but not installed is an error saying so.
60
+ `sous recipe list --installed --latest` shows each installed recipe beside upstream's newest version: the
61
+ out-of-date view.
60
62
 
61
- Every topic answers to both spellings of its name: `repo` and `repos`, `subscription` and `subscriptions`,
62
- `namespace` and `namespaces`, `recipe` and `recipes`, `lock` and `locks`, `vars` and `var`, `config` and
63
- `configs`. Three commands also answer to one word: `sous search`, `sous subscribe` and `sous unsubscribe`.
63
+ ## Spellings
64
+
65
+ Every topic answers to both spellings of its name (`repo` and `repos`, `subscription` and `subscriptions`, and
66
+ so on), and `sous search`, `sous subscribe` and `sous unsubscribe` are one-word forms of `repo search`,
67
+ `subscription add` and `subscription remove`.
64
68
 
65
69
  ## Top-level commands
66
70
 
67
71
  ### `sous init [DIRECTORY]`
68
- Sets a project up for sous: writes its `.sous/` directory, then runs the first build. It is the one command that
69
- runs before a config exists, and the starting point for a project that has never used sous. It writes a commented
70
- primary config, a starter prompt at `.sous/memories/AGENTS.tpl.md` that the config compiles to `AGENTS.md` at the
71
- project root (it holds the one line, `@#memories/**/*.md`, that includes every memory your subscribed recipes publish), `.sous/.env` and `.sous/.env.local.example`, and the sous-managed block in `.sous/.gitignore`. A
72
- project that has a `package.json` also gains `@sous-io/sous` in its `devDependencies`, at exactly the running
73
- version, unless it already depends on it; nothing is installed, so run your package manager's install afterwards.
74
- The first build compiles the starter prompt and the `core` skills, and pins them in `.sous/sous.lock.json`.
75
-
76
- A project whose `.sous/` already holds a primary config is refused, and nothing is written. Setting up a directory
77
- inside a project that is already set up is a question rather than an error, since a subproject may want its own
78
- instructions; `-y, --yes` answers it ahead of time, and a run with no terminal fails naming that flag.
79
-
80
- - `DIRECTORY`: the project directory to set up; the current one by default. `--sous-dir` and `SOUS_DIR` also say
81
- where, when no directory is given.
82
- - `--format <js|json>`: which config to write, `js` by default. The JSON config carries `$schema`, bound to the
83
- schema artifact published for the running sous version.
84
- - `--name <name>`: the display name written into the config; the directory's own name by default.
85
- - `--no-build`: write the setup without running the first build.
86
- - `--dry-run`: print the files that would be written without writing them.
87
-
88
- Example: `sous init --format json`
72
+
73
+ Sets a project up for sous, then runs the first build. It writes a commented `sous.config.js`, a starter prompt
74
+ at `.sous/memories/AGENTS.tpl.md` that compiles to `AGENTS.md` at the project root, the `.sous/.env` and
75
+ `.sous/.env.local.example` files, and the sous block in `.sous/.gitignore`. A project with a `package.json` also
76
+ gains `@sous-io/sous` as a devDependency at the running version; run your package manager's install afterwards.
77
+
78
+ The starter prompt holds one line, `@#memories/**/*.md`, which includes every memory your subscribed recipes
79
+ publish. Agent plugins can add more places for memories (the built-in Claude Code plugin adds `CLAUDE.md`).
80
+
81
+ A project whose `.sous/` already holds a config is left untouched. The config it writes is `sous.config.js`. `--no-build` skips the first build.
82
+
83
+ ```bash
84
+ sous init
85
+ sous init --name "My Project"
86
+ ```
89
87
 
90
88
  ### `sous build`
91
- Compiles this project's outputs, then removes the ones its config no longer produces. It is compile plus prune,
92
- and the command you want almost always. Takes `--dry-run`.
93
-
94
- - `--no-prune`, `--no-compile`: skip one half of the run.
95
- - `--rebuild`: ignore cached hashes and reprocess every output.
96
- - `--strict`: treat compile warnings as errors (a `.tpl.` file copied without being rendered, a git branch the
97
- runtime context could not read).
98
- - `-w, --watch`: rebuild on every change to a source file, a config layer or a linked checkout.
99
-
100
- Before it compiles, a build prepares the project's recipes: it seeds the core recipe, pins any subscription the
101
- lockfile does not pin yet, restores whatever the store on this machine is missing, and checks upstream for the
102
- repositories that ask for newer versions. Every command that builds (`init`, `build`, `launch`, `prune`,
103
- `repo remove`, `repo unlink`, `subscription add`, `subscription remove`, `subscription update`) runs this same
104
- build, so each one prints the same things.
105
-
106
- A compile error (a missing or circular include, a line that looks like an include but cannot be read as one, a
107
- template that fails to render, a file sous cannot read) fails the build. Every target is still compiled and every error is listed, then the build exits `1`. An output whose
108
- target had an error is not written, so the copy from the last good build stays in place.
109
-
110
- A build also warns about every memory an active recipe publishes that no output includes, naming the line to add
111
- (`@#memories/**/*.md`) and the `recipes.memories.exclude` opt-out; see
112
- [Recipe memories](repositories-consuming.md#recipe-memories).
113
-
114
- A build also lists each recipe this project uses that has a newer version within the range
115
- declared for it, beside the version pinned. It moves no pin; only always-pull moves one. The build reads upstream
116
- for this at most once per freshness window (`store.freshnessSeconds`, five minutes by default), gives a
117
- repository three seconds to answer, and otherwise answers from the cached index without a word about the
118
- failed check.
119
-
120
- Example: `sous build --rebuild`
121
-
122
- ### `sous compile`
123
- Compiles markdown templates into output files, and prunes nothing. Takes `--rebuild`, `--strict`, `--dry-run`
124
- and `-w, --watch`, each meaning what it means on `build`, and exits `1` after a compile error the way `build`
125
- does. It does not prepare the recipes first. Example: `sous compile --strict`
126
-
127
- ### `sous prune`
128
- Removes output files no longer in the current config. It prepares the recipes first, as `build` does, because
129
- what counts as current depends on the recipes the lockfile pins. Takes `--dry-run` only. Example:
130
- `sous prune --dry-run`
131
-
132
- ### `sous clear`
133
- Deletes every file and directory sous has written for the project, and asks first; `-f, --force` answers that
134
- confirmation ahead of time. Example: `sous clear --force`
89
+
90
+ Compiles the project's outputs, then removes the ones the config no longer produces. It is the command you want
91
+ almost always. `-w, --watch` rebuilds on every change to a source file, a config file or a linked checkout;
92
+ `--rebuild` ignores cached hashes and reprocesses everything; `--strict` makes compile warnings fail the build.
93
+
94
+ Before it compiles, a build prepares the project's recipes: it pins any new subscription, restores whatever this
95
+ machine's recipe store is missing, and lists each recipe that has a newer version within its range (it moves no
96
+ pin; see [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions)). The other commands
97
+ that build (`init`, `launch`, `prune`, `subscription add` and the like) run this same build.
98
+
99
+ A build compiles only the recipes whose subscriptions are switched on on this machine. Each one it skips gets a
100
+ line saying why:
101
+
102
+ ```text
103
+ $ sous build
104
+ Skipped tool-usage/automated-browser-tasks: its subscription is switched off (conf.d/610-mac.jsonc).
105
+ Pruned 4 outputs it had written.
106
+ ```
107
+
108
+ A compile error (a missing or circular include, a template that fails to render, a file sous cannot read) fails
109
+ the build, but only after every target is compiled and every error listed. An output whose target had an error is
110
+ not written, so the copy from the last good build stays in place. A build also warns about every recipe memory
111
+ that no output includes; see [Recipe memories](repositories-consuming.md#recipe-memories).
112
+
113
+ ```bash
114
+ sous build
115
+ sous build --watch
116
+ ```
117
+
118
+ ### `sous compile`, `sous prune`, `sous clear`
119
+
120
+ The pieces of a build, run on their own:
121
+
122
+ - `sous compile` compiles and prunes nothing. It does not prepare the recipes first.
123
+ - `sous prune` removes the outputs no longer in the config.
124
+ - `sous clear` deletes every file and directory sous has written for the project, after asking.
125
+
126
+ ```bash
127
+ sous prune --dry-run
128
+ sous clear --force
129
+ ```
135
130
 
136
131
  ### `sous launch TOOL...`
137
- Builds this project's outputs, then starts a coding agent configured under `tools` in its config. A build that
138
- fails starts nothing and exits `1`. `--no-build` launches without building; `--continuous` restarts the agent
139
- whenever it exits.
140
132
 
141
- Any argument `launch` does not recognize is forwarded to the tool; a flag that collides with one of sous's own
142
- goes after a bare `--`: `sous launch claude --resume`, `sous launch claude -- -c`.
133
+ Builds the project, then starts a coding agent: one an agent plugin provides (the built-in Claude Code plugin
134
+ provides `claude`), or one configured under `tools` in the config. A failed build starts nothing.
135
+ `--continuous` restarts the agent whenever it exits, and `--no-build` skips the build.
136
+
137
+ Arguments `launch` does not recognize are passed to the agent. Put one that clashes with a sous flag after a
138
+ bare `--`:
143
139
 
144
- Example: `sous launch claude --continuous`
140
+ ```bash
141
+ sous launch claude --resume
142
+ sous launch claude -- -c
143
+ ```
145
144
 
146
145
  ### `sous search TEXT`
147
- Searches the recipes every trusted repository publishes, by name or description; reads the cached indexes only,
148
- so it works offline. `--limit <n>` sets how many matches to show, defaulting to 25. Takes the
149
- [browsing flags](#flags-that-browse): `--latest` searches the indexes upstream serves, and `--installed` searches
150
- only installed recipes and adds an Installed column. Also spelled `sous repo search`.
151
- Example: `sous search task --limit 50`
146
+
147
+ Searches the recipes every trusted repository publishes, by name or description. Also spelled
148
+ `sous repo search`.
149
+
150
+ ```bash
151
+ sous search task
152
+ ```
152
153
 
153
154
  ### `sous update`
154
- Updates sous itself: the global install, this project's own install, or both, each through the package manager
155
- that installed it. It works outside a project too, and it always runs in the copy you invoked, never handed off
156
- to the project's own. Every plan is printed before anything is installed, and each install asks its own
157
- question. After a project update the new copy builds the project, so the lockfile pins the core recipe at the new
158
- version. A project config this copy cannot load is one warning, not a stop. Takes `-y, --yes` and `--dry-run`
159
- (which also prints the command each install would run). See [Updating](README.md#updating).
160
-
161
- - `--major`: install the newest published version, whatever its major. By default each install moves to the
162
- newest version in its current major, and never down.
163
- - `--version <version|range|tag>`: install exactly this version, the newest in this range, or the one this
164
- dist-tag names. This is how you downgrade.
165
- - `--prerelease`, `--no-prerelease`: count prerelease versions as candidates, or not. On by default when the
166
- installed version is a prerelease. `--pre` is the same flag.
167
- - `--global`, `--project`: update only that install.
168
- - `--no-build`: update the project install without building the project afterwards.
169
-
170
- `--major` and `--version` exclude each other, and so do `--global` and `--project`.
171
-
172
- Example: `sous update --version next --dry-run`
155
+
156
+ Updates sous itself: the global install, the project's own install, or both, each through the package manager
157
+ that installed it. It prints every plan and asks before each install. By default each install moves to the
158
+ newest version in its current major; `--major` goes past it and `--version <version|range|tag>` picks one, a
159
+ downgrade included. See [Updating](README.md#updating).
160
+
161
+ ```bash
162
+ sous update --dry-run
163
+ sous update --version next
164
+ ```
165
+
166
+ ### `sous mcp`
167
+
168
+ Starts an MCP server for the project, for any agent tool that speaks MCP. Its tools are the same commands the
169
+ CLI runs, so an agent can do through it anything you can at a terminal, and a question a command would ask is
170
+ asked through the agent tool instead. The server keeps serving the project it started in, even when the agent
171
+ changes directories. In an agent tool's MCP settings:
172
+
173
+ ```json
174
+ {
175
+ "mcpServers": {
176
+ "sous": {
177
+ "command": "npx",
178
+ "args": ["sous", "mcp"]
179
+ }
180
+ }
181
+ }
182
+ ```
183
+
184
+ ### `sous plugins show`
185
+
186
+ Lists every plugin loaded for the project and what each one adds or replaces. Use it to find out which plugin
187
+ provides a command, a config key or an agent's targets.
188
+
189
+ ```bash
190
+ sous plugins show
191
+ ```
173
192
 
174
193
  ### `sous help [COMMAND]`
175
- Prints the help for sous, or for one command or topic. Works from any directory, including one with no config
176
- above it. Example: `sous help repo add`
177
194
 
178
- ## config
195
+ Prints the help for sous, or for one command or topic. It works from any directory, including one with no
196
+ config above it.
179
197
 
180
- Inspects the merged configuration. `show` and `get` write machine-readable output to standard out and route the
181
- header and any error block to standard error, so a pipeline survives a broken config. See
182
- [Inspecting and validating](config-inspection.md).
198
+ ```bash
199
+ sous help repo add
200
+ ```
183
201
 
184
- ### `sous config show`
185
- Prints the merged config (every `conf.d` layer merged, before variable resolution) as JSON.
186
- Example: `sous config show | jq .compilation`
202
+ ## config
203
+
204
+ Inspects the built configuration; see [Inspecting and validating](config-inspection.md).
187
205
 
188
- ### `sous config get PATH`
189
- Prints one value by dot-path, with `[n]` for array indices; a scalar prints raw, and an object or array prints
190
- as pretty JSON. `--layers` adds one `old -> new` line per config layer that changed the value.
191
- Example: `sous config get compilation.targets[0].entryPoint --layers`
206
+ - `sous config show` prints the built config as JSON, with config expressions evaluated: what sous will do on
207
+ this machine. `--layers` shows each change in order and what made it.
208
+ - `sous config get PATH` prints one value by dot-path. `--layers` shows every file, recipe or plugin that
209
+ changed it.
210
+ - `sous config validate` checks the config against its schema, then resolves every variable, which is what
211
+ finds circular and undefined `${var}` references.
192
212
 
193
- ### `sous config validate`
194
- Validates the merged config: the schema first, then full variable resolution, which is what surfaces reference
195
- cycles and undefined `${var}` references. Example: `sous config validate`
213
+ ```bash
214
+ sous config show | jq .compilation
215
+ sous config get compilation.targets[0].entryPoint --layers
216
+ ```
196
217
 
197
218
  ## repo
198
219
 
199
- Manages the recipe repositories this project trusts; see [Repositories](repositories.md) for the model and
200
- [Consuming recipes](repositories-consuming.md) for the workflow.
220
+ Manages the recipe repositories the project trusts; see [Repositories](repositories.md) and
221
+ [Consuming recipes](repositories-consuming.md).
201
222
 
202
- ### `sous repo add URL`
203
- Adds a repository to this project, which is also how you trust it, and fetches its index so its recipes are
204
- listable. `URL` is the repository's address, or the path of one on this machine. Takes `--dry-run`.
223
+ ### `sous repo add URL`, `sous repo remove REPO`, `sous repo list`
205
224
 
206
- - `--name <name>`: set the short name refs will use. Defaults to the URL's last segment. (`sous repo link` on
207
- a path instead takes the name that checkout's own manifest suggests.)
208
- - `--provider github|gitlab|local`: name the provider, for a host the URL does not give away; each provider's
209
- behaviour is in the [provider reference](repositories-providers.md).
210
- - `-y, --yes`: answer the trust question ahead of time (also `-f`, `--force`, `--trust`).
225
+ - `repo add` trusts a repository and fetches its index, so its recipes are listable. `URL` is its address or a
226
+ path on this machine; `--name` sets the short name refs use, and `--provider` names the host when the URL does
227
+ not give it away (see the [provider reference](repositories-providers.md)).
228
+ - `repo remove` stops trusting a repository and removes everything it brought in, after listing what goes.
229
+ - `repo list` lists the trusted repositories; `--verbose` adds the namespaces each publishes.
211
230
 
212
- Example: `sous repo add https://github.com/sous-io/sous-recipes --name recipes`
231
+ ```bash
232
+ sous repo add https://github.com/sous-io/sous-recipes --name recipes
233
+ sous repo remove recipes --dry-run
234
+ ```
213
235
 
214
- ### `sous repo remove REPO`
215
- Stops trusting a repository, named by the short name this project records, and removes everything it brought in.
216
- It first prints what goes with it: the entry, the subscriptions that resolve into it, the recipes those alone
217
- held, the files the next build prunes, and the linked checkout if one points at it. Takes `-y, --yes`,
218
- `--dry-run` and `--no-build` (remove without rebuilding). Example: `sous repo remove my-recipes --dry-run`
236
+ ### `sous repo gc`
219
237
 
220
- ### `sous repo list`
221
- Lists the repositories this project trusts, with the provider, where the entry came from, whether it is linked,
222
- how many recipes it publishes (`not fetched` until its index has been downloaded) and its URL. `--verbose` adds
223
- the namespaces each one publishes, on a line under its row. Takes the [browsing flags](#flags-that-browse):
224
- `--installed` keeps only the repositories something is installed from and names each installed recipe and
225
- version on a line under its row.
238
+ Shrinks this machine's recipe store down to its size limit.
226
239
 
227
- ```term
228
- $ sous repo list
229
- Repository Provider Origin Linked Recipes URL
230
- ------------ -------- -------- ------ ----------- ---------------------------------------
231
- sous-recipes github built in no not fetched https://github.com/sous-io/sous-recipes
240
+ ```bash
241
+ sous repo gc --dry-run
232
242
  ```
233
243
 
234
- ### `sous repo search TEXT`
235
- Same command as `sous search`, under its own topic; takes `--limit <n>` and the
236
- [browsing flags](#flags-that-browse). Example: `sous repo search browser --installed`
237
-
238
- ### `sous repo gc`
239
- Collects the machine-wide recipe store down to its size cap. `--max-bytes <n>` collects to that cap instead of
240
- the one the config sets; `--dry-run` prints what it would evict. Example: `sous repo gc --max-bytes 268435456`
241
-
242
- ### `sous repo link REPO [PATH]`
243
- Points a repository at a working copy on this machine instead of a published version; see
244
- [Edit a repository in place](repositories-authoring.md#edit-a-repository-in-place). A name or URL on its own
245
- clones it into `.sous/repos` and links the clone; a name or URL with a `PATH` links the checkout at that path; a
246
- path alone links that checkout where it is, adding the repository first if needed. Takes `--dry-run`.
247
-
248
- A checkout that was already on disk is fetched (a fetch changes none of its files or branches) and compared with
249
- upstream: its branch, whether that branch is merged into the default branch, and how many commits it is behind.
250
- When upstream cannot be reached within a few seconds, a warning gives git's reason and says since when the
251
- checkout may have diverged, and the link is still recorded. Nothing else changes the checkout unless a flag
252
- asks for it; git carries out each step, and a step git refuses stops the command with git's own message.
253
-
254
- - `--global`: link for every project on this machine, sharing one checkout. Changing that checkout's branch
255
- says it affects every project that links it.
256
- - `--branch <name>`: switch to an existing branch, fetching it from upstream first when it is not local.
257
- - `--create-branch <name>`: create a new branch and switch to it; git refuses a name that already exists.
258
- - `--generate-branch`: the same, with the generated name `sous/edit-<YYYYMMDD>-<HHMM>`, which is printed.
259
- - `--from <branch>`: the base of the new branch, fetched first. Defaults to the repository's default branch,
260
- not whatever is checked out, and needs `--create-branch` or `--generate-branch`.
261
- - `--latest`: make the branch being worked from (the `--branch` target, the `--from` base, or else the default
262
- branch) match upstream's, leaving every other branch alone. What that would discard (uncommitted changes and
263
- local commits upstream lacks) is listed first, with one question; it fails when the fetch fails.
264
- - `-y, --yes`: answer the trust question a not-yet-added repository raises and the question `--latest` asks
265
- (also `-f`, `--force`, `--trust`).
266
-
267
- `--branch`, `--create-branch` and `--generate-branch` exclude each other; each flag works on a checkout linked
268
- by path, too.
269
-
270
- Example: `sous repo link sous-recipes ~/Projects/sous-recipes`, or `sous repo link sous-recipes
271
- --generate-branch --latest --yes`
272
-
273
- ### `sous repo unlink REPO`
274
- Stops reading a repository from a working copy, goes back to the versions the lockfile pins, and rebuilds the
275
- project; `REPO` is the short name as it appears in `sous.links.json` (see
276
- [File formats](repositories-file-formats.md)). On its own it also fetches the repository's index, with a short
277
- timeout, and reports any newer published version the ranges allow, without moving anything; when the index
278
- cannot be fetched in time it says it could not check. The checkout stays where it is unless `--remove` is passed.
279
- Takes `--dry-run`, `--no-build`, `--answer` and `--answers-file`.
280
-
281
- - `--global`: remove the machine-wide link, not this project's.
282
- - `--update`: move this repository's pins to the newest versions their ranges allow before rebuilding. It runs
283
- the same code as `sous subscription update REPO`.
284
- - `--remove`: delete the checkout as well, but only one sous cloned itself; a checkout linked by path is refused
285
- with an error. Uncommitted changes, commits no remote has and stashes are listed first and asked about.
286
- - `-y, --yes`: answer every question this command asks: deleting a checkout that holds work, the update plan,
287
- and the trust question for a repository a newer version needs (also `--force`, `--trust`).
288
-
289
- Example: `sous repo unlink sous-recipes --update`
244
+ ### `sous repo link REPO [PATH]`, `sous repo unlink REPO`
290
245
 
291
- ### `sous repo contribute REF`
292
- Starts a contribution to a recipe repository, or finishes one with `--finish`, by running `sous repo link`,
293
- `sous repo submit` and `sous repo unlink` in order; see [Contributing a change](repositories-contributing.md).
294
- `REF` names a repository, or a namespace or recipe, in which case the repository that publishes it is used.
295
- Each step runs the real command with the flags below passed through, prints as it runs, and a failure names the
296
- step that failed and the steps that completed. `--dry-run` prints each step and runs none. Also spelled
297
- `sous repo contrib`.
246
+ `repo link` makes the project read a repository from a working copy instead of a published version, so you can
247
+ edit recipes in place; see [Edit a repository in place](repositories-authoring.md#edit-a-repository-in-place). A
248
+ name or URL alone clones the repository into `.sous/repos`; with a `PATH`, or a path alone, it links that
249
+ checkout. `--global` links it for every project on this machine, and `--branch`, `--create-branch` or
250
+ `--generate-branch` choose the branch to work on.
298
251
 
299
- Starting runs `sous repo link REPO --latest --generate-branch`:
252
+ `repo unlink` goes back to the versions the lockfile pins and rebuilds. `--update` also moves the pins to the
253
+ newest versions their ranges allow, and `--remove` deletes a checkout sous cloned.
300
254
 
301
- - `--create-branch <name>`: start on a new branch with this name instead of a generated one.
302
- - `--branch <name>`: work on an existing branch instead of a new one (when finishing, the branch to submit).
303
- - `--from <branch>`: the base of the new branch; defaults to the repository's default branch.
304
- - `--global`: the machine-wide link, sharing one checkout (when finishing, too).
255
+ ```bash
256
+ sous repo link sous-recipes ~/Projects/sous-recipes
257
+ sous repo link sous-recipes --generate-branch --latest
258
+ sous repo unlink sous-recipes --update
259
+ ```
305
260
 
306
- Finishing looks for work no proposal carries yet (uncommitted changes, commits never pushed, or pushed commits
307
- with no open proposal), asks whether to submit it with `sous repo submit REPO`, then runs
308
- `sous repo unlink REPO --update`. With nothing to submit, the submit step is skipped without asking.
261
+ ### `sous repo contribute REF`
309
262
 
310
- - `--submit`, `--no-submit`: submit without asking, or finish without submitting.
311
- - `--title <text>`, `--body <text>`, `--draft`, `--commit`: passed through to `sous repo submit`.
312
- - `--remove`: passed through to `sous repo unlink`, deleting the checkout sous cloned.
313
- - `-y, --yes`: passed through to every step, and submits without asking (also `-f`, `--force`).
314
- - `--accept-first`: when `REF` matches several things, take the first one listed.
263
+ Starts a change to a recipe repository, and finishes it with `--finish`, by running `repo link`, `repo submit`
264
+ and `repo unlink` for you. `REF` names a repository, or a namespace or recipe in it. Also spelled
265
+ `sous repo contrib`. See [Contributing a change](repositories-contributing.md).
315
266
 
316
- Example: `sous repo contribute workflow/task-files`, then `sous repo contribute workflow/task-files --finish
317
- --title "Clarify the resume steps" --body "The resume steps skipped the task file."`
267
+ ```bash
268
+ sous repo contribute workflow/task-files
269
+ sous repo contribute workflow/task-files --finish --title "Clarify the resume steps" --body "The resume steps skipped the task file."
270
+ ```
318
271
 
319
272
  ### `sous repo init [DIRECTORY]`
320
- Creates a new recipe repository in a directory, defaulting to the current one; `--dry-run` prints the files it
321
- would write. See [Authoring a repository](repositories-authoring.md).
322
273
 
323
- - `--name <name>`: set the short name for the repository. Defaults to the directory's own name.
324
- - `--namespace <name>`: name the one namespace to declare. Defaults to the repository's name.
325
- - `--force`: write the scaffold over a repository that already exists.
274
+ Creates a new recipe repository. See [Authoring a repository](repositories-authoring.md).
326
275
 
327
- Example: `sous repo init ./my-recipes --name team-recipes --namespace workflow`
276
+ ```bash
277
+ sous repo init ./my-recipes --name team-recipes --namespace workflow
278
+ ```
328
279
 
329
280
  ### `sous repo release`
330
- Publishes new versions of this repository's recipes: bump, regenerate the index, commit and tag. It plans first
331
- and asks once, and it refuses to run until git has a commit identity in the repository (`git config user.name`
332
- and `git config user.email`), because it commits and cuts annotated tags. Takes `-y, --yes` and `--dry-run`.
333
-
334
- - `--namespace <ns>`, `--recipe <ns/name>`: narrow the run. Both repeat.
335
- - `--bump patch|minor|major|prerelease`: how far to raise a changed version. Defaults to a patch step.
336
- - `--no-bump`: raise nothing; a changed recipe that was never raised is then an error.
337
- - `--include-unchanged`: release every recipe in scope, changed or not.
338
- - `--tag`, `--push`: tag even on a non-default branch, and push the commit and this run's tags.
339
- - `--check`: only validate. It fails on a problem the release would refuse, and on a change to a recipe that
340
- takes no proposals (see [`submissions`](repositories-file-formats.md#the-submissions-block)), and reports,
341
- without failing, how merging would rewrite the committed index.
342
- - `--ci`: the merge preset. Never bump, never ask, and fail on anything unbumped. It still needs `--yes` to
343
- accept the plan it prints, so a merge job runs `sous repo release --ci --yes --push`.
344
-
345
- Example: `sous repo release --recipe workflow/task-files --bump minor --push`
281
+
282
+ Publishes new versions of the repository's recipes: raises their versions, regenerates the index, commits and
283
+ tags. It plans first and asks once, and it needs a git commit identity (`user.name` and `user.email`) in the
284
+ repository. `--check` only validates, and `--ci` is the setting for a merge job.
285
+
286
+ ```bash
287
+ sous repo release --recipe workflow/task-files --bump minor --push
288
+ sous repo release --ci --yes --push
289
+ ```
346
290
 
347
291
  ### `sous repo submit [REPO]`
348
- Proposes a recipe repository's changes to its maintainers, and follows the proposal through: it opens one,
349
- updates it when there is more to send, reports where it stands, and starts the next one once it was merged. Run
350
- inside a recipe repository it works there; run inside a project, `REPO` names a linked repository and the
351
- submission runs in its checkout (with no `REPO`, the only linked repository is used, and several are a
352
- question). Takes `-y, --yes` and `--dry-run`.
353
-
354
- - `--title <text>`, `--body <text>`: the proposal's title and description. Both are required for a new
355
- proposal, and asked for at a terminal when missing; on an open proposal they are optional and replace its own.
356
- The body is followed by a changelog sous generates.
357
- - `--branch <name>`: work with this branch instead of the one checked out. A branch that does not exist is
358
- created from the current commit.
359
- - `--status`: only report where the branch's proposal stands; nothing is checked, written or sent.
360
- - `--commit`: commit uncommitted changes for you, after listing them and asking once, with the title, the
361
- description and the changelog as the message.
362
- - `--draft`: open a new proposal as a draft.
363
-
364
- Example: `sous repo submit --title "Add a linting recipe" --body "Adds lint rules for shell scripts." --draft`
292
+
293
+ Proposes a repository's changes to its maintainers and follows the proposal through: it opens one, updates it
294
+ when there is more to send, and reports where it stands. Run in a project, `REPO` names a linked repository.
295
+ `--status` only reports.
296
+
297
+ ```bash
298
+ sous repo submit --title "Add a linting recipe" --body "Adds lint rules for shell scripts." --draft
299
+ ```
365
300
 
366
301
  ## subscription
367
302
 
368
- Manages which recipes this project subscribes to. `REF` is `namespace` or `namespace/recipe`, either of them
369
- optionally carrying an `@<range>` and a `repo:` qualifier; see
370
- [Refs](repositories-file-formats.md#refs-how-anything-is-named).
371
-
372
- ### `sous subscription add REF`
373
- Subscribes this project to a recipe, or to a whole namespace of them, then builds the project so the recipe's
374
- files are on disk when the command returns. Also spelled `sous subscribe`. Takes `-y, --yes`, `--no-build`, and
375
- `--dry-run`, which also prints every question the recipes would ask. A dry run downloads nothing, so a recipe
376
- not on this machine is described from its repository's index; one whose index entry predates the release that
377
- began recording questions there is named instead.
378
-
379
- - `--prerelease`: let prerelease versions take part in range matching.
380
- - `--always-pull`: install a newer in-range version whenever one exists, rather than holding the lock.
381
- - `--accept-first`: when a one-word ref matches several things, take the first one listed.
382
- - `--answer <name>=<value>`: answer one question ahead of time. Repeat it for each answer.
383
- - `--answers-file <path>`: read the same pairs from a YAML or JSON file. An `--answer` wins over the file.
384
-
385
- Example: `sous subscription add workflow/task-files@^1.2.0 --answer apiUrl=https://api.example.com`
386
-
387
- ### `sous subscription remove REF`
388
- Removes a subscription and everything only it brought in, then rebuilds so those files are gone. Also spelled
389
- `sous unsubscribe`. Takes `--dry-run` and `--no-build`. Example: `sous subscription remove workflow/task-files`
390
-
391
- ### `sous subscription update [REF]`
392
- Moves the lockfile's pins to the newest published versions their ranges allow, then rebuilds the project. With
393
- no `REF` it covers every subscription; a `REF` naming a repository, a namespace or a recipe narrows it, and
394
- everything outside it stays where it is pinned. It fetches every trusted repository's index first, never widens
395
- a range, moves dependencies with the closure, and changes only the lockfile, never the subscriptions. It prints
396
- the plan and asks once; with nothing to update it says so and asks nothing. See
397
- [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions). Takes `--no-build`, `--answer`
398
- and `--answers-file`, and `--dry-run`, which fetches the indexes but downloads no recipe and writes nothing.
399
-
400
- - `-y, --yes`: accept the plan, and trust any repository a newer version needs (also `--force`, `--trust`).
401
- - `--accept-first`: when `REF` matches several things, take the first one listed.
402
-
403
- Example: `sous subscription update workflow/task-files`
404
-
405
- ### `sous subscription list`
406
- Lists the subscriptions this project declares, switched-off ones included, with the range each resolves within,
407
- the versions the lockfile pins, the latest version each of those recipes has published, where it came from and
408
- whether it is on. Reads the config, the lockfile and the cached indexes only. Takes the
409
- [browsing flags](#flags-that-browse): `--latest` reads the latest versions from upstream, and `--installed` keeps
410
- only the subscriptions that have pinned something. Example: `sous subscription list --latest`
411
-
412
- ## namespace
413
-
414
- `namespace` reads the cached indexes and the lockfile, so it works offline. A trusted repository whose index has
415
- never been fetched is named at the end of a listing, not left out. Both commands take the
416
- [browsing flags](#flags-that-browse); with `--installed` the recipe count is the number installed. The core version this installation of sous
417
- ships is listed even while the cached index does not publish it yet.
418
-
419
- ### `sous namespace list`
420
- Lists every namespace the trusted repositories publish, how many recipes each holds, and how much of it this
421
- project subscribes to: all of it, some recipes, or none. Example: `sous namespace list`
422
-
423
- ### `sous namespace show REF`
424
- Shows one namespace and every recipe in it, with the latest published version, the version this project pins,
425
- and whether it is subscribed. `REF` is a namespace, optionally written as `repository:namespace`.
426
- Example: `sous namespace show sous-recipes:core`
427
-
428
- ## recipe
429
-
430
- Browses the recipes the trusted repositories publish; like `namespace`, it works offline, and both commands take
431
- the [browsing flags](#flags-that-browse).
432
-
433
- ### `sous recipe list`
434
- Lists the recipes the trusted repositories publish, across every namespace, with the same per-recipe columns
435
- `namespace show` prints. Example: `sous recipe list --installed --latest`
436
-
437
- ### `sous recipe show REF`
438
- Describes one recipe completely: its repository and location, every published version, its dependencies (the
439
- manifest entry bringing each one in, such as a whole namespace, whether it is a co-subscription or a build
440
- dependency, and the version it was released against), every recipe a subscription to it would install, every
441
- question that would ask, laid out as `sous subscription add --dry-run` lays them out, and the directories its
442
- files are written into. Everything but the files comes from the index, so a recipe nothing has installed yet
443
- is described in full, offline. `REF` is `namespace/recipe`, a recipe name alone, or either with a
444
- `repository:` qualifier. Example: `sous recipe show omakase/house`
303
+ Manages which recipes the project subscribes to. `REF` is `namespace` or `namespace/recipe`, optionally with an
304
+ `@<range>` and a `repo:` prefix; see [Refs](repositories-file-formats.md#refs-how-anything-is-named).
305
+
306
+ - `subscription add` (or `sous subscribe`) subscribes, then builds so the recipe's files are on disk. Answer a
307
+ recipe's questions ahead of time with `--answer <name>=<value>` or `--answers-file <path>`, and let it install
308
+ the sous plugins it requires with `--install-plugins`.
309
+ - `subscription remove` (or `sous unsubscribe`) removes a subscription and everything only it brought in.
310
+ - `subscription update [REF]` moves the lockfile's pins to the newest versions their ranges allow, then
311
+ rebuilds. See [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
312
+ - `subscription disable REF` and `subscription enable REF` switch a subscription off or back on in
313
+ `conf.d/510-subscriptions.jsonc`, leaving the rest of that file as it is.
314
+ - `subscription list` lists the subscriptions, switched-off ones included, with their pins and latest versions.
315
+
316
+ ```bash
317
+ sous subscribe workflow/task-files@^1.2.0 --answer apiUrl=https://api.example.com
318
+ sous subscription disable tool-usage/automated-browser-tasks
319
+ sous subscription update
320
+ ```
445
321
 
446
- ## lock
322
+ ## namespace and recipe
447
323
 
448
- Inspects and repairs this project's lockfile; both commands work from what is on disk and fetch nothing.
324
+ Browse what the trusted repositories publish, offline.
449
325
 
450
- ### `sous lock show`
451
- Prints what `.sous/sous.lock.json` pins: the recipe, the version, the repository it came from, and who holds it
452
- (this project, or the recipes that require it). Example: `sous lock show`
326
+ - `namespace list` lists every namespace and how much of it the project subscribes to.
327
+ - `namespace show REF` lists one namespace's recipes, with their latest and pinned versions.
328
+ - `recipe list` lists every recipe, across every namespace.
329
+ - `recipe show REF` describes one recipe completely: its versions, dependencies, the questions it asks and where
330
+ its files go, even before anything installs it.
453
331
 
454
- ### `sous lock rebuild`
455
- Recomputes the whole lockfile from the subscriptions the config declares and the cached indexes, starting from
456
- empty, so an entry nothing holds any more is dropped rather than carried through: the repair for a file that
457
- drifted through a hand edit or a bad merge. It asks nothing, grants no trust and downloads nothing. The core
458
- version this installation of sous ships resolves even when the cached index has not published it yet, exactly
459
- as it does in a build. To move pins to versions published since the last fetch, use `sous subscription update`.
460
- Takes `--dry-run`. Example: `sous lock rebuild --dry-run`
332
+ ```bash
333
+ sous namespace show sous-recipes:core
334
+ sous recipe show omakase/house
335
+ ```
461
336
 
462
- ## vars
337
+ ## lock
338
+
339
+ Inspects and repairs the project's lockfile, `.sous/sous.lock.json`, without fetching anything.
463
340
 
464
- Inspects the variables this project's recipes define, and the answers they hold. `NAME` is a bare variable name
465
- or a full `namespace/recipe.name` key. Bare `sous vars` is shorthand for `vars list` and `sous vars <name>` for
466
- `vars show <name>`; a variable named `list`, `show` or `ask` is reached the long way, as `sous vars show list`.
467
- See [Recipe variables](repositories-variables.md).
341
+ - `lock show` prints what the lockfile pins, and why each recipe is there.
342
+ - `lock rebuild` recomputes the lockfile from scratch from the subscriptions and the cached indexes: the repair
343
+ for a lockfile damaged by a hand edit or a bad merge.
468
344
 
469
- ### `sous vars list`
470
- Lists every variable this project's recipes define, with the environment variable that answered each one and
471
- where the value came from. `--file <path>` reads the definitions from a standalone definitions file instead.
472
- Example: `sous vars list --file ./questions.yaml`
345
+ ```bash
346
+ sous lock rebuild --dry-run
347
+ ```
473
348
 
474
- ### `sous vars show NAME`
475
- Shows everything about one variable, including every environment variable on the resolution ladder and which
476
- rung answered; takes `--file <path>`. Example: `sous vars show workflow/task-files.apiUrl`
349
+ ## vars
477
350
 
478
- ### `sous vars ask [NAME]`
479
- Asks the variables this project's recipes define and stores the answers in the `.sous` env files. `NAME` is a
480
- variable, an environment variable name, a recipe, a namespace or a repository; anything larger than a variable
481
- asks every question it publishes. Takes `--file <path>` and `--dry-run`.
351
+ Inspects the questions the project's recipes ask, and the answers they hold; see
352
+ [Recipe variables](repositories-variables.md). `sous vars` alone is `vars list`.
482
353
 
483
- - `--repo <name>`, `--namespace <name>`, `--var <name>`: narrow the run. `--var` repeats.
484
- - `--all`: ask every variable again, including the ones already answered.
485
- - `--accept-first`: take the first candidate when a name means more than one thing.
486
- - `--answer <name>=<value>`, `--answers-file <path>`: as on `subscription add`.
354
+ - `vars list` lists every variable, with where its value came from.
355
+ - `vars show NAME` shows everything about one variable.
356
+ - `vars ask [NAME]` asks the questions and stores the answers in the `.sous` env files. `--env-file .env` or
357
+ `--env-file .env.local` stores every answer of the run in that one file (committed, or this machine only); a
358
+ secret or machine-specific variable headed for the committed `.env` is warned about and needs a yes (`--yes`).
487
359
 
488
- Example: `sous vars ask --namespace workflow --var apiUrl`
360
+ ```bash
361
+ sous vars show workflow/task-files.apiUrl
362
+ sous vars ask --namespace workflow
363
+ ```
489
364
 
490
- ## Exit behavior and error shape
365
+ ## Exit codes and errors
491
366
 
492
- A command that succeeds exits `0`. A command line sous could not parse (a missing argument, an unknown flag, a
493
- value outside a flag's options) exits `2`. Every other failure exits `1`. A broken config halts sous rather than
494
- producing output built on a guess. A build with a compile error carries on long enough to compile every target
495
- and list every error, then exits `1`, leaving the last good copy of each output that had an error;
496
- `--strict` on `build` and `compile` makes compile warnings fail the run too.
367
+ A command that succeeds exits `0`, a command line sous could not parse exits `2`, and every other failure exits
368
+ `1`. A broken config stops sous rather than producing output built on a guess.
497
369
 
498
- A failure prints one error block, in plain language, and nothing else; a usage mistake gets the command's own
499
- help under it, on standard error. An error sous raises names the cause and the cure:
370
+ A failure prints one error block that names the cause and the fix:
500
371
 
501
372
  ```term
502
373
  $ sous subscription add workflow --non-interactive
@@ -509,19 +380,11 @@ $ sous subscription add workflow --non-interactive
509
380
  pass '--accept-first' to take the first candidate listed above.
510
381
  ```
511
382
 
512
- No expected failure prints a stack trace. A failure sous did not expect prints the message and one more sentence
513
- asking you to set `SOUS_DEBUG=1` and run the command again. Set `SOUS_DEBUG` to anything but `0`, `false`, `no`
514
- or `off` and every reported failure prints its stack to standard error underneath the message:
515
- `SOUS_DEBUG=1 sous build`. The one other thing it changes is that every hand-off to a project's own install
516
- announces itself in full, not only one between different versions; `--verbose` does the same.
517
-
518
- `SOUS_NO_DELEGATE` is the other environment variable every command reads. Set it the same way and the copy of
519
- sous you invoked runs the command, even inside a project that installs its own `@sous-io/sous`; see
520
- [Installing](README.md#installing) for the hand-off it switches off.
383
+ Two environment variables change how any command runs:
521
384
 
522
- Every listing fits itself to the terminal it runs in: columns shrink, descriptions wrap, and a path or URL is
523
- cut in the middle so the host and the last segment both survive. On a terminal too narrow, the least important
524
- columns step aside and a line under the table names them; nothing is hidden when the output is not a terminal.
385
+ - `SOUS_DEBUG=1` prints the stack trace under every failure, and announces every hand-off to a project's own
386
+ install of sous.
387
+ - `SOUS_NO_DELEGATE=1` runs the copy of sous you invoked, even inside a project that installs its own; see
388
+ [Installing](README.md#installing).
525
389
 
526
- For what a particular repository error is telling you, and how to clear it, see
527
- [Repositories troubleshooting](repositories-troubleshooting.md).
390
+ For what a repository error is telling you, see [Repositories troubleshooting](repositories-troubleshooting.md).