@sous-io/sous 1.0.19 → 1.1.1

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.
@@ -41,6 +41,15 @@ already exists.
41
41
  - `--timings` prints how long each step of the run took.
42
42
  - `--json`, on the commands that print a listing or a report, prints it as JSON instead.
43
43
 
44
+ A table fits the terminal's width, and steps aside its least important columns when the window is too narrow.
45
+ Sent to a pipe or a file, a table keeps every column and follows the `COLUMNS` environment variable when it is
46
+ set; when it is not, the table is laid out 2,000 characters wide, so each row stays on one line for `grep`:
47
+
48
+ ```bash
49
+ sous recipe list | grep workflow
50
+ COLUMNS=120 sous vars list > vars.txt
51
+ ```
52
+
44
53
  Sous reports, at the `debug` level, when a step takes longer than its time budget, so the report shows only
45
54
  with `--debug` or `--log-level debug`. It goes to standard error, so it never mixes with `--json` output. Time
46
55
  spent waiting for you to answer a question does not count. The `budgets` config key changes a budget, and
@@ -69,40 +78,74 @@ Every topic answers to both spellings of its name (`repo` and `repos`, `subscrip
69
78
  so on), and `sous search`, `sous subscribe` and `sous unsubscribe` are one-word forms of `repo search`,
70
79
  `subscription add` and `subscription remove`.
71
80
 
72
- ## Top-level commands
73
-
74
- ### `sous init [DIRECTORY]`
81
+ Some topics and commands also have a short form. A topic's short form reaches every command under it, and the
82
+ short forms combine: `sous ns ls` is `sous namespace list`.
75
83
 
76
- Sets a project up for sous: it imports the project's existing agent files into a new `.sous/` directory, then
77
- runs the first build. Sous owns all of a project's agent configuration from then on. `CLAUDE.md`, `AGENTS.md` and
78
- `.claude/skills/` at the project root become build output, so edit their sources under `.sous/` and run
79
- `sous build` after cloning.
84
+ | Short form | Stands for | Example |
85
+ |---|---|---|
86
+ | `ns` | `namespace` | `sous ns show core` |
87
+ | `sub` | `subscription` | `sous sub add workflow/task-files` |
88
+ | `rc` | `recipe` | `sous rc show omakase/house` |
89
+ | `cfg` | `config` | `sous cfg get compilation` |
90
+ | `ls` | `list`, in `namespace`, `recipe`, `repo`, `subscription` and `vars` | `sous repo ls` |
91
+ | `rm` | `remove`, in `repo` and `subscription` | `sous sub rm workflow/task-files` |
80
92
 
81
- It writes a commented `sous.config.js`, the instructions source `.sous/memories/instructions.tpl.md` that the
82
- config compiles into both `CLAUDE.md` and `AGENTS.md` at the project root, the `.sous/.env` and
83
- `.sous/.env.local.example` files, the sous block in `.sous/.gitignore`, and a sous block in the project-root
84
- `.gitignore` that ignores `/CLAUDE.md`, `/AGENTS.md` and `/.claude/skills/`. A project with a `package.json` also
85
- gains `@sous-io/sous` as a devDependency at the running version; run your package manager's install afterwards.
93
+ Every command's `--help` lists the other spellings it answers to, under ALIASES.
86
94
 
87
- The instructions source holds two includes:
95
+ ## Top-level commands
88
96
 
89
- ```markdown
90
- @*/**/*.md
91
- @#memories/**/*.md
92
- ```
97
+ ### `sous init [DIRECTORY]`
93
98
 
94
- The first pulls in this project's own memories, every markdown file in a folder beside the source (such as
95
- `imported/` and `conventions/`). The second pulls in every memory the subscribed recipes publish. Because the
96
- config's target writes `CLAUDE.md`, the Claude Code plugin's own memory target for that file steps aside. An
97
- include that matches nothing stops a build, so the project's folder is never empty: when there was nothing to
98
- import, init writes a starter memory at `.sous/memories/project/overview.tpl.md` (or
99
- `.sous/memories/project/sous-repo.tpl.md` in a recipe repository, one with a `sous.repo.yaml`).
99
+ Sets a project up for sous: it imports the project's existing agent files into a new `.sous/` directory, offers
100
+ the git hooks, then runs the first build. Sous owns all of a project's agent configuration from then on. What a
101
+ build writes (the memories file, such as `.claude/rules/SOUS-MEMORIES.md` for Claude Code, and `.claude/skills/`)
102
+ is build output, so edit the sources under `.sous/` and run `sous build` after cloning.
103
+
104
+ It writes:
105
+
106
+ - `.sous/sous.config.jsonc`, the primary config: JSON with comments that explain each block, and a `$schema`
107
+ pointing at the config schema published with the running version, so an editor completes and checks it. Its
108
+ one target compiles the project's own skills; it compiles no `AGENTS.md` or `CLAUDE.md`. A project may still
109
+ write a `sous.config.js` by hand instead.
110
+ - `.sous/MEMORIES.tpl.md`, the source of the memories file each coding-tool plugin compiles. It holds the two
111
+ default lines under a comment saying what each includes:
112
+
113
+ ```markdown
114
+ @memories/**/*.md
115
+ @#memories/**/*.md
116
+ ```
117
+
118
+ The first includes the project's own memories, every markdown file under `.sous/memories/`; the second, every
119
+ memory the subscribed recipes publish. Removing a line removes that part, and moving a line changes the order.
120
+ - `.sous/memories/project.tpl.md`, a starter memory with generic text to replace ("Describe the project here: what
121
+ it is, how it is built, and how it is tested."), when there was nothing to import. In a recipe repository (one
122
+ with a `sous.repo.yaml`) it says instead that the repository is a Sous Repo, and names the core skills.
123
+ - `.sous/.env`, `.sous/.env.local.example`, and the sous block in `.sous/.gitignore` (which ignores, among
124
+ others, `backups/`).
125
+ - `.sous/sous.lock.json` with `migratedVersion` set to the running version, so a new project has no migrations
126
+ pending.
127
+ - Once, a sous block in the project's own `.gitignore`, listing what the builds write outside `.sous/`:
128
+
129
+ ```text
130
+ # >>> sous managed (do not edit between these markers)
131
+ /.claude/rules/SOUS-MEMORIES.md
132
+ /.claude/skills/
133
+ /.claude/agents/
134
+ /AGENTS.override.md
135
+ # <<< sous managed
136
+ ```
137
+
138
+ No build keeps this block current. A project that commits its own skills or agents removes that line.
139
+
140
+ A project with a `package.json` also gains `@sous-io/sous` as a devDependency at the running version.
100
141
 
101
142
  What init imports, before the first build:
102
143
 
103
144
  - **The instructions.** A root `CLAUDE.md` or `AGENTS.md` is copied to `.sous/memories/imported/` as plain `.md`,
104
145
  so Liquid never touches it. A file that is a symlink to the other, holds the same text, or only points at the
105
- other (at most 3 non-blank lines and 400 characters, naming the other file) is skipped.
146
+ other (at most 3 non-blank lines and 400 characters, naming the other file) is skipped. No build writes the
147
+ root files any more, so both are then backed up and removed, imported or skipped: a coding tool that read
148
+ them beside the memories file would read the same instructions twice.
106
149
  - **The files they include.** A line holding only `@path.md` includes that file, and init follows those lines
107
150
  through every included file. Each file is moved (the default), copied, or left where it is. A moved or copied
108
151
  file goes to `.sous/includes/<its path from the project root>`, outside `memories/`, so it appears only where
@@ -116,33 +159,114 @@ What init imports, before the first build:
116
159
  the build warns that the recipe's copy was not written.
117
160
 
118
161
  Everything init moves is backed up first, to `.sous/backups/<YYYY-MM-DD>/<HHMM-SS>/<path>`, which git ignores.
119
- Git stops tracking the root `CLAUDE.md`, `AGENTS.md` and each moved skill folder (`git rm -r --cached`); the files
120
- stay on disk until the build compiles over them. `.claude/agents/`, `.claude/commands/` and
121
- `.claude/settings.json` are left alone.
162
+ Git stops tracking the root `CLAUDE.md`, `AGENTS.md` and each moved skill folder (`git rm -r --cached`).
163
+ `.claude/agents/`, `.claude/commands/` and `.claude/settings.json` are left alone.
122
164
 
123
165
  What happens to the included files is one question, asked once after init lists them: move them, copy them,
124
166
  leave them, or choose for each file. `--move-includes`, `--copy-includes` and `--leave-includes` answer it ahead
125
167
  of time, one at a time, and `--yes` accepts the default, move. A run with no terminal and none of these flags
126
168
  fails, naming them. `--dry-run` plans with the default and asks nothing.
127
169
 
170
+ In a project with a `.git` folder, init asks whether to install the git hooks, which
171
+ [`sous init hooks`](#sous-init-hooks-directory) describes, and then whether to add the ones that run after a pull.
172
+ `--hooks` and `--no-hooks` answer the first question, `--pull-hooks` and `--no-pull-hooks` the second, and `--yes`
173
+ installs the hooks without the pull ones. With a `package.json`, the hooks run the package manager's install,
174
+ and init then offers to run it (`--install`, `--no-install`; `--yes` runs it). That install runs `sous build`
175
+ through the package script, so init skips its own build; when the install is declined, init builds by itself.
176
+ `--no-build` also leaves the install out, unless `--install` asks for it.
177
+
128
178
  A project whose `.sous/` already holds a config is left untouched. `--no-build` skips the first build.
129
179
 
130
180
  ```bash
131
181
  sous init
132
182
  sous init --name "My Project"
133
183
  sous init --copy-includes
184
+ sous init --yes --pull-hooks
185
+ sous init --no-hooks
134
186
  sous init --dry-run
135
187
  ```
136
188
 
189
+ ### `sous init hooks [DIRECTORY]`
190
+
191
+ Installs the git hooks that give a new worktree, and each checked-out branch, Sous's output. Sous's output is
192
+ git-ignored, so a new worktree starts without it; git runs `post-checkout` whenever a worktree is created or a
193
+ branch is checked out, whoever runs git (a person, Claude Code, the Claude Desktop app, an IDE).
194
+
195
+ ```text
196
+ git worktree add / git checkout <branch>
197
+ -> .husky/post-checkout runs `pnpm install`
198
+ -> pnpm runs the "prepare" script
199
+ -> sous build
200
+ ```
201
+
202
+ - **With a `package.json`:** Husky is added as a dev dependency, and `.husky/post-checkout` runs the package
203
+ manager's install (`npm install`, `pnpm install` or `yarn install`, by the manager sous detects) on every
204
+ branch checkout. The script the manager runs after an install runs Husky and `sous build`: `prepare` for npm
205
+ and pnpm, `postinstall` for Yarn, whose newer versions skip `prepare` on install. A script already under that
206
+ name keeps what it has, and Sous's part runs after it. The guard `|| exit 0` means a missing `sous` command (an
207
+ install without dev dependencies) or a failed build prints its error and does not fail the install. At the
208
+ end, sous offers to run the install, which installs Husky and so turns the hooks on (`--install`,
209
+ `--no-install`; `--yes` runs it). Since sous has just added Husky to `package.json`, that install may update the
210
+ lockfile even where the manager would freeze it in CI (`pnpm install --no-frozen-lockfile`,
211
+ `yarn install --no-immutable` for Yarn 2 and later); the hook itself runs the plain install. Sous does not look for other hook managers: installing Husky points git at
212
+ `.husky/`, so another manager's hooks stop running until the project sorts that out.
213
+ - **Without one:** the repository's own `post-checkout` hook (in `.git/hooks/`, or wherever `core.hooksPath`
214
+ points) runs `sous build` directly, and does nothing when there is no `sous` command.
215
+
216
+ `post-checkout` is installed by default. Sous asks whether to add `post-merge` (after a pull that merges) and
217
+ `post-rewrite` (after a rebase, including a pull set to rebase); `--pull-hooks` and `--no-pull-hooks` answer, and
218
+ `--yes` leaves them out. Each hook prints a failure and exits 0, so git carries on.
219
+
220
+ The hook for pnpm, `.husky/post-checkout`:
221
+
222
+ ```sh
223
+ # >>> sous managed: init hooks (do not edit between these markers)
224
+ # After a checkout, install the dependencies; the "prepare" script then runs `sous build`, so the
225
+ # files Sous writes match this checkout. A failure is printed, and git carries on.
226
+ if [ "$3" = "1" ]; then
227
+ pnpm install || echo "sous: 'pnpm install' failed after a checkout; git carried on." >&2
228
+ fi
229
+ # <<< sous managed: init hooks
230
+ ```
231
+
232
+ And the script it adds to a `package.json` that had none:
233
+
234
+ ```json
235
+ {
236
+ "scripts": {
237
+ "prepare": "husky && sous build || exit 0"
238
+ }
239
+ }
240
+ ```
241
+
242
+ A hook file that already exists keeps its lines and gains Sous's block after them; running the command again
243
+ replaces the block and changes nothing else. Installing the hooks is a one-time action: no build puts them back,
244
+ since a project may change them.
245
+
246
+ Only a project whose `.sous/` is at the top of its git repository is supported, since the hook, the install and
247
+ the build all run there. Anywhere else (a project in a folder of a monorepo, say) the command stops, says why,
248
+ and prints the lines to add by hand. `--dry-run` shows the files and the install command and changes nothing.
249
+
250
+ ```bash
251
+ sous init hooks
252
+ sous init hooks --pull-hooks
253
+ sous init hooks --yes --no-install
254
+ sous init hooks --dry-run
255
+ ```
256
+
137
257
  ### `sous build`
138
258
 
139
259
  Compiles the project's outputs, then removes the ones the config no longer produces. It is the command you want
140
- almost always. `-w, --watch` rebuilds on every change to a source file, a config file or a linked checkout;
260
+ almost always. `-w, --watch` rebuilds on every change to a source file, a config file or a linked checkout,
261
+ and reloads the config when a file is added to or removed from a glob target's folder;
141
262
  `--rebuild` ignores cached hashes and reprocesses everything; `--strict` makes compile warnings fail the build.
142
263
 
143
264
  Before it compiles, a build prepares the project's recipes: it pins any new subscription, restores whatever this
144
265
  machine's recipe store is missing, and lists each recipe that has a newer version within its range (it moves no
145
- pin; see [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions)). The other commands
266
+ pin; see [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions)). It warns about each
267
+ recipe it builds that its repository retired, naming the replacements; in a terminal it offers to subscribe to
268
+ each replacement of a recipe the project subscribes to by name, then to remove the old subscription (see
269
+ [Retired recipes](repositories-consuming.md#retired-recipes)). The other commands
146
270
  that build (`init`, `launch`, `prune`, `subscription add` and the like) run this same build.
147
271
 
148
272
  A build compiles only the recipes whose subscriptions are switched on on this machine. Each one it skips gets a
@@ -154,14 +278,69 @@ Skipped tool-usage/automated-browser-tasks: its subscription is switched off (co
154
278
  Pruned 4 outputs it had written.
155
279
  ```
156
280
 
281
+ A build opens with its Command Variables (the project, its config file and the flags that change the run) and
282
+ then prints a block for each file it wrote, removed or could not write. A file that was already up to date gets
283
+ no block unless you pass `--debug`, which shows every unchanged file too, with its size in tokens. Every build
284
+ ends with one line counting the files, before `Done.`:
285
+
286
+ ```text
287
+ $ sous build
288
+ $ Command Variables:
289
+ Project: my-project
290
+ Config : /home/me/my-project/.sous/sous.config.jsonc
291
+
292
+ ▷ SKILL.tpl.md
293
+ Entry Point: /home/me/my-project/.sous/skills/review/SKILL.tpl.md
294
+ ✓ /home/me/my-project/.claude/skills/review/SKILL.md (~2,905 tokens)
295
+
296
+ Files: 1 written (1 updated), 14 unchanged.
297
+
298
+ Done.
299
+ ```
300
+
301
+ With `--debug`, an unchanged file reads `⊘ /home/me/my-project/.claude/skills/plan/SKILL.md (unchanged, ~1,240
302
+ tokens)`. The count adds "removed" and "not written" only when there are some, and a dry run says what it
303
+ would do: `Files: 2 would be written (1 new, 1 updated), 13 unchanged.` `init` and `launch` print the same
304
+ blocks and the same line, since they run this build. All of it goes to standard error; with `--json`, standard
305
+ output holds the build's result as data.
306
+
157
307
  A compile error (a missing or circular include, a template that fails to render, a file sous cannot read) fails
158
308
  the build, but only after every target is compiled and every error listed. An output whose target had an error is
159
309
  not written, so the copy from the last good build stays in place. A build also warns about every recipe memory
160
310
  that no output includes; see [Recipe memories](repositories-consuming.md#recipe-memories).
161
311
 
312
+ After preparing the recipes, one build runs these steps, in this order:
313
+
314
+ 1. The `check` handlers of the recipes and plugins (see [Handlers](handlers.md)). An error from one stops the
315
+ build here, before anything in the project is written, and the build ends with exit code 1. A warning is
316
+ printed and the build goes on.
317
+ 2. The `beforeBuild` handlers.
318
+ 3. The compiler, then the prune of outputs the config no longer produces.
319
+ 4. The declared edits to files sous does not own, and their assertions (see
320
+ [Editing files Sous does not own](editing-files.md)). An assertion at level error that fails leaves that one
321
+ file unwritten; every other file is written, and the build ends with exit code 1.
322
+ 5. The `afterBuild` handlers.
323
+
324
+ A compile error skips steps 4 and 5. Three flags let a build finish in spite of failures. Each failure is still
325
+ printed, as a warning, and the build ends as successful. There is no setting that makes this permanent: it is a
326
+ choice made on each run.
327
+
328
+ | Flag | What it lets through |
329
+ | --- | --- |
330
+ | `--ignore-failed-checks` | An error a `check` handler reports |
331
+ | `--ignore-failed-assertions` | A failed assertion at level error; the file is then written |
332
+ | `--keep-going` | Both |
333
+
334
+ `--dry-run` runs the `check` handlers (they only report), works out every edit and checks every assertion, and
335
+ writes nothing; it runs no `beforeBuild` or `afterBuild` handler, since those act. Watch mode runs every step on
336
+ each rebuild, with the flags it was started with. `sous prune` runs none of the handlers and no edits. The other
337
+ commands that build (`init`, `launch`, `subscription add` and the like) run the same steps without these flags,
338
+ so a failed check stops them too; run `sous build --ignore-failed-checks` first when that is what you want.
339
+
162
340
  ```bash
163
341
  sous build
164
342
  sous build --watch
343
+ sous build --keep-going
165
344
  ```
166
345
 
167
346
  ### `sous compile`, `sous prune`, `sous clear`
@@ -211,15 +390,19 @@ Sous never deletes backups; remove old ones from `.sous/backups/` yourself.
211
390
  ### `sous launch TOOL...`
212
391
 
213
392
  Builds the project, then starts a coding agent: one an agent plugin provides (the built-in Claude Code plugin
214
- provides `claude`), or one configured under `tools` in the config. A failed build starts nothing.
393
+ provides `claude-code`, and the built-in [Codex plugin](codex.md) provides `codex` once a project turns it on), or
394
+ one configured under `tools` in the config. A failed build starts nothing. The settings for the built-in Claude
395
+ Code one are under `tools.claude-code` (`command`, `args`, `promptFile`, `headless`). Before version 1.1.0 the
396
+ tool was named `claude`; `sous launch claude` is not kept as an alias, and when no tool has that name the error
397
+ suggests `sous launch claude-code`.
215
398
  `--continuous` restarts the agent whenever it exits, and `--no-build` skips the build.
216
399
 
217
400
  Arguments `launch` does not recognize are passed to the agent. Put one that clashes with a sous flag after a
218
401
  bare `--`:
219
402
 
220
403
  ```bash
221
- sous launch claude --resume
222
- sous launch claude -- -c
404
+ sous launch claude-code --resume
405
+ sous launch claude-code -- -c
223
406
  ```
224
407
 
225
408
  ### `sous search TEXT`
@@ -231,16 +414,75 @@ Searches the recipes every trusted repository publishes, by name or description.
231
414
  sous search task
232
415
  ```
233
416
 
234
- ### `sous update`
417
+ ### `sous update [REF]`
418
+
419
+ Moves the lockfile's pins to the newest versions their ranges allow, then rebuilds: every subscription, or only
420
+ the repository, namespace or recipe `REF` names. `--dry-run` prints the plan and changes nothing. It asks before
421
+ it changes anything and before trusting a repository a newer version needs; `--yes` answers yes, and
422
+ `--answer <name>=<value>` or `--answers-file <path>` answer a new version's questions ahead of time.
423
+ `sous subscription update` and `sous recipe update` are other spellings of it. See
424
+ [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
425
+
426
+ ```bash
427
+ sous update --dry-run
428
+ sous update workflow/task-files --yes
429
+ ```
430
+
431
+ ### `sous upgrade`
235
432
 
236
- Updates sous itself: the global install, the project's own install, or both, each through the package manager
433
+ Upgrades sous itself: the global install, the project's own install, or both, each through the package manager
237
434
  that installed it. It prints every plan and asks before each install. By default each install moves to the
238
435
  newest version in its current major; `--major` goes past it and `--version <version|range|tag>` picks one, a
239
- downgrade included. See [Updating](README.md#updating).
436
+ downgrade included. After the project's install moves to a newer version, the new copy runs the
437
+ [migrations](#sous-doctor) that version brings, then builds the project; `--answer <name>=<value>` answers a
438
+ migration's question ahead of time. See [Upgrading](README.md#upgrading).
240
439
 
241
440
  ```bash
242
- sous update --dry-run
243
- sous update --version next
441
+ sous upgrade --dry-run
442
+ sous upgrade --version next
443
+ ```
444
+
445
+ ### `sous doctor`
446
+
447
+ Checks the project's health, runs the migrations a newer version of sous brought, and offers to fix each
448
+ problem it finds, asking before each fix. Its checks, in order:
449
+
450
+ 1. The config loads.
451
+ 2. The lockfile agrees with the subscriptions (fix: write the lockfile the subscriptions make, keeping every pin
452
+ their ranges still allow). To know what each recipe depends on, sous reads its files, downloading into this
453
+ machine's recipe store any it lacks, and says which it downloaded. A recipe it still cannot read is a
454
+ problem with no fix, naming it: a lockfile written then would drop the pins of what it depends on.
455
+ 3. Required recipe variables have answers (fix: ask them).
456
+ 4. Every migration for this version of sous has run (fix: run them). This check runs even when the config does
457
+ not load, since a migration may be what makes it load again (an option a newer sous removed). When it does,
458
+ the config is read again in the same run: the first check shows as fixed, and the checks it had skipped run.
459
+ 5. The git hooks are turned on, when the project was set up with them (fix: `sous init hooks --install`). Sous
460
+ reads what `sous init hooks` committed: hook files in `.husky/` holding its marked block. They are on when
461
+ git's hooks folder is Husky's `.husky/_`, which the package manager's install sets up; a fresh clone whose
462
+ install has not run is what this finds. A project without a `package.json` keeps its hook outside git, so a
463
+ new clone cannot tell, and the check says so.
464
+ 6. The `check` handlers of the recipes and plugins report no errors. Their errors are a problem and their
465
+ warnings a warning, one line each. No fix: what they report is yours to put right.
466
+ 7. Every assertion on the files sous edits holds, checked without writing anything. A failed assertion at level
467
+ error is a problem; one at level warn is a warning. No fix.
468
+ 8. The files sous wrote are present and unchanged (fix: build).
469
+
470
+ Plugins add checks of their own. `--dry-run` reports and changes nothing in the project (it may download
471
+ recipes into this machine's recipe store, and says so); `--yes` applies every fix without asking and takes the
472
+ default answer to each migration's question; `--answer <name>=<value>` answers one question, a migration's or a
473
+ recipe variable's; `--only <check>` runs one check. It ends with exit code 1 when a problem remains. Migrations
474
+ waiting for an answer nobody could give (no terminal, no `--yes`, no `--answer`) are listed by name, each with
475
+ its questions and the `--answer` that gives each one; a migration that asks nothing waits too, because
476
+ migrations run in order and none runs until every question is answered. They do not change the exit code, and
477
+ the last line says they wait: "Nothing failed, but 3 migrations are waiting for an answer."
478
+
479
+ A migration brings a project's files in line with a newer version of sous. Each runs once for the project: the
480
+ lockfile records the version of sous whose migrations the project last ran. While one is waiting, every other
481
+ command prints one line saying so, and carries on.
482
+
483
+ ```bash
484
+ sous doctor --dry-run
485
+ sous doctor --yes
244
486
  ```
245
487
 
246
488
  ### `sous mcp`
@@ -286,7 +528,7 @@ Inspects the built configuration; see [Inspecting and validating](config-inspect
286
528
  - `sous config show` prints the built config as JSON, with config expressions evaluated: what sous will do on
287
529
  this machine. `--layers` shows each change in order and what made it.
288
530
  - `sous config get PATH` prints one value by dot-path. `--layers` shows every file, recipe or plugin that
289
- changed it.
531
+ changed it, each named in full, and each value as pretty-printed JSON, never cut short.
290
532
  - `sous config validate` checks the config against its schema, then resolves every variable, which is what
291
533
  finds circular and undefined `${var}` references.
292
534
 
@@ -353,10 +595,12 @@ sous repo contribute workflow/task-files --finish --title "Clarify the resume st
353
595
  ### `sous repo init [DIRECTORY]`
354
596
 
355
597
  Creates a new recipe repository, then runs [`sous init`](#sous-init-directory) in the same directory, so the
356
- repository is also a sous project whose `CLAUDE.md`, `AGENTS.md` and `.claude/skills/` are build output. It
598
+ repository is also a sous project whose memories file and `.claude/skills/` are build output. It
357
599
  passes `--yes`, `--move-includes`, `--copy-includes`, `--leave-includes`, `--no-build` and `--dry-run` through to
358
- init. A directory that already holds a sous config keeps it, and init is skipped with a note. See
359
- [Authoring a repository](repositories-authoring.md).
600
+ init. A directory that already holds a sous config keeps it, and init is skipped with a note. `--host github`
601
+ writes `.github/workflows/sous-release.yml` and `--host gitlab` writes `.gitlab-ci.yml` (default: the host of
602
+ the `origin` remote, else `github`); on GitLab it warns that the release job needs the masked CI/CD variable
603
+ `SOUS_RELEASE_TOKEN`. See [Authoring a repository](repositories-authoring.md).
360
604
 
361
605
  ```bash
362
606
  sous repo init ./my-recipes --name team-recipes --namespace workflow
@@ -366,7 +610,9 @@ sous repo init ./my-recipes --name team-recipes --namespace workflow
366
610
 
367
611
  Publishes new versions of the repository's recipes: raises their versions, regenerates the index, commits and
368
612
  tags. It plans first and asks once, and it needs a git commit identity (`user.name` and `user.email`) in the
369
- repository. `--check` only validates, and `--ci` is the setting for a merge job.
613
+ repository. `--check` only validates, and `--ci` is the setting for a merge job. A recipe the repository no
614
+ longer lists keeps its published versions in the index, marked retired, with any replacements `sous.repo.yaml`
615
+ names (see [Retire or move a recipe](repositories-authoring.md#retire-or-move-a-recipe)).
370
616
 
371
617
  ```bash
372
618
  sous repo release --recipe workflow/task-files --bump minor --push
@@ -390,11 +636,16 @@ Manages which recipes the project subscribes to. `REF` is `namespace` or `namesp
390
636
 
391
637
  - `subscription add` (or `sous subscribe`) subscribes, then builds so the recipe's files are on disk. Answer a
392
638
  recipe's questions ahead of time with `--answer <name>=<value>` or `--answers-file <path>`, and let it install
393
- the sous plugins it requires with `--install-plugins`.
639
+ the sous plugins it requires with `--install-plugins`. It checks everything before it writes anything: a
640
+ repository it has to trust is trusted in memory only, every recipe it installs is downloaded, and the recipes'
641
+ questions are asked (without a terminal, a required question nothing answers fails it). Only then are the
642
+ trust, the subscription, the lockfile and the answers written, so a failed subscription, a declined question
643
+ or Ctrl-C leaves the project as it was. Without `@<range>` the subscription accepts any version,
644
+ so an update may move it to a new major version; the plan shown before the question, and the result, name
645
+ the range recorded.
394
646
  - `subscription remove` (or `sous unsubscribe`) removes a subscription and everything only it brought in. The
395
647
  built-in `core` subscription is switched off instead, keeping its pin.
396
- - `subscription update [REF]` moves the lockfile's pins to the newest versions their ranges allow, then
397
- rebuilds. See [Moving to newer versions](repositories-consuming.md#moving-to-newer-versions).
648
+ - `subscription update [REF]` is [`sous update`](#sous-update-ref).
398
649
  - `subscription disable REF` and `subscription enable REF` switch a subscription off or back on in
399
650
  `conf.d/510-subscriptions.jsonc`, leaving the rest of that file as it is.
400
651
  - `subscription list` lists the subscriptions, switched-off ones included, with their pins and latest versions.
@@ -402,7 +653,7 @@ Manages which recipes the project subscribes to. `REF` is `namespace` or `namesp
402
653
  ```bash
403
654
  sous subscribe workflow/task-files@^1.2.0 --answer apiUrl=https://api.example.com
404
655
  sous subscription disable tool-usage/automated-browser-tasks
405
- sous subscription update
656
+ sous sub ls
406
657
  ```
407
658
 
408
659
  ## namespace and recipe
@@ -411,7 +662,8 @@ Browse what the trusted repositories publish, offline.
411
662
 
412
663
  - `namespace list` lists every namespace and how much of it the project subscribes to.
413
664
  - `namespace show REF` lists one namespace's recipes, with their latest and pinned versions.
414
- - `recipe list` lists every recipe, across every namespace.
665
+ - `recipe list` lists every recipe, across every namespace. A description takes at most three lines, the
666
+ third ending in `...` when more is left out; `recipe show` prints it whole.
415
667
  - `recipe show REF` describes one recipe completely: its versions, dependencies, the questions it asks and where
416
668
  its files go, even before anything installs it.
417
669
 
@@ -422,11 +674,13 @@ sous recipe show omakase/house
422
674
 
423
675
  ## lock
424
676
 
425
- Inspects and repairs the project's lockfile, `.sous/sous.lock.json`, without fetching anything.
677
+ Inspects and repairs the project's lockfile, `.sous/sous.lock.json`.
426
678
 
427
679
  - `lock show` prints what the lockfile pins, and why each recipe is there.
428
680
  - `lock rebuild` recomputes the lockfile from scratch from the subscriptions and the cached indexes: the repair
429
- for a lockfile damaged by a hand edit or a bad merge.
681
+ for a lockfile damaged by a hand edit or a bad merge. A recipe whose index does not record what it depends on
682
+ is downloaded to read its manifest; when one cannot be, nothing is written and the command fails, naming it.
683
+ `--dry-run` downloads nothing.
430
684
 
431
685
  ```bash
432
686
  sous lock rebuild --dry-run
@@ -440,9 +694,9 @@ Inspects the questions the project's recipes ask, and the answers they hold; see
440
694
  - `vars list` lists every variable, with where its value came from.
441
695
  - `vars show NAME` shows everything about one variable. `NAME` may also be an environment variable name that
442
696
  answers it.
443
- - `vars ask [NAME]` asks the questions and stores the answers in the `.sous` env files. `--env-file .env` or
444
- `--env-file .env.local` stores every answer of the run in that one file (committed, or this machine only); a
445
- secret or machine-specific variable headed for the committed `.env` is warned about and needs a yes (`--yes`).
697
+ - `vars ask [NAME]` asks the questions and stores the answers in the `.sous` env files. `--save-shared` stores
698
+ every answer of the run in `.sous/.env` (committed), and `--save-locally` in `.sous/.env.local` (this machine
699
+ only); the two cannot be used together. A secret or machine-specific variable headed for the committed `.env` is warned about and needs a yes (`--yes`).
446
700
 
447
701
  ```bash
448
702
  sous vars show workflow/task-files.apiUrl
@@ -50,6 +50,14 @@ when stdout is a TTY.
50
50
  ([Patches](config-layers.md#patches) explains both). It ends with the result and the number of passes the config took to
51
51
  settle.
52
52
  - `--raw` prints each config file as written, in order.
53
+ - `--harness <id>` prints that harness's own config build instead of the merged config (see
54
+ [Conditions on the harness](configuration.md#conditions-on-the-harness)). A harness with no build
55
+ is an error that names the harnesses built.
56
+
57
+ Once any change came from a harness's build, `--layers` names the build of every change
58
+ (`no harness`, `harness codex`). Changes a harness's build made to a list the merge takes from it
59
+ (compilation outputs, `editor.edits`, `recipes.contents`) are listed after the others, with the
60
+ indices of that harness's own build.
53
61
 
54
62
  ```text
55
63
  confd/620-no-diagrams.js
@@ -77,13 +85,29 @@ it. This answers "which file or plugin set this?" directly:
77
85
  ```text
78
86
  $ sous config get subscriptions."tool-usage/automated-browser-tasks".enabled --layers
79
87
  conf.d/510-subscriptions.jsonc (not set)
80
- conf.d/610-mac.jsonc { "$if": { "expr": "host.platform == 'darwin'", "then": false } }
88
+ conf.d/610-mac.jsonc {
89
+ "$if": {
90
+ "expr": "host.platform == 'darwin'",
91
+ "then": false
92
+ }
93
+ }
81
94
  → false (host.platform = "darwin")
82
95
  result false (settled after 1 pass)
83
96
  ```
84
97
 
98
+ Each layer is named in full, wrapping onto a second line when the column is too narrow for it, and each
99
+ value is pretty-printed JSON, never cut short.
100
+
101
+ `--harness <id>` reads the value from that harness's own config build:
102
+
103
+ ```bash
104
+ sous config get compilation.includeSourceComments --harness codex
105
+ ```
106
+
85
107
  `sous plugins show` lists every plugin and what it adds or replaces, and `--timings` on any command
86
- prints how long each step took, each config file included.
108
+ prints how long each step took, each config file included. Each harness's build shows as
109
+ `config.harness:<id>`, its stages and passes as `config.stage:<id>/0` and `config.pass:<id>/0.1`, and
110
+ the merge as `config.merge:config`.
87
111
 
88
112
  ## sous config validate
89
113
 
@@ -99,11 +123,17 @@ All three commands honor the same config-locating flags and env vars as every ot
99
123
 
100
124
  `sous config set <path> <value>` writes one value into a config file, changing only that key, so
101
125
  comments, key order and formatting stay. The value is read as JSON when it is valid JSON, else as
102
- text. Without `--file` it writes the main config (`sous.config.json`, `.jsonc` or `.yaml`). Sous
103
- cannot edit code, and `sous init` writes the main config as `sous.config.js`; for such a project
104
- pass `--file` with a JSON, JSONC or YAML file, which is created in `.sous/conf.d/` when it does not
105
- exist:
126
+ text. Without `--file` it writes the main config (`sous.config.json`, `.jsonc` or `.yaml`), which
127
+ is `sous.config.jsonc` in a project `sous init` set up. Sous cannot edit code; for a project whose
128
+ main config is a `sous.config.js` written by hand, pass `--file` with a JSON, JSONC or YAML file,
129
+ which is created in `.sous/conf.d/` when it does not exist:
106
130
 
107
131
  ```bash
108
132
  sous config set compilation.includeSourceComments false --file 600-settings.jsonc
109
133
  ```
134
+
135
+ Every other line of the file stays byte for byte, in YAML as in JSON. Two YAML cases are the
136
+ exception. A key written with `?` cannot be edited line by line, so the whole file is written again;
137
+ its comments are kept, but its spacing may change. A value shared through a YAML anchor (`&name`) and
138
+ its aliases (`*name`) is not set at all, since setting it would change every copy: the command stops
139
+ with an error naming the key.
@@ -31,13 +31,13 @@ Your files are applied last, after every plugin and recipe. Whenever a plugin or
31
31
  file changes the config, sous applies your `sous.config.*` and `conf.d` files again after it. So
32
32
  when a plugin or a recipe sets a key that one of your files also sets, your value wins:
33
33
 
34
- ```js
35
- // .sous/sous.config.js (excerpt)
36
- export const config = {
37
- compilation: {
38
- includeSourceComments: false,
39
- },
40
- };
34
+ ```jsonc
35
+ // .sous/sous.config.jsonc (excerpt)
36
+ {
37
+ "compilation": {
38
+ "includeSourceComments": false
39
+ }
40
+ }
41
41
  ```
42
42
 
43
43
  If a plugin sets `compilation.includeSourceComments` to `true`, the result is still `false`. In a
@@ -83,7 +83,7 @@ export function configure(config) {
83
83
  the same input. When a `.js` file changes on disk during watch mode, it is imported again.
84
84
 
85
85
  Some of the builder's operations (the full list, with each one's documentation, is the `DocumentNode`
86
- type in `packages/plugin-api/src/node.ts`):
86
+ type in `packages/sous-plugin-api/src/node.ts`):
87
87
 
88
88
  ```js
89
89
  const node = config.atPath("compilation.targets");