@phnx-labs/agents-cli 1.19.2 → 1.20.3

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 (156) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/README.md +72 -12
  3. package/dist/browser.js +0 -0
  4. package/dist/commands/browser.js +88 -16
  5. package/dist/commands/cli.d.ts +14 -0
  6. package/dist/commands/cli.js +244 -0
  7. package/dist/commands/cloud.js +1 -1
  8. package/dist/commands/commands.js +27 -10
  9. package/dist/commands/computer.js +18 -1
  10. package/dist/commands/doctor.d.ts +1 -1
  11. package/dist/commands/doctor.js +2 -2
  12. package/dist/commands/exec.js +38 -18
  13. package/dist/commands/factory.d.ts +3 -14
  14. package/dist/commands/factory.js +3 -3
  15. package/dist/commands/feedback.d.ts +7 -0
  16. package/dist/commands/feedback.js +89 -0
  17. package/dist/commands/helper.d.ts +12 -0
  18. package/dist/commands/helper.js +87 -0
  19. package/dist/commands/hooks.js +89 -10
  20. package/dist/commands/mcp.js +166 -10
  21. package/dist/commands/packages.js +196 -27
  22. package/dist/commands/permissions.js +21 -6
  23. package/dist/commands/plugins.js +11 -4
  24. package/dist/commands/profiles.d.ts +8 -0
  25. package/dist/commands/profiles.js +118 -5
  26. package/dist/commands/prune.js +39 -160
  27. package/dist/commands/pull.js +58 -5
  28. package/dist/commands/routines.js +107 -14
  29. package/dist/commands/rules.js +8 -4
  30. package/dist/commands/secrets-migrate.d.ts +24 -0
  31. package/dist/commands/secrets-migrate.js +198 -0
  32. package/dist/commands/secrets-sync.d.ts +11 -0
  33. package/dist/commands/secrets-sync.js +155 -0
  34. package/dist/commands/secrets.js +79 -46
  35. package/dist/commands/sessions.d.ts +28 -0
  36. package/dist/commands/sessions.js +98 -33
  37. package/dist/commands/setup.d.ts +1 -0
  38. package/dist/commands/setup.js +37 -28
  39. package/dist/commands/skills.js +25 -8
  40. package/dist/commands/subagents.js +69 -49
  41. package/dist/commands/teams.js +61 -10
  42. package/dist/commands/utils.d.ts +33 -0
  43. package/dist/commands/utils.js +139 -0
  44. package/dist/commands/versions.d.ts +4 -3
  45. package/dist/commands/versions.js +134 -130
  46. package/dist/commands/view.d.ts +6 -0
  47. package/dist/commands/view.js +175 -19
  48. package/dist/commands/workflows.js +29 -6
  49. package/dist/computer.js +0 -0
  50. package/dist/index.js +38 -6
  51. package/dist/lib/acp/client.js +6 -1
  52. package/dist/lib/acp/harnesses.js +8 -0
  53. package/dist/lib/agents.d.ts +4 -0
  54. package/dist/lib/agents.js +125 -34
  55. package/dist/lib/auto-pull-worker.js +18 -1
  56. package/dist/lib/browser/cdp.d.ts +8 -1
  57. package/dist/lib/browser/cdp.js +40 -3
  58. package/dist/lib/browser/chrome.d.ts +13 -0
  59. package/dist/lib/browser/chrome.js +46 -3
  60. package/dist/lib/browser/domain-skills.d.ts +51 -0
  61. package/dist/lib/browser/domain-skills.js +157 -0
  62. package/dist/lib/browser/drivers/local.js +45 -4
  63. package/dist/lib/browser/drivers/ssh.js +2 -2
  64. package/dist/lib/browser/ipc.d.ts +8 -1
  65. package/dist/lib/browser/ipc.js +37 -28
  66. package/dist/lib/browser/profiles.d.ts +16 -3
  67. package/dist/lib/browser/profiles.js +44 -4
  68. package/dist/lib/browser/service.d.ts +3 -0
  69. package/dist/lib/browser/service.js +40 -5
  70. package/dist/lib/browser/types.d.ts +11 -4
  71. package/dist/lib/cli-resources.d.ts +137 -0
  72. package/dist/lib/cli-resources.js +477 -0
  73. package/dist/lib/cloud/factory.d.ts +1 -1
  74. package/dist/lib/cloud/factory.js +1 -1
  75. package/dist/lib/cloud/rush.js +5 -5
  76. package/dist/lib/command-skills.js +0 -2
  77. package/dist/lib/computer-rpc.d.ts +3 -0
  78. package/dist/lib/computer-rpc.js +53 -0
  79. package/dist/lib/daemon.js +20 -0
  80. package/dist/lib/events.d.ts +16 -2
  81. package/dist/lib/events.js +33 -2
  82. package/dist/lib/exec.d.ts +42 -13
  83. package/dist/lib/exec.js +127 -33
  84. package/dist/lib/help.js +11 -5
  85. package/dist/lib/hooks/cache.d.ts +38 -0
  86. package/dist/lib/hooks/cache.js +242 -0
  87. package/dist/lib/hooks/profile.d.ts +33 -0
  88. package/dist/lib/hooks/profile.js +129 -0
  89. package/dist/lib/hooks.d.ts +0 -10
  90. package/dist/lib/hooks.js +246 -11
  91. package/dist/lib/mcp.d.ts +15 -0
  92. package/dist/lib/mcp.js +46 -0
  93. package/dist/lib/migrate.js +1 -1
  94. package/dist/lib/overdue.d.ts +26 -0
  95. package/dist/lib/overdue.js +101 -0
  96. package/dist/lib/permissions.d.ts +13 -0
  97. package/dist/lib/permissions.js +55 -1
  98. package/dist/lib/plugin-marketplace.js +1 -1
  99. package/dist/lib/plugins.js +15 -1
  100. package/dist/lib/profiles-presets.d.ts +26 -0
  101. package/dist/lib/profiles-presets.js +216 -0
  102. package/dist/lib/profiles.d.ts +34 -0
  103. package/dist/lib/profiles.js +112 -1
  104. package/dist/lib/resources/mcp.js +37 -0
  105. package/dist/lib/resources.d.ts +1 -1
  106. package/dist/lib/rotate.js +10 -4
  107. package/dist/lib/routines-format.d.ts +47 -0
  108. package/dist/lib/routines-format.js +194 -0
  109. package/dist/lib/routines.d.ts +8 -2
  110. package/dist/lib/routines.js +34 -14
  111. package/dist/lib/runner.js +83 -15
  112. package/dist/lib/scheduler.js +8 -1
  113. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  114. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  115. package/dist/lib/secrets/Agents CLI.app/Contents/_CodeSignature/CodeResources +1 -9
  116. package/dist/lib/secrets/bundles.d.ts +34 -17
  117. package/dist/lib/secrets/bundles.js +210 -36
  118. package/dist/lib/secrets/index.d.ts +49 -30
  119. package/dist/lib/secrets/index.js +126 -115
  120. package/dist/lib/secrets/install-helper.d.ts +45 -0
  121. package/dist/lib/secrets/install-helper.js +165 -0
  122. package/dist/lib/secrets/linux.js +4 -4
  123. package/dist/lib/secrets/sync.d.ts +56 -0
  124. package/dist/lib/secrets/sync.js +180 -0
  125. package/dist/lib/session/active.d.ts +8 -0
  126. package/dist/lib/session/active.js +3 -2
  127. package/dist/lib/session/db.d.ts +0 -4
  128. package/dist/lib/session/db.js +0 -26
  129. package/dist/lib/session/parse.d.ts +1 -0
  130. package/dist/lib/session/parse.js +44 -0
  131. package/dist/lib/session/render.js +4 -4
  132. package/dist/lib/session/types.d.ts +2 -2
  133. package/dist/lib/session/types.js +1 -1
  134. package/dist/lib/shims.d.ts +5 -2
  135. package/dist/lib/shims.js +70 -38
  136. package/dist/lib/state.d.ts +14 -2
  137. package/dist/lib/state.js +51 -20
  138. package/dist/lib/teams/agents.d.ts +5 -4
  139. package/dist/lib/teams/agents.js +48 -22
  140. package/dist/lib/teams/api.d.ts +2 -1
  141. package/dist/lib/teams/api.js +4 -3
  142. package/dist/lib/teams/parsers.d.ts +1 -1
  143. package/dist/lib/teams/parsers.js +153 -3
  144. package/dist/lib/teams/summarizer.js +18 -2
  145. package/dist/lib/teams/worktree.js +14 -3
  146. package/dist/lib/types.d.ts +63 -4
  147. package/dist/lib/types.js +8 -3
  148. package/dist/lib/usage.d.ts +27 -2
  149. package/dist/lib/usage.js +100 -17
  150. package/dist/lib/versions.d.ts +45 -3
  151. package/dist/lib/versions.js +455 -60
  152. package/package.json +15 -14
  153. package/scripts/install-helper.js +97 -0
  154. package/scripts/postinstall.js +16 -0
  155. package/dist/lib/secrets/Agents CLI.app/Contents/embedded.provisionprofile +0 -0
  156. package/npm-shrinkwrap.json +0 -3162
