dotagents-cli 0.4.0__tar.gz → 0.5.1__tar.gz

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 (88) hide show
  1. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/.gitignore +4 -2
  2. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/CHANGELOG.md +122 -0
  3. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/PKG-INFO +21 -60
  4. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/README.md +19 -59
  5. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/reference.md +2 -0
  6. dotagents_cli-0.5.1/docs/api/sources.md +3 -0
  7. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/guide/authoring.md +4 -7
  8. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/guide/commands.md +76 -11
  9. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/guide/overlays.md +77 -10
  10. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/guide/private-sync.md +1 -1
  11. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/index.md +1 -1
  12. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/mkdocs.yml +1 -0
  13. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/pyproject.toml +2 -2
  14. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/AGENTS.md +107 -75
  15. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/__init__.py +1 -1
  16. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_agents.py +343 -359
  17. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_context.py +15 -21
  18. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_env.py +78 -74
  19. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_fs.py +3 -5
  20. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_hooks.py +38 -25
  21. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_merge.py +6 -30
  22. dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/AGENTS.md +21 -0
  23. dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/README.md +50 -0
  24. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_overlay/dotagents/cmds/README.md +10 -5
  25. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_overlay/dotagents/cmds/findings.py +3 -3
  26. dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/cmds/launch.py +203 -0
  27. dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/hooks/preinvocation_antigravity_context.py +125 -0
  28. dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/hooks/pretooluse_codex_env.py +82 -0
  29. {dotagents_cli-0.4.0/src/dotagents/_overlay → dotagents_cli-0.5.1/src/dotagents/_overlay/dotagents/templates}/AGENTS.md +1 -1
  30. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_overlays.py +65 -117
  31. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_scope.py +54 -109
  32. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_skills.py +4 -9
  33. dotagents_cli-0.5.1/src/dotagents/_sources.py +669 -0
  34. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_wrappers.py +1 -2
  35. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/__init__.py +91 -98
  36. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/_common.py +55 -67
  37. dotagents_cli-0.5.1/src/dotagents/cli/about.py +104 -0
  38. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/build_pyz.py +50 -19
  39. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/context.py +6 -8
  40. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/env.py +72 -161
  41. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/init.py +1 -1
  42. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/cli/overlays.py +72 -39
  43. dotagents_cli-0.5.1/tests/test_about.py +72 -0
  44. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_agents.py +43 -1
  45. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_audit_leak.py +1 -1
  46. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_cmds_discovery.py +45 -56
  47. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_env.py +44 -0
  48. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_env_cli_scope.py +6 -12
  49. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_env_safety.py +0 -1
  50. dotagents_cli-0.5.1/tests/test_init_base.py +88 -0
  51. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_last_mile.py +1 -1
  52. dotagents_cli-0.5.1/tests/test_launch_cmd.py +311 -0
  53. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_overlays_cli.py +53 -11
  54. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_overlays_command.py +43 -50
  55. dotagents_cli-0.5.1/tests/test_sources.py +427 -0
  56. dotagents_cli-0.5.1/tests/test_sources_uri.py +164 -0
  57. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_wire_hooks.py +59 -49
  58. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tools/audit.py +9 -7
  59. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tools/cloud-setup.sh +17 -20
  60. dotagents_cli-0.4.0/src/dotagents/_overlay/CLAUDE.md +0 -3
  61. dotagents_cli-0.4.0/src/dotagents/_overlay/README.md +0 -48
  62. dotagents_cli-0.4.0/src/dotagents/_overlay/dotagents/hooks/preinvocation_antigravity_context.py +0 -152
  63. dotagents_cli-0.4.0/src/dotagents/_overlay/dotagents/hooks/pretooluse_codex_env.py +0 -96
  64. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/LICENSE +0 -0
  65. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/build.py +0 -0
  66. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/agents.md +0 -0
  67. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/cli.md +0 -0
  68. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/context.md +0 -0
  69. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/env.md +0 -0
  70. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/fs.md +0 -0
  71. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/hooks.md +0 -0
  72. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/merge.md +0 -0
  73. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/overlays.md +0 -0
  74. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/scope.md +0 -0
  75. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/api/skills.md +0 -0
  76. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/changelog.md +0 -0
  77. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/docs/guide/install.md +0 -0
  78. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/install.py +0 -0
  79. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/__main__.py +0 -0
  80. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/src/dotagents/_overlay/dotagents/DECISIONS.md +0 -0
  81. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/_shell.py +0 -0
  82. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_build_pyz.py +0 -0
  83. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_context.py +0 -0
  84. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_env_format.py +0 -0
  85. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_findings_cmd.py +0 -0
  86. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_hooks.py +0 -0
  87. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_scope.py +0 -0
  88. {dotagents_cli-0.4.0 → dotagents_cli-0.5.1}/tests/test_wrappers.py +0 -0
@@ -24,6 +24,7 @@ dist/
24
24
  *.pyz
25
25
  .venv/
26
26
  .venv-test/
27
+ .pyvenv/
27
28
 
28
29
  # MkDocs build output
29
30
  site/
@@ -35,6 +36,7 @@ Thumbs.db
35
36
  .vscode/
36
37
  _staging/
37
38
 
38
- # `overlays` branch, checked out here as a worktree/clone for local editing
39
- # (D77: example overlays split off this repo's main branch).
39
+ # The `repo` branch (the example overlays, under overlays/<name>), checked out
40
+ # here as a worktree/clone for local editing (D77: split off main).
41
+ repo/
40
42
  overlays/
