@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.
@@ -59,9 +59,9 @@ $ SOUS_NO_DELEGATE=1 sous --version
59
59
  v0.3.0
60
60
  ```
61
61
 
62
- ### Updating
62
+ ### Upgrading
63
63
 
64
- `sous update` moves each copy of sous to a newer version (or one you choose) through the package
64
+ `sous upgrade` moves each copy of sous to a newer version (or one you choose) through the package
65
65
  manager that installed it, so you never need to remember which one that was or its syntax:
66
66
 
67
67
  - **Outside a project**, or in a project that does not install sous, it updates the global install.
@@ -73,7 +73,8 @@ manager that installed it, so you never need to remember which one that was or i
73
73
  It updates the global install as well when there is one. A Yarn Plug'n'Play project, which has
74
74
  no `node_modules`, counts as installing sous when its `package.json` declares it and a `.pnp.cjs`
75
75
  sits beside it or above it; the installed version is read from `yarn.lock`.
76
- - **After a project update**, the newly installed copy builds the project, so
76
+ - **After a project upgrade**, the newly installed copy runs the migrations its version brings (see
77
+ [`sous doctor`](commands.md#sous-doctor)), then builds the project, so
77
78
  `.sous/sous.lock.json` pins the core recipe at the new version. Under Yarn Plug'n'Play, Yarn
78
79
  runs that build (`yarn run --binaries-only sous build`). `--no-build` skips it.
79
80
 
@@ -84,7 +85,7 @@ it fails with `EBADF: bad file descriptor`. Unpack it in `package.json`, then ru
84
85
  "dependenciesMeta": { "@sous-io/sous": { "unplugged": true } }
85
86
  ```
86
87
 
87
- `update` always runs in the copy you invoked, never handed off to the project's own; a project copy
88
+ `upgrade` always runs in the copy you invoked, never handed off to the project's own; a project copy
88
89
  may be too old to have the command. A project config this copy cannot load (one written for a newer
89
90
  sous, say) is a warning rather than a stop, since installing a newer copy may be the fix.
90
91
 
@@ -98,16 +99,16 @@ its own question. Each is judged on its own version:
98
99
  dist-tag such as `next` points at. This is how you downgrade, and the plan says when it is one.
99
100
 
100
101
  `--dry-run` prints the plans, with the command each would run, and installs nothing. The other flags
101
- (prereleases, one install only, answering every question) are in `sous update --help`.
102
+ (prereleases, one install only, answering every question) are in `sous upgrade --help`.
102
103
 
103
104
  A copy run through `npx`, or one managed by Volta or by a manager sous does not drive, is listed
104
105
  with the command to run by hand, and the rest are still updated. A package manager's own failure
105
106
  is printed as the manager reported it; sous never retries with `sudo`.
106
107
 
107
108
  ```term
108
- $ sous update --dry-run
109
+ $ sous upgrade --dry-run
109
110
  // every install's plan, and nothing installed
110
- $ sous update --global --yes
111
+ $ sous upgrade --global --yes
111
112
  ```
112
113
 
113
114
  ## Where to look
@@ -2,12 +2,14 @@
2
2
  - [Design principles](design-principles.md)
3
3
  - [Skill categories](skill-categories.md)
4
4
  - [Command reference](commands.md)
5
+ - [Codex](codex.md)
5
6
  - **Configuration**
6
7
  - [The config file](configuration.md)
7
8
  - [Discovery and overrides](config-discovery.md)
8
9
  - [Layers and merging](config-layers.md)
9
10
  - [Variables](config-variables.md)
10
11
  - [Inspecting and validating](config-inspection.md)
12
+ - [Editing files Sous does not own](editing-files.md)
11
13
  - **Repositories**
12
14
  - [Overview](repositories.md)
13
15
  - [Quickstart](repositories-quickstart.md)
@@ -15,6 +17,7 @@
15
17
  - [Contributing a change](repositories-contributing.md)
16
18
  - [Authoring a repository](repositories-authoring.md)
17
19
  - [Recipe variables](repositories-variables.md)
20
+ - [Handlers](handlers.md)
18
21
  - [Providers](repositories-providers.md)
19
22
  - [File formats](repositories-file-formats.md)
20
23
  - [Troubleshooting](repositories-troubleshooting.md)
@@ -29,6 +32,15 @@
29
32
  - [Config expressions](architecture/specifications/S5-config-expressions.md)
30
33
  - [Which plugin does what](architecture/specifications/S6-concerns-and-owners.md)
31
34
  - [Everything sous can do](architecture/specifications/S7-capabilities.md)