package/CHANGELOG.md CHANGED
@@ -1,5 +1,145 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.20.3
4
+
5
+ **`agents run` startup latency (stale-while-revalidate the usage probe + memoize agents.yaml)**
6
+
7
+ - The default `agents run` strategy is `available`, which calls `getUsageInfoForIdentity` to skip rate-limited accounts. With a 2-minute cache, every cold invocation past that window made a blocking `fetch` to `api.anthropic.com/api/oauth/usage` (5 s timeout, plus an optional 15 s OAuth token refresh) before `spawn(claude)` — so `agents run claude` regularly stalled 5–8 s with nothing on screen after the rotation banner.
8
+ - The cache is now stale-while-revalidate: fresh (<2 min) returns instantly with no network, stale-but-recent (<24 h) returns the cached snapshot instantly and refreshes in the background, and only a fully cold / >24 h cache blocks on the live fetch. The background refresh defers its first await past `setImmediate` so the synchronous Keychain CLI call (`security find-generic-password`, invoked by `loadClaudeOauth`) cannot block the foreground caller — that's how an SWR returns "instantly" even while the refresh is technically still on its first sync step.
9
+ - `readMeta()` had a `metaCache` module global plus `writeMetaUnlocked` cache-invalidation logic wired in years ago — but no read path ever consulted the cache. So every call did 2x `fs.readFileSync` + 2x `yaml.parse` on system + user `agents.yaml`, and hot callers (`getConfiguredRunStrategy`, `getGlobalDefault`, `getVersionResources`, `ensureVersionResourcePatterns`) fire it multiple times per `agents run`. The read path now consults the cache, keyed on the combined mtime of both source files — out-of-band edits still invalidate on the next stat, and in-process writers already clear it.
10
+
11
+ ## 1.20.2
12
+
13
+ **Grok and Antigravity Support & Documentation**
14
+
15
+ - **Grok CLI Integration**: Added support for installing Grok via `agents add grok@<version>`, which invokes the official xAI installer with the specified version. Grok MCP server configuration paths (via `config.toml`) and memory file mapping are now correctly documented.
16
+ - **Antigravity (AGY) CLI Integration**: Added support for the Google Antigravity CLI. Since the AGY installer doesn't support version-pinned installs currently, `agents add agy` uses the `latest` version. Documented the canonical config path `~/.gemini/antigravity-cli/` and its `mcp_config.json`.
17
+ - **Documentation**: Updated `02-resource-sync.md` to reflect accurate MCP mappings and memory file symlinks for both Grok and Antigravity.
18
+ - **Profiles**: Hardened presets with verified 2026 model IDs and added generic proxy configuration. Show custom profiles in agents view.
19
+
20
+ ## 1.20.1
21
+
22
+ **Agents selector (auto-install missing versions + unified `@all` everywhere)**
23
+
24
+ - `--agents claude@2.1.999` used to hard-error when 2.1.999 wasn't installed. Now the CLI prompts to install it inline and continues (auto-install with `--yes`). No more breaking flow to run `agents add` first.
25
+ - `--agents claude@all` and the bare `all` literal now work across every callsite that takes `--agents` — previously `agents install gh:...`, `mcp register`, `mcp remove`, and inline `mcp add` had diverged from the canonical syntax and threw "Version all is not installed" despite the help text advertising it. Selector is unified end-to-end.
26
+
27
+ **Prompt (fail loud on non-TTY + `@all` syntax in picker)**
28
+
29
+ - Scripts that called `agents <resource> add` with no `--agents` and no `--yes` used to silently auto-pick a default version. That hid scripted misuse behind unpredictable picks. The non-TTY path now throws with a clear pointer at the new syntax: `--agents claude@all` (every installed version of Claude), `--agents all` (every capable agent at all versions), or `--agents claude@2.1.141` (one specific version).
30
+ - `--agents` parsing in `<resource> add` understands `@all` and the bare `all` literal; `promptAgentVersionSelection`'s picker surfaces version counts when there's more than one installed, mirroring what `@all` would target.
31
+
32
+ **Resources / install (`gh:` form sniffs every type, `mcp add gh:`, `--names` + `@all` unified across resource add)**
33
+
34
+ - `agents install gh:<owner>/<repo>` now sniffs every resource type in the source repo (commands, skills, hooks, MCP, permissions, profiles, subagents, workflows) instead of requiring one `--types` per kind. Pass `--types skills,workflows` to narrow.
35
+ - New `agents mcp add gh:<owner>/<repo>` form — install MCP servers directly from a git source, parallel to the other `<resource> add gh:` paths.
36
+ - `<resource> add` accepts `--names` and `@all` uniformly across commands, skills, hooks, MCP, permissions, profiles, rules, subagents, workflows — same flags, same semantics, regardless of resource kind.
37
+
38
+ **Profiles (interactive `create` wizard, gateway + self-hosted presets)**
39
+
40
+ - New `agents profiles create` command — interactive wizard to assemble a profile from gateway or self-hosted presets (OpenRouter, OpenAI-compatible) without hand-writing YAML.
41
+ - `--smoke-test` exercises the resolved env block against the configured endpoint before writing the profile.
42
+
43
+ **Feedback (in-CLI bug / idea / question routing)**
44
+
45
+ - New `agents feedback` command — collects a short description + optional category (bug, idea, question) and routes to the project's tracker without leaving the terminal.
46
+
47
+ **Routines (real exit codes for detached scheduled runs)**
48
+
49
+ - `monitorRunningJobs` used to hardcode `status: 'failed'` whenever it detected that a detached child had exited — `executeJobDetached` fires-and-forgets, so the real exit code was unreachable. Every scheduler-driven routine ended up labeled `failed/exitCode: null`, even when the agent completed cleanly.
50
+ - Fix: when finalizing a vanished child, scan the tail of its stream-json `stdout.log` for Claude's `type: result` terminator (which carries `is_error`). If found, set `status` and `exitCode` from it. Only fall back to `failed` when no result marker exists (process was killed mid-run).
51
+ - Routines list cell rendering hardened around 7-day retention boundaries.
52
+ - Codex/Gemini run finalization continues to fall back to `failed` until their stream tail parsers are added.
53
+
54
+ **Security**
55
+
56
+ - `security(cli)`: eliminated `shell: true` from manifest-driven installs — closes a command-injection vector in `install`/`add` paths that took git URLs or shell-interpolated metadata.
57
+ - `security(logs)`: prompts and tokens are redacted before `events.jsonl` is written, and event retention is shortened from 30d to 7d. Reduces blast radius on accidental disclosure.
58
+ - `security(exec)`: strip loader env vars (`DYLD_*`, `LD_*`, `NODE_OPTIONS`) from environments propagated to child agents — avoids passing host-process loader state into spawned binaries.
59
+ - `security(browser)`: CDP origin allowlist replaces the previous wildcard — only `localhost` and explicitly configured browser hosts can speak CDP into a session.
60
+ - `security(ci)`: keychain helper SHA is verified at publish time, so a tampered helper binary cannot ride a release.
61
+
62
+ **Copilot (fix user-scoped MCP path)**
63
+
64
+ - Copilot's user-scoped MCP path now correctly resolves to `mcp-config.json` (the path the IDE actually reads) instead of the legacy filename. Fixes user-level MCP registrations not appearing in Copilot sessions.
65
+
66
+ **Docs**
67
+
68
+ - Full docs site IA shipped: browser, cloud, computer, hooks, plugins, profiles, pty, secrets, subagents, teams, workflows.
69
+ - Brand identity block: `agents-cli` is Phoenix Labs OSS, not part of the Rush brand — guards downstream agents against pulling Rush styling into this project.
70
+
71
+ **Build / install**
72
+
73
+ - Staged dev install tarball strips `prepack` and `prepare` hooks so side-by-side dev installs don't accidentally re-run the full publish pipeline locally.
74
+ - `test(jobs)`: un-break 3 stale assertions on main.
75
+
76
+ ## 1.20.0
77
+
78
+ **Routines (overdue detection + catchup)**
79
+
80
+ - Detect routines whose most recent scheduled fire was missed (laptop off, daemon crashed, reboot). The daemon logs them on startup and pops a native desktop notification (`osascript` on macOS, `notify-send` on Linux).
81
+ - `agents routines list` annotates overdue rows with `(overdue)` and prints a footer pointing at the catchup command.
82
+ - New `agents routines catchup` command: lists overdue routines and fires them in the background under the scheduler. `--dry-run` lists without triggering.
83
+ - `JobScheduler.schedule` now sets croner's `catch: true` and forwards `timezone` defensively, so a synchronous throw in one job's callback can't kill the whole cron loop.
84
+
85
+ **Landing page (agents-cli.sh)**
86
+
87
+ - Expanded the homepage with seven new sections: rotate accounts (`--rotate`), parallel teams (`agents teams`), browser automation, cross-agent session search, routines/cron, keychain secrets, and machine-to-machine sync (`agents drive`).
88
+ - Rewrote meta description + lede to spell out the actual feature set (pin versions, swap models, rotate accounts, drive a browser, spawn parallel teams, schedule on cron) instead of just "same interface, on your machine."
89
+
90
+ **Codex (commands-as-skills sync fix)**
91
+
92
+ - Fix recurring "N commands new" prompt on `agents view codex` for Codex >= 0.117.0. `getActuallySyncedResources` now detects converted command-skills via the `agents_command` marker in `~/.codex/skills/<name>/SKILL.md` instead of only scanning the empty legacy `prompts/` directory.
93
+ - Summary and selection prompts are version-aware: the static `COMMANDS_CAPABLE_AGENTS` gate is replaced by `supports(agent, 'commands', version)` so the "X commands" line only appears for versions that can actually take them.
94
+ - Generalize `shouldInstallCommandAsSkill` beyond Codex — any agent where commands are gated off and skills are on (e.g. Grok) now gets the same automatic slash-command → skill conversion at install/sync time.
95
+
96
+ **Grok Build (first-class support)**
97
+
98
+ - Add `grok` as a first-class supported agent (AgentId + full registry entry using official `~/.grok/README.md` paths).
99
+ - Implement proper binary resolution from `~/.grok/downloads/`.
100
+ - Add `GROK_HOME` isolation to generated shims for true versioned config (skills, hooks, plugins, agents/, MCP, memory, etc.).
101
+ - Extend `installVersion` to support Grok via its official installer script (`curl ... -s <version>`).
102
+ - Update shims, exec templates, MCP path helpers, session helpers, unmanaged detection, and docs.
103
+ - `agents add grok@<ver>`, `agents use grok@<ver>`, resource sync, and shims now work end-to-end for Grok Build.
104
+
105
+ **Browser**
106
+
107
+ - `agents browser start --record` convenience flag for one-shot recording sessions.
108
+ - Auto-discover per-site `SKILL.md` on `browser start` so skills appear under the active task without manual wiring.
109
+ - Auto-pick a Chromium-family browser when `--profile` is omitted; the limitation is surfaced in `--help` and the auto-pick error.
110
+ - No more stacktraces when the daemon is down or CDP is unreachable — error paths print a single human-readable line.
111
+ - Drop the Playwright `bundled-chromium` devdependency.
112
+
113
+ **Secrets / Keychain**
114
+
115
+ - `agents secrets list` and `agents run --secrets <bundle>` collapse to one Touch ID prompt per bundle instead of one per key. Previously every secret in a bundle would re-prompt for keychain unlock.
116
+
117
+ **Sessions**
118
+
119
+ - Extract `groupActiveSessions` into a tested helper for `--active` window grouping.
120
+ - Propagate `windowid` from live-terminals into the active session record.
121
+
122
+ **Copilot**
123
+
124
+ - Emit `COPILOT_HOME` in the shim and exec env builder for versioned isolation.
125
+ - Wire the Copilot session dir and `.jsonl` extension into the sessions reader.
126
+
127
+ **OpenClaw**
128
+
129
+ - Carry OpenClaw user data forward on version switch.
130
+
131
+ **Teams**
132
+
133
+ - Warn loudly when `--after` teammates reference a name whose watch process never launched, instead of silently sitting in pending state.
134
+
135
+ **Plugins**
136
+
137
+ - Use `'directory'` source discriminator (not `'local'`) for marketplace registration so plugins reload correctly.
138
+
139
+ **Dependencies**
140
+
141
+ - Bump `@inquirer/prompts` 7.10.1 → 8.5.1, `diff` 8.0.4 → 9.0.0, `tsx` 4.22.2 → 4.22.3, `actions/setup-node` 4.4.0 → 6.4.0.
142
+
3
143
  ## 1.18.6