@@ -7,6 +7,128 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.1] - 2026-09-12
11
+
12
+ ### Added
13
+
14
+ - `dotagents about`: `dotagents-cli <version>` and then, one per line, every
15
+ package bundled with it and its version -- from a `.pyz` exactly what
16
+ `build-pyz` vendored (recorded in `dotagents/_bundle.json` at build time),
17
+ from a plain install the dependencies present. `--json` adds where it runs
18
+ from and the Python.
19
+ - Overlay sources and repos can be any path `pathlib_next` speaks. With the
20
+ `uri` extra (`dotagents-cli[uri]`; `[http]`, `[sftp]`, `[s3]` add the schemes'
21
+ clients) an `http(s)://` directory listing, an `sftp`, `s3`, `dav` or
22
+ `github` tree is a directory of overlays or one overlay, a file is a
23
+ registry, an archive (`zip:<archive-uri>!/<inner>`, `tar:`, `archive:`, the
24
+ archive local or at a URL) is a tree too, and a relative registry entry resolves against the registry's
25
+ URL; remote content is materialized into `<user store>/.cache/overlays/uri/`
26
+ once per run. `file://` is a local path. Without the extra an `http(s)://`
27
+ registry file still works through the standard library, and anything else
28
+ names the extra it needs. `build-pyz --extras uri,http` vendors the extra
29
+ into the zipapp. `GitCache` is now `SourceCache`.
30
+
31
+ ### Changed
32
+
33
+ - The base config's first line, "Startup: annotate that you read `…`", names
34
+ the actual path of the `AGENTS.md` it is in (`init` renders it per store, and
35
+ every `overlays add` / `remove` / `sync` recompose keeps it), not a literal
36
+ `~/.agents/AGENTS.md` that a relocated store or a project's own file never
37
+ was. The base overlay is `dotagents/` only: the block template is
38
+ `dotagents/templates/AGENTS.md`, `<store>/dotagents/AGENTS.md` is
39
+ the working notes for that directory (read when working in it, not by
40
+ default), `<store>/dotagents/README.md` the user-facing one, and `init` no
41
+ longer writes a `<store>/CLAUDE.md` or a store-root README (no harness read
42
+ the former; the include `init` writes into `~/.claude/CLAUDE.md` is the real
43
+ one). Existing stores keep the files they have.
44
+ - The example overlays' branch is `repo` (was `overlays`); its layout is the
45
+ same, `overlays/<name>` at the branch root. Specs that named the branch
46
+ change one word: `https://github.com/jose-pr/dotagents.git@repo#overlays/net`.
47
+ The cloud bootstrap's `DOTAGENTS_OVERLAYS_REF` default follows.
48
+
49
+ ## [0.5.0] - 2026-09-10
50
+
51
+ ### Added
52
+
53
+ - Overlays can come from git repositories and registries. `overlays add` /
54
+ `sync` / `list` / `show` resolve a name against **repos** in order, the first
55
+ that offers it winning: `--repo <spec>` (repeatable), `$AGENTS_OVERLAYS_REPO_<KEY>`
56
+ (one repo per variable, by KEY), `$AGENTS_OVERLAYS_REPO` (the default repo),
57
+ the project store's `dotagents.{json,toml,yaml,yml}`, the user store's, then
58
+ the bundled `overlays/`. A repo is always a collection of overlays: a
59
+ directory (each subdirectory an overlay) or a registry file mapping names
60
+ (or aliases) to sources; it lives at a local path, an `http(s)://` URL (a
61
+ registry, fetched) or inside a git repository named
62
+ `<repo>[@<branch|tag|commit>][#<path>]`, the path picking the directory or
63
+ registry file in the checkout. A source is one overlay: a local directory,
64
+ or a git spec whose path is the overlay's root (no path: the repository root
65
+ is the overlay); a relative path is relative to the registry file, and for a
66
+ registry inside a git checkout it names the same repository at the same
67
+ ref. Checkouts are cached under `<user store>/.cache/overlays/`
68
+ and refreshed on every use; credentials in a repo URL never reach a log line.
69
+ - `dotagents launch [<agent>] [-- <the agent's arguments>]`, a bundled command
70
+ module like `findings`: starts an agent's CLI (`claude`, `codex`, `gemini`,
71
+ `cursor-agent`, `copilot`, `pi`, or `--command <program>`) with the full `env`
72
+ assembly exported to the process and the child, and the assembled `context`
73
+ written to a file (exported as `AGENTS_CONTEXT_FILE`) and handed over as
74
+ appended system-prompt text where the harness takes one (Claude Code:
75
+ `--append-system-prompt-file`), or merged into the harness's own instruction
76
+ file as the managed `dotagents:context` block otherwise. The program is
77
+ resolved on the exported PATH, so a harness an overlay's `bin/` provides is
78
+ found; `--dry-run` prints the command line and the exported names;
79
+ `--no-context` and `--inline` shape the context step; the exit code is the
80
+ harness's. Adapters gained `launch_command` and `launch_context_args()`.
81
+ - The `pi` agent (pi.dev, `@earendil-works/pi-coding-agent`): detected by its
82
+ documented `PI_CODING_AGENT` marker, model from `PI_MODEL`, no vendor (it is
83
+ multi-provider). Its config dir (`$PI_CODING_AGENT_DIR`, else `~/.pi/agent`)
84
+ and the project's `AGENTS.md` / `CLAUDE.md` count as loaded by the harness;
85
+ `context --write-agent` and `launch` hand the context over through
86
+ `.pi/APPEND_SYSTEM.md`, the file pi appends to its system prompt, and
87
+ `launch` uses `--append-system-prompt` directly on POSIX. `init -g` puts a
88
+ managed pointer to the store's `AGENTS.md` into the config dir's `AGENTS.md`
89
+ (pi has no include syntax), never a copy of the block.
90
+ - `env` exports `AGENTS_PYTHON`: the interpreter `dotagents` itself is running
91
+ under (`sys.executable`), seeded only if unset like the scope roots. Shims
92
+ and helper scripts now have a default Python they can trust, where a bare
93
+ `python`/`python3` on PATH may be a Store alias stub, an emulated build, a
94
+ venv's, or missing.
95
+
96
+ ### Changed
97
+
98
+ - `overlays add` no longer re-installs and re-runs the setup of a requirement
99
+ the scope already has (in its own store, or the user store when adding to a
100
+ project): it is satisfied and left alone, and the log says so. Each missing
101
+ requirement is still installed and set up before the overlay that needs it;
102
+ a name asked for explicitly is (re)installed and set up as before.
103
+
104
+ ### Removed
105
+
106
+ - `overlays --source` and `$AGENTS_OVERLAYS_SRC`: a source directory is just a
107
+ repo now — `--repo <dir>` / `$AGENTS_OVERLAYS_REPO=<dir>`.
108
+ - The one-release `DOTAGENTS_*` fallbacks: `DOTAGENTS_AGENTS_DIR`,
109
+ `DOTAGENTS_OVERLAYS_SRC`, `DOTAGENTS_CMDS_PATH`, and the duplicate
110
+ `DOTAGENTS_AGENTS_DIR` / `DOTAGENTS_OVERLAY_DIR` an overlay's setup script
111
+ received. Only the `AGENTS_*` names are read or set.
112
+ - The extensionless POSIX `setup` script an overlay could ship: `setup.py` is
113
+ the one form, run under the interpreter running dotagents on every platform.
114
+ - The precursor's lowercase `session_start` hook key is no longer migrated.
115
+
116
+ ### Fixed
117
+
118
+ - `init` no longer registers the PowerShell hook variants on POSIX hosts, and
119
+ removes the ones an earlier `init` wrote there. A `shell: powershell` entry
120
+ on Linux or macOS is not harmless: Claude Code runs the text as bash and it
121
+ fails with a syntax error on every session (measured in WSL). Linux and
122
+ macOS get the bash handler only; Windows keeps both, and the PowerShell one
123
+ still selects itself only when `bash` is absent. Re-running `init -g` on an
124
+ existing POSIX install converges.
125
+ - Command discovery is resilient per module, not per directory: one broken
126
+ file in a `cmds/` dir (a syntax error, an import-time exception, or a
127
+ `sys.exit()` — which is not an `Exception` and used to escape the guard and
128
+ kill every invocation, `init -g` for a store that did not exist yet
129
+ included) is skipped with a warning that names the file, and its siblings
130
+ still load.
131
+
10
132
  ## [0.4.0] - 2026-09-09