35
+ - [One config build per harness](architecture/specifications/S8-per-harness-config-builds.md)
36
+ - [The editor](architecture/specifications/S9-the-editor.md)
37
+ - [Includes](architecture/specifications/S10-includes.md)
38
+ - [Migrations, sous doctor, upgrade and update](architecture/specifications/S11-migrations-and-doctor.md)
39
+ - [Manifests as config](architecture/specifications/S12-manifests-as-config.md)
40
+ - [Handlers](architecture/specifications/S13-handlers.md)
41
+ - [What sous init writes, and sous init hooks](architecture/specifications/S14-init-and-git-hooks.md)
42
+ - [Claude Code](architecture/specifications/S15-claude-code.md)
43
+ - [Codex](architecture/specifications/S16-codex.md)
32
44
  - **ADRs**
33
45
  - [0001: Repositories](adrs/0001-repositories.md)
34
46
  - [0002: Recipe answers in the template scope](adrs/0002-recipe-answers-in-templates.md)
@@ -54,3 +66,21 @@
54
66
  - [0022: Intents return outputs](adrs/0022-intents-return-outputs.md)
55
67
  - [0023: The project's lockfile is the only lock](adrs/0023-the-project-lockfile-is-the-only-lock.md)
56
68
  - [0024: `sous init` imports a project's agent files](adrs/0024-init-imports-agent-files.md)
69
+ - [0025: Every document edit is surgical](adrs/0025-every-document-edit-is-surgical.md)
70
+ - [0026: Declared edits to files Sous does not own](adrs/0026-declared-edits-to-files-sous-does-not-own.md)
71
+ - [0027: Assertions on edited files](adrs/0027-assertions-on-edited-files.md)
72
+ - [0028: Includes follow Claude Code's imports](adrs/0028-includes-follow-claude-code-imports.md)
73
+ - [0029: Every output file is a config entry, and variables by output path](adrs/0029-outputs-are-config-entries-and-var-overrides.md)
74
+ - [0030: Migrations, and `sous doctor`](adrs/0030-migrations.md)
75
+ - [0031: `sous upgrade`, `sous update`, and short aliases](adrs/0031-upgrade-update-and-short-aliases.md)
76
+ - [0032: A recipe's manifest is added to the config](adrs/0032-manifests-as-config.md)
77
+ - [0033: Open content kinds, `$file`, and a literal `${`](adrs/0033-open-content-kinds-and-file-values.md)
78
+ - [0034: Handlers](adrs/0034-handlers.md)
79
+ - [0035: `sous init` writes a JSONC config and installs git hooks](adrs/0035-init-and-git-hooks.md)
80
+ - [0036: Claude Code's memories go to `.claude/rules/SOUS-MEMORIES.md`](adrs/0036-claude-code-memories-file.md)
81
+ - [0037: The harness id `claude-code`, and the Claude Code content kinds](adrs/0037-claude-code-content-kinds-and-harness-id.md)
82
+ - [0038: A boolean recipe answer is a boolean in Liquid](adrs/0038-boolean-answers.md)
83
+ - [0039: Codex's memories go to a git-ignored `AGENTS.override.md`](adrs/0039-codex-memories.md)
84
+ - [0040: One config build per harness](adrs/0040-one-config-build-per-harness.md)
85
+ - [0041: A target one harness's build holds reaches that harness](adrs/0041-harness-only-targets.md)
86
+ - [0042: Retired recipes stay in the index and name their replacements](adrs/0042-retired-recipes.md)
@@ -0,0 +1,129 @@
1
+ # Codex
2
+
3
+ Sous can write its instructions and skills for [Codex](https://github.com/openai/codex), OpenAI's coding
4
+ agent, and start it with `sous launch codex`. The part of Sous that does this is the built-in plugin
5
+ `@sous-io/sous-plugin-codex`.
6
+
7
+ !> **Untested.** Codex was not installed on the machine Sous's Codex support was built on, so none of it
8
+ has been run against Codex. It follows Codex's documentation and source code.
9
+
10
+ Three points in particular are unchecked:
11
+
12
+ 1. that Codex reads an `AGENTS.override.md` at the project root in place of `AGENTS.md`;
13
+ 2. that Codex reads that file when it is git-ignored, as Sous makes it;
14
+ 3. what Codex does when its instruction files together pass its 32 KiB limit.
15
+ If you use Codex with Sous, please report what you see.
16
+
17
+ ## Turning it on
18
+
19
+ The plugin is built in but does nothing until your project turns it on, so a project that never uses
20
+ Codex gets no Codex files. Write either of these in your config:
21
+
22
+ ```jsonc
23
+ // .sous/sous.config.jsonc
24
+ {
25
+ "plugins": {
26
+ "options": {
27
+ // Even an empty object turns Codex on.
28
+ "@sous-io/sous-plugin-codex": {}
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ```jsonc
35
+ // .sous/sous.config.jsonc
36
+ {
37
+ "tools": {
38
+ // Settings for `sous launch codex`; writing this key also turns Codex on.
39
+ "codex": {
40
+ "args": ["--full-auto"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ To turn it off again, remove the key you wrote. To make sure it never loads, list it under
47
+ `plugins.disabled`.
48
+
49
+ ## What Sous writes for Codex
50
+
51
+ Once it is on, every `sous build` writes:
52
+
53
+ | File | What it holds |
54
+ |---|---|
55
+ | `AGENTS.override.md` at the project root | Your project's own `AGENTS.md`, then Sous's memories |
56
+ | `.agents/skills/<skill>/` | The skills of the recipes you subscribe to |
57
+
58
+ ### Why `AGENTS.override.md`
59
+
60
+ Codex reads one instruction file per folder. When a folder holds an `AGENTS.override.md`, Codex reads it
61
+ instead of that folder's `AGENTS.md`. Sous never touches your `AGENTS.md`; it writes the override file
62
+ with the text of your `AGENTS.md` first and its memories after it, so Codex sees both.
63
+
64
+ - If you have no `AGENTS.md`, the override holds only the memories.
65
+ - If you edit `AGENTS.md`, run `sous build` again, or Codex keeps reading the old copy.
66
+ - If your project already has an `AGENTS.override.md` that Sous did not write, Sous copies it to
67
+ `.sous/backups/`, warns you, and writes its own.
68
+ - The file is build output, so Sous keeps it out of git: `sous init` adds `/AGENTS.override.md` to
69
+ the project's `.gitignore`, and the plugin also declares that line as an
70
+ [edit](editing-files.md), for projects set up before and for a file you have moved.
71
+
72
+ Codex cuts its project instruction files off at 32 KiB in total by default (its
73
+ `project_doc_max_bytes` setting). Your `AGENTS.md` plus Sous's memories can pass that, and the end of the
74
+ file is then lost.
75
+
76
+ Codex skips every project instruction file, `AGENTS.md` and the override alike, in a project you have
77
+ not marked as trusted in Codex.
78
+
79
+ ### Where the memories come from
80
+
81
+ The same source as for Claude Code: `.sous/MEMORIES.tpl.md` when it exists, and otherwise your own files
82
+ under `.sous/memories/` followed by the memories of the recipes you subscribe to.
83
+
84
+ ### Skills
85
+
86
+ Codex loads skills from `.agents/skills/` on demand, not into every session. Sous writes each recipe's
87
+ skills there. The folder is not added to `.gitignore`, because other tools read it too and a project
88
+ may keep its own skills there; add `/.agents/skills/` to your `.gitignore` yourself if every skill in it
89
+ comes from Sous. This location also comes from Codex's documentation and has not been tried.
90
+
91
+ ## Options
92
+
93
+ Under `plugins.options."@sous-io/sous-plugin-codex"`:
94
+
95
+ | Option | Default | What it does |
96
+ |---|---|---|
97
+ | `memoriesOutputPath` | `${projectRoot}/AGENTS.override.md` | Where the memories file is written. A relative path is under the project root. |
98
+ | `prependMemoriesWith` | `${projectRoot}/AGENTS.md` | The file whose text goes before the memories. Skipped silently when it does not exist. |
99
+ | `skillsDirectory` | `.agents/skills` | Where skills are written. |
100
+ | `memories` | `true` | `false` writes no memories file for Codex. |
101
+
102
+ ```jsonc
103
+ {
104
+ "plugins": {
105
+ "options": {
106
+ "@sous-io/sous-plugin-codex": {
107
+ "prependMemoriesWith": "${projectRoot}/docs/AGENTS.md"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ## Starting Codex
115
+
116
+ `sous launch codex` builds the project, then starts the `codex` command in the project root. Settings
117
+ under `tools.codex` change the command and add arguments before yours:
118
+
119
+ ```bash
120
+ sous launch codex
121
+ sous launch codex -- resume
122
+ ```
123
+
124
+ Sous does not run Codex headless (`codex exec`).
125
+
126
+ ## Conditions on Codex
127
+
128
+ Sous builds the config once more for Codex while it is on, so a config value can depend on it with
129
+ `harness.id == 'codex'`. See [Conditions on the harness](configuration.md#conditions-on-the-harness).