4
144
 
5
145
  **Claude**
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  <a href="https://github.com/phnx-labs/agents-cli"><img src="https://img.shields.io/badge/github-phnx--labs%2Fagents--cli-blue?style=flat-square" alt="github" /></a>
12
12
  </p>
13
13
 
14
- **The missing toolchain for CLI coding agents.** Pin versions to escape regressions. Build hooks to control agent behavior, or skills to improve them. Then share your agent environment with your team, or clone it to any machine with one command.
14
+ **The missing toolchain for CLI coding agents.** Run any agent on your existing subscription. Spawn parallel teams in isolated terminals. Schedule routines, drive browsers and Electron apps, and store secrets behind Touch ID all from one CLI.
15
15
 
16
16
  <p align="center">
17
17
  <a href="https://github.com/anthropics/claude-code" title="Claude Code"><img src="assets/harnesses/anthropic.svg" height="32" alt="Claude Code" /></a>
@@ -27,6 +27,8 @@
27
27
  <a href="https://github.com/openclaw/openclaw" title="OpenClaw"><img src="assets/harnesses/openclaw.svg" height="36" alt="OpenClaw" /></a>
28
28
  &nbsp;&nbsp;&nbsp;&nbsp;
29
29
  <a href="https://github.com/NousResearch/hermes-agent" title="Hermes Agent"><img src="assets/harnesses/hermes.png" height="32" alt="Hermes Agent" /></a>