11
133
 
12
134
  ### Security
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: dotagents-cli
3
- Version: 0.4.0
3
+ Version: 0.5.1
4
4
  Summary: The dotagents CLI: install and manage a portable ~/.agents config for AI coding agents
5
5
  Project-URL: Homepage, https://github.com/jose-pr/dotagents/
6
6
  Project-URL: Repository, https://github.com/jose-pr/dotagents
@@ -44,6 +44,7 @@ Requires-Python: >=3.9
44
44
  Requires-Dist: duho<0.6,>=0.5.0
45
45
  Requires-Dist: pathlib-next<0.10,>=0.9.0
46
46
  Provides-Extra: dev
47
+ Requires-Dist: pathlib-next[http]; extra == 'dev'
47
48
  Requires-Dist: pytest; extra == 'dev'
48
49
  Provides-Extra: docs
49
50
  Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
@@ -68,7 +69,7 @@ Description-Content-Type: text/markdown
68
69
 
69
70
  Like dotfiles, but for AI coding agents: a portable, token-budgeted `~/.agents`
70
71
  configuration that works across agent runners (Claude Code, Antigravity, Copilot,
71
- Codex, ...). dotagents is the **mechanism** — install a neutral base, then layer in
72
+ Codex, pi, ...). dotagents is the **mechanism** — install a neutral base, then layer in
72
73
  opt-in **overlays** that carry your standards (repo structure, CI/release discipline,
73
74
  whatever workflows you want) — so you record them once instead of restating them every
74
75
  session.
@@ -107,9 +108,9 @@ them. Everything else is repo infrastructure.
107
108
 
108
109
  The **example overlays** — the `flows` workflow set, per-language `kb/` + templates,
109
110
  `references`, `release`, `private-sync`, `net`, `recovery`, `tools` — live on a separate
