@sous-io/sous 1.1.9 → 1.1.11
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.
- package/dist/sous.js +114 -153
- package/docs/markdown/commands.md +18 -2
- package/docs/markdown/repositories-authoring.md +49 -16
- package/docs/markdown/repositories-quickstart.md +12 -11
- package/package.json +38 -38
- package/recipes/core/sous-skills/skills/about-sous-repos/SKILL.tpl.md +15 -4
- package/recipes/core/sous-skills/sous.recipe.yaml +1 -1
|
@@ -35,8 +35,10 @@ Sous asks a question only when it can. Piping output, redirecting it to a file a
|
|
|
35
35
|
what `--non-interactive` does; see [When sous cannot ask](repositories-consuming.md#when-sous-cannot-ask).
|
|
36
36
|
|
|
37
37
|
!> `sous clear` is the exception: without `-f` it asks even under `--non-interactive` or in CI, so pass `-f`
|
|
38
|
-
whenever you script it.
|
|
39
|
-
|
|
38
|
+
whenever you script it.
|
|
39
|
+
|
|
40
|
+
?> `sous repo init --force` used to overwrite a repository that already existed. It is now the same flag as
|
|
41
|
+
`--yes`, as on every other command, and `sous repo init` never replaces a file unless `--overwrite` is given.
|
|
40
42
|
|
|
41
43
|
## Flags that control output
|
|
42
44
|
|
|
@@ -639,8 +641,22 @@ writes `.github/workflows/sous-release.yml` and `--host gitlab` writes `.gitlab-
|
|
|
639
641
|
the `origin` remote, else `github`); on GitLab it warns that the release job needs the masked CI/CD variable
|
|
640
642
|
`SOUS_RELEASE_TOKEN`. See [Authoring a repository](repositories-authoring.md).
|
|
641
643
|
|
|
644
|
+
It never replaces a file that exists. A file such as `README.md`, `CONTRIBUTING.md`, `sous.repo.yaml` or the
|
|
645
|
+
workflow is left as it is and named in a note; `.gitignore` gains a block between sous's marker comments, and
|
|
646
|
+
its other lines stay. `--overwrite` replaces the existing files with the scaffold's. `--force` is the same flag
|
|
647
|
+
as `--yes`.
|
|
648
|
+
|
|
649
|
+
`--for-project` lets a project publish its own recipes: it writes only `sous.repo.yaml`, listing
|
|
650
|
+
`.sous/recipes/*`, and does not run init. Then it asks, one at a time, whether to add the CI workflow, an
|
|
651
|
+
example recipe in `.sous/recipes/example`, and a section about the project's recipes at the end of `README.md`.
|
|
652
|
+
`--workflow`, `--example` and `--readme` answer yes ahead of time, and `--no-workflow`, `--no-example` and
|
|
653
|
+
`--no-readme` answer no. Without a terminal, or with `--yes`, a question no switch answers adds nothing. Its
|
|
654
|
+
directory defaults to the project's root. `--in-sous-directory` writes `sous.repo.yaml` into `.sous/` instead of
|
|
655
|
+
the root, with either form.
|
|
656
|
+
|
|
642
657
|
```bash
|
|
643
658
|
sous repo init ./my-recipes --name team-recipes --namespace workflow
|
|
659
|
+
sous repo init --for-project --workflow --no-example --readme
|
|
644
660
|
```
|
|
645
661
|
|
|
646
662
|
### `sous repo release`
|
|
@@ -16,20 +16,18 @@ from a project that links the repository.
|
|
|
16
16
|
$ sous repo init ./my-recipes --name my-recipes --namespace workflow
|
|
17
17
|
▶ Creating a recipe repository:
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
wrote .gitignore
|
|
19
|
+
written sous.repo.yaml
|
|
20
|
+
written recipes/workflow/example/sous.recipe.yaml
|
|
21
|
+
written recipes/workflow/example/skills/example-skill/SKILL.tpl.md
|
|
22
|
+
written README.md
|
|
23
|
+
written CONTRIBUTING.md
|
|
24
|
+
written .gitignore
|
|
25
|
+
written .github/workflows/sous-release.yml
|
|
27
26
|
// then sous init sets the repository up as a sous project, and runs its first build
|
|
28
27
|
```
|
|
29
28
|
|
|
30
29
|
`--name` is the repository's short name (default: the directory's own name), `--namespace` the one namespace to
|
|
31
|
-
declare (default: the repository's name), `--
|
|
32
|
-
lists the files without writing them. `--host` names the repository host whose release automation to add:
|
|
30
|
+
declare (default: the repository's name), and `--dry-run` lists the files without writing them. `--host` names the repository host whose release automation to add:
|
|
33
31
|
`github` writes `.github/workflows/sous-release.yml`, and `gitlab` writes `.gitlab-ci.yml`. Without it, the host is
|
|
34
32
|
read from the directory's `origin` remote, and is `github` when there is none. Names are lowercase kebab-case, so `My-Recipes` yields `my-recipes`. Every
|
|
35
33
|
file is read back through the schemas sous uses on published repositories, so the scaffold validates. The scaffold
|
|
@@ -46,11 +44,16 @@ with a `.git` folder, whether to install the git hooks; `--yes`, `--move-include
|
|
|
46
44
|
`--leave-includes` are passed through, as are `--no-build` and `--dry-run`, and `--yes` installs the hooks. A
|
|
47
45
|
directory that already holds a sous config keeps it, and init is skipped with a note.
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
The command never replaces a file that exists, so it is safe to run in a directory that already holds a README
|
|
48
|
+
or a `.gitignore`. A file that exists (`README.md`, `CONTRIBUTING.md`, `sous.repo.yaml`, the workflow, the example
|
|
49
|
+
recipe's files) is left as it is and named in a note; when it keeps an existing `sous.repo.yaml`, it writes no
|
|
50
|
+
example recipe, which that manifest would not list. `.gitignore` gains a block between sous's marker comments,
|
|
51
|
+
below the lines already there, and a second run leaves it as it is. `--overwrite` replaces the existing files with
|
|
52
|
+
the scaffold's. `--force` is the same flag as `--yes`; it used to mean overwrite.
|
|
51
53
|
|
|
52
|
-
`sous.repo.yaml` says what the repository publishes, `sous.
|
|
53
|
-
|
|
54
|
+
`sous.repo.yaml` says what the repository publishes, and each recipe folder carries one `sous.recipe.yaml` beside the files it contributes. The scaffold writes no
|
|
55
|
+
`sous.index.json`: `sous.repo.yaml` starts with a line saying comments are removed from it, and the first
|
|
56
|
+
`sous repo release` records the catalog of published versions below the fields you edit. `CONTRIBUTING.md` is
|
|
54
57
|
for agents: it says that contribution instructions are written for agents, and that `sous build` after cloning
|
|
55
58
|
installs the sous core skills, which explain how a recipe repository works. The scaffold follows
|
|
56
59
|
[`sous-io/sous-recipes`](https://github.com/sous-io/sous-recipes), a complete repository minus its recipes, and
|
|
@@ -61,6 +64,34 @@ data: sous reads, validates and browses them without executing anything, before
|
|
|
61
64
|
dry run and in `sous repo release --check`. What trusting a repository authorizes is described under
|
|
62
65
|
[Trust](repositories.md#trust).
|
|
63
66
|
|
|
67
|
+
### Publish a project's own recipes
|
|
68
|
+
|
|
69
|
+
Any project can publish recipes too, without a separate repository. In the project, run:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
sous repo init --for-project
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
It writes one file, `sous.repo.yaml` at the project's root, naming the project and listing `.sous/recipes/*`, the
|
|
76
|
+
folders a project's own recipes live in:
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
# Note: Comments are systematically removed from this file.
|
|
80
|
+
formatVersion: 1
|
|
81
|
+
name: harbor-web
|
|
82
|
+
recipes:
|
|
83
|
+
- .sous/recipes/*
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Then it asks, one at a time, whether to add the CI workflow that checks and releases recipe changes, an example
|
|
87
|
+
recipe in `.sous/recipes/example`, and a section at the end of `README.md` saying how another project uses the
|
|
88
|
+
recipes. `--workflow`, `--example` and `--readme` answer yes ahead of time; `--no-workflow`, `--no-example` and
|
|
89
|
+
`--no-readme` answer no. Without a terminal, or with `--yes`, a question no switch answers adds nothing. The
|
|
90
|
+
README section sits between sous's marker comments, so the rest of the file is never touched. `--in-sous-directory`
|
|
91
|
+
writes the manifest into `.sous/` instead, where sous also looks for it. `--for-project` does not run
|
|
92
|
+
`sous init`; run it first if the project has no `.sous/` yet. A project with its own release pipeline adds one
|
|
93
|
+
step to it, `sous repo release --ci --push`, instead of the workflow.
|
|
94
|
+
|
|
64
95
|
## Write a recipe
|
|
65
96
|
|
|
66
97
|
Copy the example folder, edit its manifest, and add its path to the `recipes` list in `sous.repo.yaml`, which is a
|
|
@@ -372,8 +403,10 @@ publishes something. A bump edits the manifest in place, so comments, field orde
|
|
|
372
403
|
block of YAML prose may be re-wrapped and the space before a trailing comment collapsed to one.
|
|
373
404
|
|
|
374
405
|
!> A release commits the version bumps and the index, and nothing else; the only other commit sous ever makes
|
|
375
|
-
for you is `sous repo submit --commit`. It refuses to run while
|
|
376
|
-
uncommitted, because a tag names one commit and the index records what each recipe folder holds right now.
|
|
406
|
+
for you is `sous repo submit --commit`. It refuses to run while a recipe folder, `sous.repo.yaml` or the index has
|
|
407
|
+
uncommitted changes, because a tag names one commit and the index records what each recipe folder holds right now.
|
|
408
|
+
Uncommitted changes to any other file (such as the project files a newer sous rewrites when it runs its
|
|
409
|
+
migrations in a continuous integration checkout) do not stop it, and its commit leaves them out. It also
|
|
377
410
|
refuses when git does not know who is committing: set `git config user.name` and `git config user.email` first, or
|
|
378
411
|
give that identity to the account a continuous integration job runs as (the scaffolded workflow already does).
|
|
379
412
|
|
|
@@ -168,23 +168,24 @@ sous repo init ~/projects/my-recipes --name my-recipes --namespace workflow
|
|
|
168
168
|
|
|
169
169
|
```text
|
|
170
170
|
▶ Creating a recipe repository:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
wrote .gitignore
|
|
171
|
+
written sous.repo.yaml
|
|
172
|
+
written recipes/workflow/example/sous.recipe.yaml
|
|
173
|
+
written recipes/workflow/example/skills/example-skill/SKILL.tpl.md
|
|
174
|
+
written README.md
|
|
175
|
+
written CONTRIBUTING.md
|
|
176
|
+
written .gitignore
|
|
177
|
+
written .github/workflows/sous-release.yml
|
|
179
178
|
```
|
|
180
179
|
|
|
181
180
|
On GitLab (an `origin` remote on GitLab, or `--host gitlab`) the scaffold writes `.gitlab-ci.yml` instead of
|
|
182
181
|
`.github/workflows/sous-release.yml`, and warns that its release job needs a masked CI/CD variable named
|
|
183
182
|
`SOUS_RELEASE_TOKEN`; see [the scaffolded workflow](repositories-authoring.md#the-scaffolded-workflow). The
|
|
184
183
|
output goes on with what `sous init` writes and with its first build, which compiles the
|
|
185
|
-
memories file. The scaffold validates as written, and
|
|
186
|
-
declares the namespaces and lists every recipe folder; each folder's
|
|
187
|
-
recipe, with its own version.
|
|
184
|
+
memories file. The scaffold validates as written, and never replaces a file that already exists
|
|
185
|
+
(`--overwrite` does). `sous.repo.yaml` declares the namespaces and lists every recipe folder; each folder's
|
|
186
|
+
`sous.recipe.yaml` is one recipe, with its own version, and is heavily commented. To publish recipes from a
|
|
187
|
+
project you already have instead, run `sous repo init --for-project` in it; see
|
|
188
|
+
[Publish a project's own recipes](repositories-authoring.md#publish-a-projects-own-recipes).
|
|
188
189
|
|
|
189
190
|
## 7. Put something in the recipe
|
|
190
191
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sous-io/sous",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.11",
|
|
4
4
|
"description": "Compiles AI coding agent configuration (CLAUDE.md, skills, memories) from LiquidJS templates",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,49 +39,49 @@
|
|
|
39
39
|
"sous.config.schema.json"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sous-io/sous-plugin-api": "1.1.
|
|
42
|
+
"@sous-io/sous-plugin-api": "1.1.11"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"esbuild": "^0.27.4",
|
|
46
46
|
"jsonc-parser": "^3.3.1",
|
|
47
47
|
"yaml": "^2.9.0",
|
|
48
48
|
"zod": "^4.4.3",
|
|
49
|
-
"@sous-io/sous-lib-
|
|
50
|
-
"@sous-io/sous-lib-
|
|
51
|
-
"@sous-io/sous-plugin-authoring": "1.1.
|
|
52
|
-
"@sous-io/sous-plugin-build": "1.1.
|
|
53
|
-
"@sous-io/sous-plugin-claude-code": "1.1.
|
|
54
|
-
"@sous-io/sous-plugin-
|
|
55
|
-
"@sous-io/sous-plugin-
|
|
56
|
-
"@sous-io/sous-plugin-
|
|
57
|
-
"@sous-io/sous-plugin-
|
|
58
|
-
"@sous-io/sous-plugin-
|
|
59
|
-
"@sous-io/sous-plugin-
|
|
60
|
-
"@sous-io/sous-plugin-
|
|
61
|
-
"@sous-io/sous-plugin-gitlab": "1.1.
|
|
62
|
-
"@sous-io/sous-plugin-harnesses": "1.1.
|
|
63
|
-
"@sous-io/sous-plugin-host": "1.1.
|
|
64
|
-
"@sous-io/sous-plugin-init": "1.1.
|
|
65
|
-
"@sous-io/sous-plugin-
|
|
66
|
-
"@sous-io/sous-plugin-
|
|
67
|
-
"@sous-io/sous-plugin-
|
|
68
|
-
"@sous-io/sous-plugin-
|
|
69
|
-
"@sous-io/sous-plugin-
|
|
70
|
-
"@sous-io/sous-plugin-
|
|
71
|
-
"@sous-io/sous-plugin-
|
|
72
|
-
"@sous-io/sous-plugin-
|
|
73
|
-
"@sous-io/sous-plugin-
|
|
74
|
-
"@sous-io/sous-plugin-
|
|
75
|
-
"@sous-io/sous-plugin-
|
|
76
|
-
"@sous-io/sous-plugin-
|
|
77
|
-
"@sous-io/sous-plugin-
|
|
78
|
-
"@sous-io/sous-plugin-
|
|
79
|
-
"@sous-io/sous-plugin-handlers": "1.1.
|
|
80
|
-
"@sous-io/sous-plugin-editor": "1.1.
|
|
81
|
-
"@sous-io/sous-plugin-
|
|
82
|
-
"@sous-io/sous-plugin-
|
|
83
|
-
"@sous-io/sous-plugin-
|
|
84
|
-
"@sous-io/sous-plugin-
|
|
49
|
+
"@sous-io/sous-lib-documents": "1.1.11",
|
|
50
|
+
"@sous-io/sous-lib-core": "1.1.11",
|
|
51
|
+
"@sous-io/sous-plugin-authoring": "1.1.11",
|
|
52
|
+
"@sous-io/sous-plugin-build": "1.1.11",
|
|
53
|
+
"@sous-io/sous-plugin-claude-code": "1.1.11",
|
|
54
|
+
"@sous-io/sous-plugin-compiler": "1.1.11",
|
|
55
|
+
"@sous-io/sous-plugin-confd": "1.1.11",
|
|
56
|
+
"@sous-io/sous-plugin-config-files": "1.1.11",
|
|
57
|
+
"@sous-io/sous-plugin-expressions": "1.1.11",
|
|
58
|
+
"@sous-io/sous-plugin-formats": "1.1.11",
|
|
59
|
+
"@sous-io/sous-plugin-git": "1.1.11",
|
|
60
|
+
"@sous-io/sous-plugin-cli": "1.1.11",
|
|
61
|
+
"@sous-io/sous-plugin-gitlab": "1.1.11",
|
|
62
|
+
"@sous-io/sous-plugin-harnesses": "1.1.11",
|
|
63
|
+
"@sous-io/sous-plugin-host": "1.1.11",
|
|
64
|
+
"@sous-io/sous-plugin-init": "1.1.11",
|
|
65
|
+
"@sous-io/sous-plugin-github": "1.1.11",
|
|
66
|
+
"@sous-io/sous-plugin-inspect": "1.1.11",
|
|
67
|
+
"@sous-io/sous-plugin-liquid": "1.1.11",
|
|
68
|
+
"@sous-io/sous-plugin-local": "1.1.11",
|
|
69
|
+
"@sous-io/sous-plugin-mcp": "1.1.11",
|
|
70
|
+
"@sous-io/sous-plugin-memories": "1.1.11",
|
|
71
|
+
"@sous-io/sous-plugin-npm": "1.1.11",
|
|
72
|
+
"@sous-io/sous-plugin-pnpm": "1.1.11",
|
|
73
|
+
"@sous-io/sous-plugin-recipe-answers": "1.1.11",
|
|
74
|
+
"@sous-io/sous-plugin-recipes": "1.1.11",
|
|
75
|
+
"@sous-io/sous-plugin-refs": "1.1.11",
|
|
76
|
+
"@sous-io/sous-plugin-skills": "1.1.11",
|
|
77
|
+
"@sous-io/sous-plugin-update": "1.1.11",
|
|
78
|
+
"@sous-io/sous-plugin-variables": "1.1.11",
|
|
79
|
+
"@sous-io/sous-plugin-handlers": "1.1.11",
|
|
80
|
+
"@sous-io/sous-plugin-editor": "1.1.11",
|
|
81
|
+
"@sous-io/sous-plugin-yarn": "1.1.11",
|
|
82
|
+
"@sous-io/sous-plugin-doctor": "1.1.11",
|
|
83
|
+
"@sous-io/sous-plugin-migrations": "1.1.11",
|
|
84
|
+
"@sous-io/sous-plugin-codex": "1.1.11"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=22"
|
|
@@ -103,8 +103,10 @@ the next release that publishes a version.
|
|
|
103
103
|
|
|
104
104
|
## Releasing
|
|
105
105
|
|
|
106
|
-
`sous repo release` publishes. It refuses to run while
|
|
107
|
-
cannot say who is committing.
|
|
106
|
+
`sous repo release` publishes. It refuses to run while a recipe folder, the repository manifest or
|
|
107
|
+
the index has uncommitted changes, or while git cannot say who is committing. Uncommitted changes
|
|
108
|
+
to other files (a project file a sous migration rewrote, for example) do not stop it, and its
|
|
109
|
+
commit leaves them out. In one run it:
|
|
108
110
|
|
|
109
111
|
1. validates every manifest;
|
|
110
112
|
2. finds the recipes whose files changed since the tag that last published them (a recipe never
|
|
@@ -196,8 +198,11 @@ yet, then unlinks with `--update`.
|
|
|
196
198
|
## Creating a Repository
|
|
197
199
|
|
|
198
200
|
`sous repo init [dir]` writes a new recipe repository into the directory (the current one by
|
|
199
|
-
default): the repo manifest
|
|
200
|
-
placeholder skill, a README, `CONTRIBUTING.md` for agents,
|
|
201
|
+
default): the repo manifest (no index; the first release records the published data in it), one
|
|
202
|
+
example recipe with its manifest and a placeholder skill, a README, `CONTRIBUTING.md` for agents,
|
|
203
|
+
the release workflow and a block in `.gitignore`. It NEVER replaces a file that exists: an existing
|
|
204
|
+
file is left as it is and named in a note, and `.gitignore` gains a block between sous's marker
|
|
205
|
+
comments. `--overwrite` replaces existing files; `--force` is `--yes`, not overwrite.
|
|
201
206
|
`sous-io/sous-recipes` is the model a scaffold follows: a new repository is as complete as it, minus
|
|
202
207
|
its recipes. It does not run git: run `git init`, commit, and add a remote before the first release,
|
|
203
208
|
because `sous repo release` reads and writes tags. Every new recipe folder is then listed under
|
|
@@ -212,6 +217,12 @@ core skills. `--yes`, `--move-includes`, `--copy-includes`,
|
|
|
212
217
|
`--leave-includes`, `--no-build` and `--dry-run` pass through to init. A directory that already
|
|
213
218
|
holds a sous config keeps it, and init is skipped with a note.
|
|
214
219
|
|
|
220
|
+
`sous repo init --for-project` makes an existing project publish its own recipes: it writes only
|
|
221
|
+
`sous.repo.yaml` (listing `.sous/recipes/*`), runs no init, and asks one at a time about the CI
|
|
222
|
+
workflow, an example recipe and a `README.md` section; `--workflow`, `--example` and `--readme`
|
|
223
|
+
(each with a `--no-` form) answer ahead, and without a terminal none is added unless its switch
|
|
224
|
+
says so. `--in-sous-directory` writes the manifest into `.sous/`, where sous also looks for it.
|
|
225
|
+
|
|
215
226
|
## Source for this Skill
|
|
216
227
|
|
|
217
228
|
This skill comes from the `core/sous-skills` recipe, installed by sous from a recipe
|