30
+ &nbsp;&nbsp;&nbsp;&nbsp;
31
+ <a href="https://x.ai" title="Grok Build (xAI)"><strong>Grok</strong></a>
30
32
  </p>
31
33
 
32
34
  https://agents-cli.sh/demo.mp4
@@ -79,7 +81,7 @@ agents:
79
81
  codex: "0.116.0"
80
82
  ```
81
83
 
82
- Think `requirements.txt` for CLI coding agents, on steroids. A shim reads `agents.yaml` from the project root and routes `claude` / `codex` / `gemini` to the right version automatically. Each version gets its own isolated home -- switching backs up config and re-syncs resources.
84
+ Think `requirements.txt` for CLI coding agents, on steroids. A shim reads `agents.yaml` from the project root and routes `claude` / `codex` / `gemini` / `grok` (and others) to the right version automatically. Each version gets its own isolated home -- switching backs up config and re-syncs resources.
83
85
 
84
86
  ```bash
85
87
  agents add claude@2.0.65 # Install a specific version
@@ -154,9 +156,9 @@ Supports plan (read-only) and edit modes, effort levels, JSON output for scripti
154
156
  agents run claude "review this diff" --acp --json
155
157
  ```
156
158
 
157
- `--acp` routes through the [Agent Client Protocol](https://agentclientprotocol.com/) so you get a unified event stream -- `agent_message_chunk`, `tool_call`, `plan_update`, `stop_reason` -- instead of writing a parser per CLI. File writes and shell commands flow through agents-cli, which means `--mode plan` becomes a real sandbox: the write RPC is denied, not just unused.
159
+ `--acp` routes through the [Agent Client Protocol](https://github.com/zed-industries/agent-client-protocol) so you get a unified event stream -- `agent_message_chunk`, `tool_call`, `plan_update`, `stop_reason` -- instead of writing a parser per CLI. File writes and shell commands flow through agents-cli, which means `--mode plan` becomes a real sandbox: the write RPC is denied, not just unused.
158
160
 
159
- ACP adapters are documented for claude, codex, gemini, cursor, opencode, and openclaw. Other harnesses keep running on the direct-exec path.
161
+ ACP adapters are documented for claude, codex, gemini, cursor, opencode, openclaw, and grok. Other harnesses keep running on the direct-exec path.
160
162
 
161
163
  ---
162
164
 
@@ -281,7 +283,7 @@ A workflow is a directory:
281
283
  ---
282
284
  name: Code Review
283
285
  description: Evidence-grounded PR review with file:line citations.
284
- model: claude-opus-4-7
286
+ model: opus
285
287
  tools:
286
288
  - Read
287
289
  - Grep
@@ -296,15 +298,70 @@ Resolution is project > user > system: a `<repo>/.agents/workflows/<name>/` over
296
298
 
297
299
  ---
298
300
 
301
+ ## Plugins
302
+
303
+ Bundle skills, commands, hooks, MCP servers, settings, and permissions under a single manifest. One source dir at `~/.agents/plugins/<name>/`, mirrored into every installed Claude / OpenClaw version automatically.
304
+
305
+ ```bash
306
+ # Install from a git URL or local path
307
+ agents plugins install hivemind@https://github.com/activeloopai/hivemind.git
308
+ agents plugins install ./my-plugin
309
+
310
+ # Apply to one agent (default version) or all supported
311
+ agents plugins sync rush-toolkit claude
312
+ agents plugins sync rush-toolkit
313
+ ```
314
+
315
+ A plugin is a directory with a manifest:
316
+
317
+ ```
318
+ ~/.agents/plugins/my-plugin/
319
+ .claude-plugin/plugin.json # required: { name, version, description }
320
+ skills/<name>/SKILL.md # optional
321
+ commands/*.md # optional
322
+ hooks/hooks.json # optional — executable surface
323
+ .mcp.json # optional — executable surface
324
+ bin/, scripts/, settings.json # optional — executable surface
325
+ permissions/ # optional — executable surface
326
+ ```
327
+
328
+ On sync, agents-cli copies the plugin into each version home's marketplace (`<home>/.claude/plugins/marketplaces/agents-cli/plugins/<name>/`), registers the synthetic marketplace, and flips `settings.json#enabledPlugins[<name>@agents-cli] = true` so Claude / OpenClaw load it.
329
+
330
+ ### Executable-surface gate
331
+
332
+ Plugins that ship `hooks/`, `.mcp.json`, `bin/`, `scripts/`, `settings.json` (non-permissions), or `permissions/` can execute code on session events. agents-cli requires explicit consent before flipping `enabledPlugins`:
333
+
334
+ ```bash
335
+ # Hooks-bearing plugins copy in but stay disabled by default
336
+ agents plugins install hivemind@https://github.com/activeloopai/hivemind.git \
337
+ --allow-exec-surfaces
338
+
339
+ # Same gate on re-sync (e.g., after upstream updates)
340
+ agents plugins sync hivemind claude --allow-exec-surfaces
341
+ ```
342
+
343
+ Skills, commands, and subagents are declarative and never trip the gate. The gate is per-plugin, per-install: consenting to hivemind doesn't grant blanket exec-surface trust to anything else.
344
+
345
+ ### Version portability
346
+
347
+ Plugins live in the user repo (`~/.agents/plugins/`), not inside any single version home. Switching Claude via `agents use claude@<v>` re-syncs the plugin into the new version automatically — no re-install. New Claude versions added later pick it up on their first sync. Project-level `<repo>/.agents/plugins/<name>/` overrides a same-named user plugin (resolution is project > user > system, same as every other resource).
348
+
349
+ ---
350
+
299
351
  ## Browser
300
352
 
301
353
  Give agents access to a real browser — no relay extension, no cloud service, no Playwright getting blocked.
302
354
 
303
355
  ```bash
304
- # Create an isolated profile for automation
356
+ # First run: omit --profile and we auto-pick the first installed Chromium-family
357
+ # browser. macOS prefers Chrome > Brave > Edge > Chromium > Comet; Linux prefers
358
+ # Chrome > Chromium > Brave > Edge; Windows prefers Edge (always preinstalled) >
359
+ # Chrome > Brave. The auto-picked profile is saved as "default" for later runs.
360
+ export AGENTS_BROWSER_TASK=$(agents browser start --url https://app.example.com)
361
+
362
+ # Or pin a named profile to a specific browser (chrome, comet, brave, chromium,
363
+ # edge, or custom) when you want isolation from "default".
305
364
  agents browser profiles create work --browser chrome
306
-
307
- # Start a task once, then bind it to this shell — every later command picks it up.
308
365
  # `start` writes the resolved name (e.g. `swift-crab-falcon-a3f92b1c`) to stdout
309
366
  # and human-friendly commentary to stderr, so $(...) capture stays clean.
310
367
  export AGENTS_BROWSER_TASK=$(agents browser start --profile work --url https://app.example.com)
@@ -384,6 +441,9 @@ agents browser profiles create cloud \
384
441
 
385
442
  ## Secrets
386
443
 
444
+ > **Platform:** `agents secrets` requires macOS Keychain or Linux libsecret.
445
+ > On Windows (non-WSL), use environment variables or a `.env` file instead.
446
+
387
447
  ```bash
388
448
  # API keys in Keychain, not in .env files.
389
449
  agents secrets create prod-stripe
@@ -538,11 +598,11 @@ Every agent run, version install, browser launch, and secrets access is logged t
538
598
  }
539
599
  ```
540
600
 
541
- **What's logged:** Operation type, agent, version, timing, truncated prompts (first 200 chars), exit codes, errors. **What's NOT logged:** Full prompts, outputs, file contents, secret values (only bundle names).
601
+ **What's logged:** Operation type, agent, version, timing, prompt length + SHA-256 hash (raw text never stored), exit codes, errors, and secret bundle/key names with caller context. Argv entries that look like tokens or secret paths are redacted. **What's NOT logged:** Raw prompts, outputs, file contents, or secret values.
542
602
 
543
603
  **Permissions:** Logs directory is `0700` (owner-only), files are `0600`. Only you can read them.
544
604
 
545
- **Retention:** 30 days by default, then auto-pruned.
605
+ **Retention:** 7 days by default, then auto-pruned.
546
606
 
547
607
  **Opt out:** Set `AGENTS_DISABLE_EVENT_LOG=1` in your shell to disable completely.
548
608
 
@@ -603,7 +663,7 @@ Codex command sync is version-aware: Codex `0.116.x` and older receive slash com
603
663
 
604
664
  ### Why use `agents` instead of `claude` / `codex` / `gemini` directly?
605
665
 
606
- Claude Code, Codex CLI, and Gemini CLI each have their own config format, MCP setup, version management, and skill system. If you use more than one, you maintain N copies of everything. `agents` gives you one interface, one config source, and one place to pin versions -- plus features the individual CLIs don't ship: cross-agent pipelines, shared teams, unified session search, and project-pinned versions like `.nvmrc`.
666
+ Claude Code, Codex CLI, Gemini CLI, Grok Build, and others each have their own config format, MCP setup, version management, and skill system. If you use more than one, you maintain N copies of everything. `agents` gives you one interface, one config source, and one place to pin versions -- plus features the individual CLIs don't ship: cross-agent pipelines, shared teams, unified session search, and project-pinned versions like `.nvmrc`.
607
667
 
608
668
  ### Is it free?
609
669
 
@@ -633,7 +693,7 @@ Your choice. We hand off to the original CLI process — use your existing subsc
633
693
 
634
694
  **No CLI telemetry or phone-home.** API keys come from your shell environment or each agent CLI's existing auth, and remote calls only happen when you invoke a feature that requires them, such as cloud dispatch.
635
695
 
636
- For full transparency: `agents-cli` keeps a local event log at `~/.agents/.cache/logs/` so you can see exactly what agents did on your machine. Logs are owner-readable only (0600) and auto-prune after 30 days. Set `AGENTS_DISABLE_EVENT_LOG=1` to disable. See [Security & Privacy](#security--privacy) for details.
696
+ For full transparency: `agents-cli` keeps a local event log at `~/.agents/.cache/logs/` so you can see exactly what agents did on your machine. Logs are owner-readable only (0600) and auto-prune after 7 days. Set `AGENTS_DISABLE_EVENT_LOG=1` to disable. See [Security & Privacy](#security--privacy) for details.
637
697
 
638
698
  ### Which platforms?
639
699
 
package/dist/browser.js CHANGED
File without changes
@@ -1,12 +1,12 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
- import { listProfiles, getProfile, createProfile, deleteProfile, getProfileRuntimeDir, extractConfiguredPort, findFreeProfilePort, getEndpointPresets, } from '../lib/browser/profiles.js';
3
+ import { listProfiles, getProfile, createProfile, deleteProfile, ensureDefaultBrowserProfile, getProfileRuntimeDir, extractConfiguredPort, findFreeProfilePort, getEndpointPresets, } from '../lib/browser/profiles.js';
4
4
  import { findBrowserPath, getPortOccupant } from '../lib/browser/chrome.js';
5
5
  import { listProfileCacheDirs, removeProfileCache, listAllProfileSnapshots, } from '../lib/browser/runtime-state.js';
6
6
  import { DEFAULT_VIEWPORT } from '../lib/browser/devices.js';
7
7
  import { discoverBrowserWsUrl, verifyBrowserIdentity } from '../lib/browser/cdp.js';
8
8
  import { parseTargetFilter } from '../lib/browser/service.js';
9
- import { sendIPCRequest } from '../lib/browser/ipc.js';
9
+ import { BrowserDaemonNotRunningError, formatBrowserDaemonNotRunningError, sendIPCRequest, } from '../lib/browser/ipc.js';
10
10
  import { browserTaskPicker } from './browser-picker.js';
11
11
  import { isInteractiveTerminal } from './utils.js';
12
12
  import { registerCommandGroups, setHelpSections } from '../lib/help.js';
@@ -59,8 +59,11 @@ export function registerBrowserCommand(program) {
59
59
  # Create a Chrome profile pointed at a CDP endpoint
60
60
  agents browser profiles create work --browser chrome --endpoint http://localhost:9222
61
61
 
62
- # Start a session against a profile
63
- agents browser start work
62
+ # Start a session auto-picks the first installed Chromium-family browser
63
+ agents browser start
64
+
65
+ # Or pin to a specific profile
66
+ agents browser start --profile work
64
67
 
65
68
  # Drive the page
66
69
  agents browser navigate https://example.com
@@ -72,6 +75,12 @@ export function registerBrowserCommand(program) {
72
75
  notes: `
73
76
  Most agent workflows should use the 'browser' skill instead of raw subcommands.
74
77
  The skill wraps profile selection, snapshotting, and tunneling.
78
+
79
+ Browser support: Chromium-family only (Chrome, Comet, Chromium, Brave, Edge).
80
+ Safari and Firefox are not supported — they don't speak the Chrome DevTools
81
+ Protocol the way agents browser expects. On Windows, Edge is the default
82
+ because it's preinstalled. On macOS and Linux, Chrome is preferred when
83
+ installed; otherwise the first Chromium-family binary on disk wins.
75
84
  `,
76
85
  });
77
86
  registerProfilesCommands(browser);
@@ -346,7 +355,7 @@ function registerProfilesCommands(browser) {
346
355
  }
347
356
  else {
348
357
  try {
349
- const { browser } = await discoverBrowserWsUrl(port);
358
+ const { browser } = await discoverBrowserWsUrl(port, 'localhost', profile.name);
350
359
  verifyBrowserIdentity(browser, profile.browser, port);
351
360
  checks.push({
352
361
  label: 'port',
@@ -437,39 +446,56 @@ function registerProfilesCommands(browser) {
437
446
  function registerTaskCommands(browser) {
438
447
  browser
439
448
  .command('start')
440
- .description('Start a browser task with a profile')
441
- .requiredOption('-p, --profile <name>', 'Browser profile to use')
449
+ .description('Start a browser task. Pass --profile <name>, or omit to auto-pick a Chromium-family browser already installed on this machine.')
450
+ .option('-p, --profile <name>', 'Browser profile to use (auto-picks from installed Chromium-family browsers if omitted)')
442
451
  .option(TASK_OPTION_FLAG, 'Task name (auto-generated if omitted)')
443
452
  .option('-e, --endpoint <name>', 'Endpoint preset (defaults to the profile\'s default)')
444
453
  .option('-u, --url <url>', 'Open URL in first tab')
454
+ .option('--no-skills', 'Skip auto-discovery of site-specific SKILL.md from ~/.agents/skills/browser/domain-skills/')
455
+ .option('--record', 'Start recording right after the tab opens (shorthand for `agents browser record start` as a follow-up)')
456
+ .option('--fps <n>', 'Recording frames per second (with --record; 1–30, default 5)', (v) => parseInt(v, 10))
457
+ .option('--duration <sec>', 'Recording duration cap in seconds (with --record; default 60)', (v) => parseInt(v, 10))
458
+ .option('--max-mb <mb>', 'Recording size cap in MB (with --record; default 25)', (v) => parseInt(v, 10))
445
459
  .action(async (opts) => {
460
+ let profileName = opts.profile;
461
+ if (!profileName) {
462
+ try {
463
+ const detected = await ensureDefaultBrowserProfile();
464
+ profileName = detected.name;
465
+ }
466
+ catch (err) {
467
+ console.error(err instanceof Error ? err.message : String(err));
468
+ process.exit(1);
469
+ }
470
+ }
446
471
  // Pre-check the profile locally so we fail fast with a helpful error
447
472
  // instead of round-tripping a generic "Profile not found" through the daemon.
448
- const profile = await getProfile(opts.profile);
473
+ const profile = await getProfile(profileName);
449
474
  if (!profile) {
450
- console.error(`Profile "${opts.profile}" not found.`);
475
+ console.error(`Profile "${profileName}" not found.`);
451
476
  const all = await listProfiles();
452
477
  if (all.length > 0) {
453
478
  console.error(`Available profiles: ${all.map((p) => p.name).join(', ')}`);
454
479
  }
455
- console.error(`Create one with: agents browser profiles create ${opts.profile} --browser <chrome|comet|chromium|brave|edge|custom>`);
480
+ console.error(`Create one with: agents browser profiles create ${profileName} --browser <chrome|comet|chromium|brave|edge|custom>`);
456
481
  process.exit(1);
457
482
  }
458
483
  // Pre-check the endpoint name too — same fail-fast rationale.
459
484
  if (opts.endpoint) {
460
485
  const presets = getEndpointPresets(profile);
461
486
  if (!presets[opts.endpoint]) {
462
- console.error(`Endpoint "${opts.endpoint}" not found on profile "${opts.profile}". ` +
487
+ console.error(`Endpoint "${opts.endpoint}" not found on profile "${profileName}". ` +
463
488
  `Available: ${Object.keys(presets).join(', ')}`);
464
489
  process.exit(1);
465
490
  }
466
491
  }
467
492
  const response = await sendIPCRequest({
468
493
  action: 'start',
469
- profile: opts.profile,
494
+ profile: profileName,
470
495
  taskName: opts.task,
471
496
  url: opts.url,
472
497
  endpoint: opts.endpoint,
498
+ skipDomainSkill: opts.skills === false,
473
499
  });
474
500
  if (!response.ok) {
475
501
  console.error(response.error);
@@ -488,6 +514,36 @@ function registerTaskCommands(browser) {
488
514
  }
489
515
  console.error(`Tip: export AGENTS_BROWSER_TASK=${response.task}`);
490
516
  console.error('Try: agents browser screenshot | agents browser console --level error');
517
+ // Surface the matched domain-skill (if any) so an agent driving the
518
+ // task picks up site-specific selectors and gotchas before it starts
519
+ // clicking. Header is recognizable so an agent parsing the stream can
520
+ // extract the skill content; suffix repeats the skill name for greps.
521
+ if (response.skill) {
522
+ console.error('');
523
+ console.error(`--- domain-skill: ${response.skill.name} (${response.skill.hostname}) ---`);
524
+ console.error(response.skill.content);
525
+ console.error(`--- end domain-skill: ${response.skill.name} ---`);
526
+ }
527
+ // --record convenience: fire record-start right after the tab opens so
528
+ // the user gets a single-command capture flow. Failures here are
529
+ // reported but don't fail the start — the task is already running.
530
+ if (opts.record) {
531
+ const recordResponse = await sendIPCRequest({
532
+ action: 'record-start',
533
+ task: response.task,
534
+ tabId: response.tabId,
535
+ fps: opts.fps,
536
+ duration: opts.duration,
537
+ maxMb: opts.maxMb,
538
+ });
539
+ if (!recordResponse.ok) {
540
+ console.error(`Recording failed to start: ${recordResponse.error}`);
541
+ }
542
+ else {
543
+ console.error(`Recording at ${recordResponse.fps} fps (cap ${recordResponse.durationCapSec}s / ${recordResponse.maxMb} MB) -> ${recordResponse.path}`);
544
+ console.error('Stop with: agents browser record stop');
545
+ }
546
+ }
491
547
  });
492
548
  browser
493
549
  .command('done')
@@ -798,10 +854,26 @@ function registerTaskCommands(browser) {
798
854
  .option('-p, --profile <name>', 'Filter by profile')
799
855
  .option('--json', 'Output machine-readable JSON')
800
856
  .action(async (opts) => {
801
- const response = await sendIPCRequest({
802
- action: 'status',
803
- profile: opts.profile,
804
- });
857
+ let response;
858
+ try {
859
+ response = await sendIPCRequest({
860
+ action: 'status',
861
+ profile: opts.profile,
862
+ }, { autoStartDaemon: false });
863
+ }
864
+ catch (err) {
865
+ if (err instanceof BrowserDaemonNotRunningError) {
866
+ const message = formatBrowserDaemonNotRunningError();
867
+ if (opts.json) {
868
+ console.log(JSON.stringify({ ok: false, error: message }));
869
+ }
870
+ else {
871
+ console.error(message);
872
+ }
873
+ process.exit(1);
874
+ }
875
+ throw err;
876
+ }
805
877
  if (!response.ok) {
806
878
  if (opts.json) {
807
879
  console.log(JSON.stringify({ ok: false, error: response.error }));
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `agents cli` — manage declarative CLI binary installs.
3
+ *
4
+ * Each entry under <repo>/cli/<name>.yaml declares a CLI tool the user wants on
5
+ * the host PATH (e.g. higgsfield, gh, glab). On a fresh machine `agents cli
6
+ * install` runs the first install method whose package manager is available
7
+ * (npm > brew > script > binary, in declared order).
8
+ *
9
+ * This is a sibling to `agents mcp` but one layer down: MCP wires servers into
10
+ * agent configs; CLI puts binaries on the user's normal PATH. CLI manifests are
11
+ * NOT copied into per-agent version homes — they are global to the user.
12
+ */
13
+ import type { Command } from 'commander';
14
+ export declare function registerCliCommands(program: Command): void;