110
- [`overlays` branch](https://github.com/jose-pr/dotagents/tree/overlays), not in `main`'s
111
+ [`repo` branch](https://github.com/jose-pr/dotagents/tree/repo), not in `main`'s
111
112
  tree: they are swappable payloads, not part of the tool. `dotagents overlays add <name>`
112
- resolves them from there (or from any `--source`). See the
113
+ resolves them from there (or from any `--repo`). See the
113
114
  [docs](https://jose-pr.github.io/dotagents/) for what each ships.
114
115
 
115
116
  Named-agent directives aren't a shipped overlay — a named agent (Claude, Antigravity,
@@ -160,11 +161,21 @@ overlay's skills into the shared skills dir. See below.
160
161
 
161
162
  ### Managing overlays
162
163
 
163
- `dotagents overlays` manages opt-in overlays **by name**, resolving each name against a
164
- source directory of overlays — point `--source <dir>` (or `$AGENTS_OVERLAYS_SRC`) at
165
- one, e.g. a checkout of the [`overlays` branch](https://github.com/jose-pr/dotagents/tree/overlays)
166
- where the example overlays live. Installed overlays are *discovered* by their presence
167
- under `<scope>/.agents/overlays/` — there is no registry file.
164
+ `dotagents overlays` manages opt-in overlays **by name**, resolving each name against
165
+ **repos** in order — the first that offers the name wins. A repo is always a
166
+ **collection** of overlays: a directory (each subdirectory an overlay, e.g. a checkout of
167
+ the [`repo` branch](https://github.com/jose-pr/dotagents/tree/repo), whose overlays sit
168
+ under `overlays/<name>`) or a
169
+ JSON/TOML/YAML registry file mapping names to **sources**. It lives at a local path, an
170
+ `http(s)://` URL (a registry file, fetched), or inside a git repository named
171
+ `<repo>[@<branch|tag|commit>][#<path>]`, where the path picks the directory or registry
172
+ file in the checkout (no path: the checkout root). A source names **one** overlay: a
173
+ local directory, or a git spec whose path is the overlay's root directory (no path: the
174
+ repository root is the overlay); a relative path is relative to the registry file, and
175
+ inside a git checkout stays in the same repository at the same ref. Name repos with `--repo`,
176
+ `$AGENTS_OVERLAYS_REPO_<KEY>` / `$AGENTS_OVERLAYS_REPO`, or a `dotagents.{json,toml,yaml}`
177
+ in the project or user store.
178
+ Installed overlays are *discovered* by their presence under `<scope>/.agents/overlays/`.
168
179
 
169
180
  ```bash
170
181
  dotagents overlays add python engineering # install into the scope, publish skills, merge D59 rules/routing
@@ -185,9 +196,7 @@ at the manual edit, or re-run `install`).
185
196
 
186
197
  **Overlay setup scripts.** An overlay may ship an **idempotent** `setup.py` at its root
187
198
  (the recommended form: it runs under the same Python that runs dotagents, so it works on
188
- every OS — the bundled `net` overlay is the model). An extensionless `setup` (a POSIX
189
- shell script) is still honored as a legacy fallback, but it is discouraged: a shell
190
- script isn't portable to Windows without a shell. After `add`/`sync` copies the overlay
199
+ every OS). After `add`/`sync` copies the overlay
191
200
  in, dotagents runs the script automatically — so anything a human would otherwise
192
201
  hand-follow (PATH/lib wiring, self-registration) is one script the tool runs, not a doc.
193
202
  When both are present, `setup.py` wins. Presence of a script is the opt-in; skip it with
@@ -217,54 +226,6 @@ Then wire your runner to it — e.g. Claude Code: put `@AGENTS.md` in
217
226
  > Read README.md, run `python install.py init && python install.py overlays add engineering -g`,
218
227
  > and confirm `~/.agents/overlays/flows/flows/PLAN.md` exists.
219
228
 
220
- ## Private sync (per-user + per-project, one private repo)
221
-
222
- Keep your global config **and** every project's private `.agents` (plans, kb, findings)
223
- in a single private git repo — synced across machines and cloud sessions — without ever
224
- committing any of it into the (often public) project repos.
225
-
226
- The idea: your global `~/.agents` **is** a private git repo. Its root is the per-user
227
- config; a `projects/<name>/` tree holds each project's private `.agents` payload. For a
228
- checked-out project, `<project>/.agents` is a **symlink** to `~/.agents/projects/<name>`
229
- (the project's `.gitignore` already excludes `.agents/` per the Leakage rule, so the
230
- link never lands in the public repo). `<name>` defaults to the project's basename, so a
231
- local `~/code/app` and a cloud `/home/user/app` resolve to the same store.
232
-
233
- The `link-project` / `sync-project` commands are **supplied by the `private-sync`
234
- overlay**, not by dotagents itself — installing the overlay is what makes them exist
235
- (it ships the commands, their logic, the `kb/` walkthrough and the cloud hooks
236
- together). So `overlays add private-sync` comes first:
237
-
238
- ```bash
239
- dotagents init # base
240
- dotagents overlays add private-sync --source <overlays-checkout> # commands + kb + hooks
241
- dotagents link-project . # symlink this project's .agents into the private repo
242
- # (an existing .agents/ is adopted in on the first link;
243
- # --copy mirrors it as a real dir for no-symlink systems)
244
- dotagents sync-project -m msg # git pull --rebase / commit / push the private repo
245
- dotagents sync-project --remote git@github.com:<you>/.agents.git -m init # one-command bootstrap
246
- ```
247
-
248
- In cloud sessions, the installed `~/.agents/hooks/private-sync-{start,stop}.sh` clone/pull
249
- the private repo and link/sync the project per session — register them in
250
- `~/.claude/settings.json` (see `~/.agents/hooks/settings.snippet.json`). For a **fresh
251
- container** (no `~/.agents` yet), point the web environment's **setup-script** field at the
252
- self-contained bootstrap in this repo — it fetches the latest each start, so there's
253
- nothing to re-paste:
254
-
255
- ```bash
256
- curl -fsSL https://raw.githubusercontent.com/<you>/dotagents/main/tools/cloud-setup.sh -o /tmp/dg-cloud-setup.sh && sh /tmp/dg-cloud-setup.sh
257
- ```
258
-
259
- Use `curl … -o file && sh file`, not `curl … | sh`: with a pipe the setup field's exit
260
- code is `sh`'s (0 on empty stdin), so a failed fetch is silently logged as success; `&&`
261
- propagates the curl failure instead.
262
-
263
- It authenticates (bypassing a hosted-runner `github.com`→proxy git rewrite), clones/pulls
264
- `~/.agents`, installs the CLI, and links the project — driven by `AGENTS_REMOTE`
265
- / `DOTAGENTS_AGENTS_TOKEN` / `DOTAGENTS_CLI_INSTALL` env vars (token never committed). Full
266
- walkthrough: `~/.agents/kb/PRIVATE_SYNC.md`.
267
-
268
229
  ## Validate
269
230
 
270
231
  ```bash
@@ -7,7 +7,7 @@
7
7
 
8
8
  Like dotfiles, but for AI coding agents: a portable, token-budgeted `~/.agents`
9
9
  configuration that works across agent runners (Claude Code, Antigravity, Copilot,
10
- Codex, ...). dotagents is the **mechanism** — install a neutral base, then layer in
10
+ Codex, pi, ...). dotagents is the **mechanism** — install a neutral base, then layer in
11
11
  opt-in **overlays** that carry your standards (repo structure, CI/release discipline,
12
12
  whatever workflows you want) — so you record them once instead of restating them every
13
13
  session.
@@ -46,9 +46,9 @@ them. Everything else is repo infrastructure.
46
46
 
47
47
  The **example overlays** — the `flows` workflow set, per-language `kb/` + templates,
48
48
  `references`, `release`, `private-sync`, `net`, `recovery`, `tools` — live on a separate
49
- [`overlays` branch](https://github.com/jose-pr/dotagents/tree/overlays), not in `main`'s
49
+ [`repo` branch](https://github.com/jose-pr/dotagents/tree/repo), not in `main`'s
50
50
  tree: they are swappable payloads, not part of the tool. `dotagents overlays add <name>`
51
- resolves them from there (or from any `--source`). See the
51
+ resolves them from there (or from any `--repo`). See the
52
52
  [docs](https://jose-pr.github.io/dotagents/) for what each ships.
53
53
 
54
54
  Named-agent directives aren't a shipped overlay — a named agent (Claude, Antigravity,
@@ -99,11 +99,21 @@ overlay's skills into the shared skills dir. See below.
99
99
 
100
100
  ### Managing overlays
101
101
 
102
- `dotagents overlays` manages opt-in overlays **by name**, resolving each name against a
103
- source directory of overlays — point `--source <dir>` (or `$AGENTS_OVERLAYS_SRC`) at
104
- one, e.g. a checkout of the [`overlays` branch](https://github.com/jose-pr/dotagents/tree/overlays)
105
- where the example overlays live. Installed overlays are *discovered* by their presence
106
- under `<scope>/.agents/overlays/` — there is no registry file.
102
+ `dotagents overlays` manages opt-in overlays **by name**, resolving each name against
103
+ **repos** in order — the first that offers the name wins. A repo is always a
104
+ **collection** of overlays: a directory (each subdirectory an overlay, e.g. a checkout of
105
+ the [`repo` branch](https://github.com/jose-pr/dotagents/tree/repo), whose overlays sit
106
+ under `overlays/<name>`) or a
107
+ JSON/TOML/YAML registry file mapping names to **sources**. It lives at a local path, an
108
+ `http(s)://` URL (a registry file, fetched), or inside a git repository named
109
+ `<repo>[@<branch|tag|commit>][#<path>]`, where the path picks the directory or registry
110
+ file in the checkout (no path: the checkout root). A source names **one** overlay: a
111
+ local directory, or a git spec whose path is the overlay's root directory (no path: the
112
+ repository root is the overlay); a relative path is relative to the registry file, and
113
+ inside a git checkout stays in the same repository at the same ref. Name repos with `--repo`,
114
+ `$AGENTS_OVERLAYS_REPO_<KEY>` / `$AGENTS_OVERLAYS_REPO`, or a `dotagents.{json,toml,yaml}`
115
+ in the project or user store.
116
+ Installed overlays are *discovered* by their presence under `<scope>/.agents/overlays/`.
107
117
 
108
118
  ```bash
109
119
  dotagents overlays add python engineering # install into the scope, publish skills, merge D59 rules/routing
@@ -124,9 +134,7 @@ at the manual edit, or re-run `install`).
124
134
 
125
135
  **Overlay setup scripts.** An overlay may ship an **idempotent** `setup.py` at its root
126
136
  (the recommended form: it runs under the same Python that runs dotagents, so it works on
127
- every OS — the bundled `net` overlay is the model). An extensionless `setup` (a POSIX
128
- shell script) is still honored as a legacy fallback, but it is discouraged: a shell
129
- script isn't portable to Windows without a shell. After `add`/`sync` copies the overlay
137
+ every OS). After `add`/`sync` copies the overlay
130
138
  in, dotagents runs the script automatically — so anything a human would otherwise
131
139
  hand-follow (PATH/lib wiring, self-registration) is one script the tool runs, not a doc.
132
140
  When both are present, `setup.py` wins. Presence of a script is the opt-in; skip it with
@@ -156,54 +164,6 @@ Then wire your runner to it — e.g. Claude Code: put `@AGENTS.md` in
156
164
  > Read README.md, run `python install.py init && python install.py overlays add engineering -g`,
157
165
  > and confirm `~/.agents/overlays/flows/flows/PLAN.md` exists.
158
166
 
159
- ## Private sync (per-user + per-project, one private repo)
160
-
161
- Keep your global config **and** every project's private `.agents` (plans, kb, findings)
162
- in a single private git repo — synced across machines and cloud sessions — without ever
163
- committing any of it into the (often public) project repos.
164
-
165
- The idea: your global `~/.agents` **is** a private git repo. Its root is the per-user
166
- config; a `projects/<name>/` tree holds each project's private `.agents` payload. For a
167
- checked-out project, `<project>/.agents` is a **symlink** to `~/.agents/projects/<name>`
168
- (the project's `.gitignore` already excludes `.agents/` per the Leakage rule, so the
169
- link never lands in the public repo). `<name>` defaults to the project's basename, so a
170
- local `~/code/app` and a cloud `/home/user/app` resolve to the same store.
171
-
172
- The `link-project` / `sync-project` commands are **supplied by the `private-sync`
173
- overlay**, not by dotagents itself — installing the overlay is what makes them exist
174
- (it ships the commands, their logic, the `kb/` walkthrough and the cloud hooks
175
- together). So `overlays add private-sync` comes first:
176
-
177
- ```bash
178
- dotagents init # base
179
- dotagents overlays add private-sync --source <overlays-checkout> # commands + kb + hooks
180
- dotagents link-project . # symlink this project's .agents into the private repo
181
- # (an existing .agents/ is adopted in on the first link;
182
- # --copy mirrors it as a real dir for no-symlink systems)
183
- dotagents sync-project -m msg # git pull --rebase / commit / push the private repo
184
- dotagents sync-project --remote git@github.com:<you>/.agents.git -m init # one-command bootstrap
185
- ```
186
-
187
- In cloud sessions, the installed `~/.agents/hooks/private-sync-{start,stop}.sh` clone/pull
188
- the private repo and link/sync the project per session — register them in
189
- `~/.claude/settings.json` (see `~/.agents/hooks/settings.snippet.json`). For a **fresh
190
- container** (no `~/.agents` yet), point the web environment's **setup-script** field at the
191
- self-contained bootstrap in this repo — it fetches the latest each start, so there's
192
- nothing to re-paste:
193
-
194
- ```bash
195
- curl -fsSL https://raw.githubusercontent.com/<you>/dotagents/main/tools/cloud-setup.sh -o /tmp/dg-cloud-setup.sh && sh /tmp/dg-cloud-setup.sh
196
- ```
197
-
198
- Use `curl … -o file && sh file`, not `curl … | sh`: with a pipe the setup field's exit
199
- code is `sh`'s (0 on empty stdin), so a failed fetch is silently logged as success; `&&`
200
- propagates the curl failure instead.
201
-
202
- It authenticates (bypassing a hosted-runner `github.com`→proxy git rewrite), clones/pulls
203
- `~/.agents`, installs the CLI, and links the project — driven by `AGENTS_REMOTE`
204
- / `DOTAGENTS_AGENTS_TOKEN` / `DOTAGENTS_CLI_INSTALL` env vars (token never committed). Full
205
- walkthrough: `~/.agents/kb/PRIVATE_SYNC.md`.
206
-
207
167
  ## Validate
208
168
 
209
169
  ```bash
@@ -11,6 +11,8 @@ form its API. Generated from docstrings, organized by module:
11
11
  `AGENTS.md` contributions; setup-script discovery and the manifest reader.
12
12
  - **[Scope](scope.md)** — scope and overlay-source resolution for the `overlays`
13
13
  command.
14
+ - **[Sources](sources.md)** — overlay repos: directories of overlays, registry
15
+ files, git specs, and the precedence the `overlays` commands resolve names through.
14
16
  - **[Context](context.md)** — assembling the effective context for agents.
15
17
  - **[Environment](env.md)** — chained env-file assembly and `env.py` execution.
16
18
  - **[Merge](merge.md)** — the managed-block merge for `init`'s `AGENTS.md` /
@@ -0,0 +1,3 @@
1
+ # Sources
2
+
3
+ ::: dotagents._sources
@@ -1,8 +1,8 @@
1
1
  # Authoring an overlay
2
2
 
3
3
  An overlay is just a directory with the files you want laid into a scope, plus an
4
- optional `overlay.toml` manifest. Anyone can write one; point `dotagents overlays` at
5
- its parent directory with `--source`.
4
+ optional `overlay.toml` manifest. Anyone can write one; name its parent directory (a
5
+ directory of overlays), a registry, or a git repo with `--repo` — see the overlays guide.
6
6
 
7
7
  ## Minimal overlay
8
8
 
@@ -24,7 +24,7 @@ routing = [
24
24
  Install it:
25
25
 
26
26
  ```bash
27
- python -m dotagents overlays add my-overlay --source /path/to/parent -g
27
+ python -m dotagents overlays add my-overlay --repo /path/to/parent -g
28
28
  ```
29
29
 
30
30
  The overlay's files land at the same relative path in the scope, and each `routing`
@@ -54,10 +54,7 @@ matters.
54
54
 
55
55
  Ship an idempotent `setup.py` at the overlay root to run install-time wiring
56
56
  automatically — the recommended, OS-agnostic form (it runs under the same Python as
57
- dotagents, so it works on every platform; the bundled `net` overlay is the model). An
58
- extensionless `setup` (a POSIX shell script) still works as a legacy fallback but is
59
- discouraged — it needs a shell, so it isn't portable to Windows. When both are present,
60
- `setup.py` wins. See the contract in
57
+ dotagents, so it works on every platform). See the contract in
61
58
  [Overlays → Setup scripts](overlays.md#setup-scripts). The essentials:
62
59
 
63
60
  - idempotent, check-then-act;
@@ -11,16 +11,18 @@ by default (the `<cwd>/.agents` store, when run inside a project) or **user** wi
11
11
 
12
12
  | Command | What it does |
13
13
  | --- | --- |
14
- | `init` | Lay down the neutral base config; block-merge `AGENTS.md`/`CLAUDE.md`; `--bin-dir` also writes a PATH wrapper. |
14
+ | `init` | Lay down the neutral base config; block-merge `AGENTS.md` (its first line names the file's own path); `--bin-dir` also writes a PATH wrapper. |
15
15
  | `overlays` | Manage opt-in overlays by name: `add` / `remove` / `list` / `sync` / `show`. |
16
16
  | `context` | Assemble the effective context for one or more agents. |
17
17
  | `env` | Assemble the chained env-file layers + identity vars, in a chosen format. |
18
18
  | `build-pyz` | Build the self-contained `dotagents.pyz` zipapp. |
19
19
  | `findings` | Per-scope findings queue: `add` / `list` / `show` / `done` / `reopen` / `remove` / `index` / `path`. |
20
+ | `launch` | Start an agent's CLI with the `env` exported and the `context` handed over; everything after `--` goes to the agent. |
21
+ | `about` | `dotagents-cli <version>`, then every package bundled in the `.pyz` (or installed beside a plain install) with its version. |
20
22
 
21
- That table is the **whole** shipped surface; `findings` is the one bundled command
22
- module (discovered from the package itself, overridable by a same-named module in a
23
- scope's `cmds/`). Everything else is **discovered**, from each **installed overlay's** `cmds/`
23
+ That table is the **whole** shipped surface; `findings` and `launch` are the two bundled
24
+ command modules (discovered from the package itself, overridable by a same-named module
25
+ in a scope's `cmds/`). Everything else is **discovered**, from each **installed overlay's** `cmds/`
24
26
  dir, each scope's command dir, `$AGENTS_CMDS_PATH` entries, and `--cmdspath` — one
25
27
  Contract-A resolver walk covers the overlay + scope tiers (D84). Two consequences
26
28
  worth knowing:
@@ -107,7 +109,7 @@ managed block into `config.toml`:
107
109
  ```toml
108
110
  # dotagents:begin
109
111
  [shell_environment_policy]
110
- set = {AGENT = "codex", AGENTS_HARNESS = "codex", AGENTS_VENDOR = "openai", AGENTS_HOME = "...", AGENTS_PROJECT_ROOT = "..."}
112
+ set = {AGENT = "codex", AGENTS_HARNESS = "codex", AGENTS_VENDOR = "openai", AGENTS_HOME = "...", AGENTS_PROJECT_ROOT = "...", AGENTS_PYTHON = "..."}
111
113
  # dotagents:end
112
114
  ```
113
115
 
@@ -142,9 +144,12 @@ dotagents overlays sync --overwrite # also replace installed files whose
142
144
  dotagents overlays show python # describe one: manifest, requires, setup, skills (--json)
143
145
  ```
144
146
 
145
- `add` installs what each manifest's `requires` names first (`--no-requires` to skip),
146
- validates every name before touching anything, and publishes skills from the installed
147
- copy. `remove` recomposes `AGENTS.md`'s managed block over the overlays that remain, so
147
+ `add` installs what each manifest's `requires` names first, each requirement installed
148
+ and set up before the overlay that needs it (`--no-requires` to skip); a requirement
149
+ the scope already has, in its own store or the user store for a project, is satisfied
150
+ and left alone, while a name you ask for explicitly is always (re)installed and set up.
151
+ It validates every name before touching anything, and publishes skills from the
152
+ installed copy. `remove` recomposes `AGENTS.md`'s managed block over the overlays that remain, so
148
153
  an overlay's rules and routing leave with it. `sync` never clobbers an installed file
149
154
  unless `--overwrite`.
150
155
 
@@ -169,7 +174,8 @@ dotagents context --write-agent --agents codex # merge a managed block into <pro
169
174
  - `--write-agent` — merge the context into each agent's own instruction file under
170
175
  the project root, as a managed `dotagents:context` block refreshed in place:
171
176
  Claude `.claude/CLAUDE.md`, Codex `AGENTS.md`, Gemini `GEMINI.md`, Cursor
172
- `.cursorrules`, Copilot `.github/copilot-instructions.md`, Antigravity
177
+ `.cursorrules`, Copilot `.github/copilot-instructions.md`, pi
178
+ `.pi/APPEND_SYSTEM.md` (the file pi appends to its system prompt), Antigravity
173
179
  `.agents/rules/dotagents.md`. Prefer the hook where the harness has one; this is
174
180
  the static alternative. Mutually exclusive with `[output]` and `--format json`.
175
181
  - `--inline` — also append the on-demand `.md` files the sources reference (bare or
@@ -209,7 +215,11 @@ python -m dotagents env --diff --format json # only vars that differ from the
209
215
 
210
216
  Roots resolve exactly as for `context` above (`$AGENTS_HOME` /
211
217
  `$AGENTS_PROJECT_ROOT`, both of which `env` also emits — so a subprocess reading
212
- them agrees with the parent that wrote them). `env` also emits one
218
+ them agrees with the parent that wrote them). `env` also emits `AGENTS_PYTHON`,
219
+ the interpreter `dotagents` itself is running under — the Python a shim or helper
220
+ script should run with, since a bare `python`/`python3` on `PATH` may be a Store
221
+ stub, an emulated build, a venv's, or missing (only if unset, so a pin holds;
222
+ the env-layer `env.py` scripts run under a valid pin too). And `env` emits one
213
223
  `<NAME>_OVERLAY_ROOT` per installed overlay, where `NAME` is the overlay's
214
224
  directory name upper-cased with `-`/`.` turned into `_` (`my-ov` →
215
225
  `MY_OV_OVERLAY_ROOT`). It is the same name `context` expands as a
@@ -267,6 +277,48 @@ dotagents findings path # where this scope's queue lives
267
277
  - The command is bundled with dotagents and discovered from the package itself;
268
278
  a same-named `findings.py` in a scope's `dotagents/cmds/` overrides it.
269
279
 
280
+ ## launch
281
+
282
+ Start an agent's command-line harness the way a session wired by `init` would
283
+ find the world already: the full `env` exported, and the `context` handed over
284
+ up front.
285
+
286
+ ```bash
287
+ dotagents launch claude -- --model sonnet # everything after `--` is the agent's
288
+ dotagents launch # the active agent, as `context` picks it
289
+ dotagents launch codex --dry-run # print the command line and the exported names
290
+ dotagents launch -g gemini # user-store tiers only (the env/context meaning of -g)
291
+ ```
292
+
293
+ What happens, in order:
294
+
295
+ 1. **Environment** — the same assembly as `dotagents env` for this scope (identity
296
+ vars, `AGENTS_HOME` / `AGENTS_PROJECT_ROOT` / `AGENTS_PYTHON`, every
297
+ `<NAME>_OVERLAY_ROOT`, the `PATH` / `PYTHONPATH` prepends, the env-file chain)
298
+ is applied to the `dotagents` process and handed to the child, so the harness
299
+ and everything it spawns see it.
300
+ 2. **Context** — `dotagents context` for that agent (what its harness does not
301
+ already load) is written to a file, exported as `AGENTS_CONTEXT_FILE`, and
302
+ passed the way the harness takes appended system-prompt text: Claude Code gets
303
+ `--append-system-prompt-file`, pi gets `--append-system-prompt` (on POSIX; on
304
+ Windows its npm `.cmd` shim cannot carry a multi-line argument, so it takes the
305
+ static route below). A harness with no append flag (Codex, Gemini,
306
+ Cursor, Copilot — their prompt-file options *replace* the built-in prompt, which
307
+ is not the same thing) gets it the static way instead: merged as the managed
308
+ `dotagents:context` block into its own instruction file in the project, exactly
309
+ what `context --write-agent` does. `--no-context` skips this; `--inline` also
310
+ inlines the on-demand files the sources reference.
311
+ 3. **The harness** — the agent's program (`claude`, `codex`, `gemini`,
312
+ `cursor-agent`, `copilot`, `pi`), resolved on the PATH from step 1 so a harness an
313
+ overlay's `bin/` provides is found, or `--command <program>` for one under
314
+ another name. dotagents' flags come first and the passthrough after, so yours
315
+ win where the harness takes the last value. The exit code is the harness's.
316
+
317
+ `--dry-run` prints the command line and the names of the exported changes (never
318
+ their values) and runs nothing. Like `findings`, the command is bundled and
319
+ discovered from the package; a same-named `launch.py` in a scope's
320
+ `dotagents/cmds/` overrides it.
321
+
270
322
  ## audit — not a dotagents command
271
323
 
272
324
  There is no `dotagents audit`. The dotagents source repo has its own
@@ -291,7 +343,7 @@ behind them, so a plain install carries no private-sync workflow at all. Install
291
343
  overlay first and they become available like any other subcommand:
292
344
 
293
345
  ```bash
294
- python -m dotagents overlays add private-sync --source <overlays-checkout>
346
+ python -m dotagents overlays add private-sync --repo <overlays-checkout>/overlays
295
347
 
296
348
  python -m dotagents link-project . # symlink this project's .agents into its store
297
349
  python -m dotagents link-project . --copy # real-dir copy (no-symlink systems)
@@ -304,6 +356,19 @@ project's `.agents` — and `sync-project` no longer reads like `overlays sync`.
304
356
 
305
357
  See [Private sync](private-sync.md) for the full walkthrough.
306
358
 
359
+ ## about
360
+
361
+ ```bash
362
+ dotagents about # dotagents-cli 0.5.0 / duho 0.5.0 / pathlib_next 0.9.0 ...
363
+ dotagents about --json # the same, plus where it runs from and the Python
364
+ ```
365
+
366
+ One `<distribution> <version>` per line, the CLI first. From a built `.pyz` the
367
+ list is exactly what `build-pyz` vendored (it records the names and versions in
368
+ `dotagents/_bundle.json` before stripping the `dist-info` dirs the zipapp would
369
+ otherwise carry, so `--extras uri,http` shows up here as `uritools`, `requests`
370
+ and friends); from a plain install it is the dependencies actually present.
371
+
307
372
  ## build-pyz
308
373
 
309
374
  ```bash