@swarmify/agents-cli 1.5.14 → 1.5.16

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 (50) hide show
  1. package/README.md +86 -291
  2. package/dist/index.js +879 -197
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/daemon.d.ts +22 -0
  5. package/dist/lib/daemon.d.ts.map +1 -0
  6. package/dist/lib/daemon.js +303 -0
  7. package/dist/lib/daemon.js.map +1 -0
  8. package/dist/lib/drive-server.d.ts +9 -0
  9. package/dist/lib/drive-server.d.ts.map +1 -0
  10. package/dist/lib/drive-server.js +217 -0
  11. package/dist/lib/drive-server.js.map +1 -0
  12. package/dist/lib/drives.d.ts +34 -0
  13. package/dist/lib/drives.d.ts.map +1 -0
  14. package/dist/lib/drives.js +267 -0
  15. package/dist/lib/drives.js.map +1 -0
  16. package/dist/lib/jobs.d.ts +53 -0
  17. package/dist/lib/jobs.d.ts.map +1 -0
  18. package/dist/lib/jobs.js +242 -0
  19. package/dist/lib/jobs.js.map +1 -0
  20. package/dist/lib/manifest.js +1 -1
  21. package/dist/lib/manifest.js.map +1 -1
  22. package/dist/lib/runner.d.ts +12 -0
  23. package/dist/lib/runner.d.ts.map +1 -0
  24. package/dist/lib/runner.js +266 -0
  25. package/dist/lib/runner.js.map +1 -0
  26. package/dist/lib/sandbox.d.ts +10 -0
  27. package/dist/lib/sandbox.d.ts.map +1 -0
  28. package/dist/lib/sandbox.js +166 -0
  29. package/dist/lib/sandbox.js.map +1 -0
  30. package/dist/lib/scheduler.d.ts +18 -0
  31. package/dist/lib/scheduler.d.ts.map +1 -0
  32. package/dist/lib/scheduler.js +64 -0
  33. package/dist/lib/scheduler.js.map +1 -0
  34. package/dist/lib/shims.d.ts +32 -0
  35. package/dist/lib/shims.d.ts.map +1 -0
  36. package/dist/lib/shims.js +181 -0
  37. package/dist/lib/shims.js.map +1 -0
  38. package/dist/lib/state.d.ts +5 -0
  39. package/dist/lib/state.d.ts.map +1 -1
  40. package/dist/lib/state.js +35 -0
  41. package/dist/lib/state.js.map +1 -1
  42. package/dist/lib/types.d.ts +10 -0
  43. package/dist/lib/types.d.ts.map +1 -1
  44. package/dist/lib/types.js.map +1 -1
  45. package/dist/lib/versions.d.ts +84 -0
  46. package/dist/lib/versions.d.ts.map +1 -0
  47. package/dist/lib/versions.js +297 -0
  48. package/dist/lib/versions.js.map +1 -0
  49. package/package.json +8 -5
  50. package/scripts/postinstall.js +72 -0
package/README.md CHANGED
@@ -1,361 +1,156 @@
1
- # @swarmify/agents-cli
1
+ # agents-cli
2
2
 
3
- **One config for all your AI coding agents.** Sync CLIs, MCP servers, commands, hooks, and skills across Claude, Codex, Gemini, and Cursor.
4
-
5
- [Homepage](https://swarmify.co/#agents-cli) | [NPM](https://www.npmjs.com/package/@swarmify/agents-cli) | [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=swarmify.swarm-ext)
3
+ **`systemctl` + `venv` for AI coding agents.** Manage, configure, schedule, and sandbox Claude, Codex, Gemini, Cursor, and OpenCode from a single CLI.
6
4
 
7
5
  ```bash
8
6
  npm install -g @swarmify/agents-cli
9
7
  ```
10
8
 
11
- ## The Problem
12
-
13
- Each agent stores config differently. Different paths, different formats:
14
-
15
- | What | Claude | Codex | Gemini |
16
- |------|--------|-------|--------|
17
- | Commands | `~/.claude/commands/` (md) | `~/.codex/prompts/` (md) | `~/.gemini/commands/` (TOML) |
18
- | MCP config | `~/.claude/settings.json` | `~/.codex/config.json` | `~/.gemini/settings.json` |
19
- | Hooks | `~/.claude/hooks/` | - | `~/.gemini/hooks/` |
20
-
21
- You spend hours configuring Claude Code - MCP servers, slash commands, hooks, skills. Then you switch to Codex and start from scratch. Get a new machine and lose everything.
22
-
23
- ## The Solution
24
-
25
- ```
26
- .agents repo (GitHub)
27
- |
28
- +----------------+----------------+
29
- | | |
30
- agents.yaml commands/ hooks/
31
- (CLIs, MCPs) (slash cmds) (scripts)
32
- | | |
33
- +----------------+----------------+
34
- |
35
- agents pull
36
- |
37
- +-------------------+-------------------+
38
- | | |
39
- ~/.claude/ ~/.codex/ ~/.gemini/
40
- - commands/ (md) - prompts/ (md) - commands/ (TOML)
41
- - hooks/ - config.json - hooks/
42
- - settings.json - settings.json
43
- ```
44
-
45
- One repo. One command. All agents configured.
9
+ - **Configure** - Sync commands, MCP servers, hooks, and skills across all agents from one repo
10
+ - **Schedule** - Run agents on cron schedules with a built-in daemon
11
+ - **Sandbox** - Each job gets an isolated HOME overlay with whitelisted tools, dirs, and env vars
12
+ - **Manage** - Install, upgrade, and monitor agent CLIs
46
13
 
47
14
  ```bash
48
- # New machine? One command.
49
- agents pull
50
-
51
- # See what's installed
52
- agents status
53
- ```
54
-
55
- ```
56
- Agent CLIs
57
-
58
- Claude Code 2.0.65
59
- Codex 1.0.3
60
- Gemini CLI 0.1.15
61
-
62
- Installed Commands
63
-
64
- Claude Code: clean, debug, plan, ship, test
65
- Codex: clean, debug, plan, ship, test
66
- Gemini CLI: clean, debug, plan, ship, test
67
-
68
- Installed MCP Servers
69
-
70
- All agents: Swarm, filesystem, memory
71
-
72
- Installed Hooks
73
-
74
- Claude Code: pre-commit, post-tool
75
- Gemini CLI: pre-commit, post-tool
15
+ agents pull # Sync config to all agents
16
+ agents jobs run my-job # Run an agent job now
17
+ agents daemon start # Start the job scheduler
18
+ agents status # See what's installed
76
19
  ```
77
20
 
78
- Write commands once in markdown - auto-converts to TOML for Gemini. Define MCP servers once - installs to all agents. Your `.agents` repo becomes the single source of truth.
79
-
80
21
  ## What Gets Synced
81
22
 
82
- | Resource | Description | Agents |
83
- |----------|-------------|--------|
84
- | Slash commands | `/debug`, `/plan`, custom prompts | Claude, Codex, Gemini, Cursor, OpenCode |
85
- | MCP servers | Tools your agents can use | Claude, Codex, Gemini |
86
- | Hooks | Pre/post execution scripts | Claude, Gemini |
87
- | Skills | Reusable agent capabilities | Claude, Codex, Gemini |
88
- | CLI versions | Which version of each agent | All |
23
+ | Resource | Agents |
24
+ |----------|--------|
25
+ | Slash commands | Claude, Codex, Gemini, Cursor, OpenCode |
26
+ | MCP servers | Claude, Codex, Gemini |
27
+ | Hooks | Claude, Gemini |
28
+ | Skills | Claude, Codex, Gemini |
29
+ | CLI versions | All |
89
30
 
90
31
  ## Quick Start
91
32
 
92
33
  ```bash
93
- # 1. Install
94
34
  npm install -g @swarmify/agents-cli
95
-
96
- # 2. Pull (auto-configures from default repo on first run)
97
- agents pull
98
-
99
- # 3. Check what's installed
100
- agents status
35
+ agents pull # Auto-configures from default repo on first run
36
+ agents status # See what got installed
101
37
  ```
102
38
 
103
- Pull a specific agent only:
104
-
105
- ```bash
106
- agents pull claude # Only configure Claude Code
107
- agents pull codex # Only configure Codex
108
- ```
109
-
110
- ## Using Your Own Config
111
-
112
- By default, `agents pull` uses the [system repo](https://github.com/muqsitnawaz/.agents). To use your own:
39
+ Use your own config repo:
113
40
 
114
41
  ```bash
115
- # Fork the system repo, then:
116
42
  agents repo add gh:username/.agents
117
-
118
- # Now pull uses your repo
119
43
  agents pull
120
44
  ```
121
45
 
122
- ## .agents Repo Structure
123
-
124
- ```
125
- .agents/
126
- agents.yaml # CLI versions, MCP servers, defaults
127
- shared/commands/ # Slash commands for all agents
128
- claude/commands/ # Claude-specific commands
129
- claude/hooks/ # Claude hooks
130
- codex/prompts/ # Codex-specific prompts
131
- gemini/commands/ # Gemini commands (auto-converted to TOML)
132
- skills/ # Agent Skills (SKILL.md + rules/)
133
- ```
134
-
135
- Example `agents.yaml`:
136
-
137
- ```yaml
138
- clis:
139
- claude:
140
- package: "@anthropic-ai/claude-code"
141
- version: "latest"
142
- codex:
143
- package: "@openai/codex"
144
- version: "latest"
145
-
146
- mcp:
147
- filesystem:
148
- command: "npx -y @anthropic-ai/mcp-filesystem"
149
- transport: stdio
150
- scope: user
151
- agents: [claude, codex, gemini]
152
-
153
- memory:
154
- command: "npx -y @anthropic-ai/mcp-memory"
155
- transport: stdio
156
- scope: user
157
- agents: [claude, codex, gemini]
158
-
159
- defaults:
160
- method: symlink
161
- scope: user
162
- agents: [claude, codex, gemini]
163
- ```
164
-
165
46
  ## Commands
166
47
 
167
- ### Status
168
-
169
48
  ```bash
170
- agents status # Full overview
171
- agents status --agent claude
172
- ```
49
+ # Sync
50
+ agents pull [agent] # Pull config (optionally for one agent)
51
+ agents push # Push local changes back
173
52
 
174
- ### Pull & Push
53
+ # Resources
54
+ agents commands list|add|remove|push
55
+ agents mcp list|add|remove|push
56
+ agents skills list|add|info
57
+ agents hooks list|add|remove
175
58
 
176
- ```bash
177
- agents pull # Sync all agents from your repo
178
- agents pull claude # Sync only Claude resources
179
- agents pull cc # Same (aliases: cc, codex/cx, gemini/gx)
180
- agents pull --dry-run # Preview what would change
181
- agents pull -y # Auto-confirm, skip conflicts
182
- agents pull -f # Auto-confirm, overwrite conflicts
183
- agents push # Push local changes back
184
- ```
59
+ # CLI management
60
+ agents cli list|add|remove|upgrade
185
61
 
186
- The pull command shows an overview of NEW vs EXISTING resources before installation. For conflicts, you're prompted per-resource to overwrite, skip, or cancel.
62
+ # Registries
63
+ agents search <query> # Search MCP registries
64
+ agents add mcp:<name> # Install from registry
187
65
 
188
- ### Slash Commands
189
-
190
- ```bash
191
- agents commands list
192
- agents commands add gh:user/my-commands
193
- agents commands remove my-command
194
- agents commands push my-command # Promote project -> user scope
66
+ # Jobs
67
+ agents jobs list|add|run|enable|disable|logs|report
68
+ agents daemon start|stop|status|logs
195
69
  ```
196
70
 
197
- ### MCP Servers
71
+ Resources support two scopes: **user** (`~/.{agent}/`) for global availability, and **project** (`./.{agent}/`) for repo-specific config. Use `push` subcommands to promote project scope to user scope.
198
72
 
199
- ```bash
200
- # List across all agents
201
- agents mcp list
202
-
203
- # Add (use -- before the command)
204
- agents mcp add memory -- npx -y @anthropic-ai/mcp-memory
205
- agents mcp add api https://api.example.com --transport http
73
+ ## Jobs
206
74
 
207
- # Search registries
208
- agents search filesystem
209
- agents add mcp:@anthropic-ai/mcp-filesystem
75
+ Schedule AI agents to run autonomously on a cron schedule. Define a job in YAML, the daemon handles the rest.
210
76
 
211
- # Remove
212
- agents mcp remove memory
213
- ```
77
+ ```yaml
78
+ name: reddit-engagement
79
+ schedule: "0 9 * * 1-4"
80
+ agent: claude
81
+ mode: plan
82
+ timeout: 30m
83
+ prompt: |
84
+ Today is {day}. Follow the engagement plan.
214
85
 
215
- ### Skills
86
+ allow:
87
+ tools: [web_search, web_fetch]
88
+ sites: [reddit.com, old.reddit.com]
89
+ dirs: [~/.agents/reports/reddit-engagement]
216
90
 
217
- ```bash
218
- agents skills list
219
- agents skills add gh:user/my-skills
220
- agents skills info my-skill
91
+ config:
92
+ model: claude-sonnet-4-5
221
93
  ```
222
94
 
223
- ### Hooks
95
+ Jobs support `claude`, `codex`, and `gemini` agents. The `prompt` supports template variables: `{day}`, `{date}`, `{time}`, `{job_name}`, `{last_report}`.
224
96
 
225
- ```bash
226
- agents hooks list
227
- agents hooks add gh:user/my-hooks
228
- agents hooks remove my-hook
229
- ```
97
+ ### Sandboxed Execution
230
98
 
231
- ### CLI Management
99
+ Each job runs in an isolated environment. The agent doesn't see your real home directory - it gets an overlay:
232
100
 
233
- ```bash
234
- agents cli list # Show installed versions
235
- agents cli add claude # Install agent CLI
236
- agents cli remove codex # Uninstall agent CLI
237
- agents cli upgrade # Upgrade all to latest
238
101
  ```
239
-
240
- ## Scopes
241
-
242
- Resources can exist at two levels:
243
-
244
- | Scope | Location | Use |
245
- |-------|----------|-----|
246
- | User | `~/.{agent}/` | Available everywhere |
247
- | Project | `./.{agent}/` | This repo only, committed |
248
-
249
- Promote project-scoped items to user scope:
250
-
251
- ```bash
252
- agents commands push my-command
253
- agents mcp push my-server
254
- agents skills push my-skill
102
+ ~/.agents/jobs/reddit-engagement/home/ <-- agent sees this as $HOME
103
+ .claude/
104
+ settings.json <-- generated from allow.tools
105
+ .agents/
106
+ reports/
107
+ reddit-engagement/ -> ~/real/path <-- symlink from allow.dirs
255
108
  ```
256
109
 
257
- ## Filtering
258
-
259
- All list commands support filters:
110
+ Two layers of enforcement, neither relies on prompt injection:
260
111
 
261
- ```bash
262
- agents commands list --agent claude
263
- agents mcp list --scope project
264
- agents skills list --agent codex --scope user
265
- ```
112
+ | Layer | What it does | How |
113
+ |-------|-------------|-----|
114
+ | **Agent config** | Tool allowlists (`WebSearch(*)`, `Read(*)`, etc.) | Agent CLI reads generated config and blocks disallowed tools |
115
+ | **HOME overlay** | Filesystem isolation | Only `allow.dirs` entries are symlinked in; everything else is invisible |
116
+ | **Env sanitization** | No credential leakage | Only safe env vars (PATH, SHELL, LANG, etc.) are passed through |
266
117
 
267
- ## Registries
118
+ The agent can't access `~/.ssh`, `~/.aws`, `~/.gitconfig`, API keys in env vars, or anything else you didn't explicitly allow. The overlay is recreated fresh before each run.
268
119
 
269
- Search and install from public registries:
120
+ ### Model Pinning
270
121
 
271
- ```bash
272
- # Search
273
- agents search github --type mcp
274
-
275
- # Install from registry
276
- agents add mcp:@anthropic-ai/mcp-filesystem
122
+ ```yaml
123
+ # Claude
124
+ config:
125
+ model: claude-sonnet-4-5
277
126
 
278
- # Manage registries
279
- agents registry list
280
- agents registry add mcp myregistry https://api.example.com
281
- agents registry config mcp myregistry --api-key KEY
127
+ # Codex
128
+ agent: codex
129
+ config:
130
+ model: gpt-5.2-codex
282
131
  ```
283
132
 
284
133
  ## Supported Agents
285
134
 
286
- | Agent | Commands | MCP | Hooks | Skills |
287
- |-------|----------|-----|-------|--------|
288
- | Claude Code | Yes | Yes | Yes | Yes |
289
- | Codex | Yes | Yes | - | Yes |
290
- | Gemini CLI | Yes | Yes | Yes | Yes |
291
- | Cursor | Yes | Yes | - | - |
292
- | OpenCode | Yes | Yes | - | - |
293
-
294
- Format conversion is automatic. Write commands in markdown, they're converted to TOML for Gemini.
135
+ | Agent | Commands | MCP | Hooks | Skills | Jobs |
136
+ |-------|----------|-----|-------|--------|------|
137
+ | Claude Code | Yes | Yes | Yes | Yes | Yes |
138
+ | Codex | Yes | Yes | - | Yes | Yes |
139
+ | Gemini CLI | Yes | Yes | Yes | Yes | Yes |
140
+ | Cursor | Yes | Yes | - | - | - |
141
+ | OpenCode | Yes | Yes | - | - | - |
295
142
 
296
143
  ## Roadmap: Context Drives
297
144
 
298
- Sync your docs, research, and chat history across machines and teams.
299
-
300
- ```
301
- ~/.agents/
302
- drives/ # Context drives (synced)
303
- work/
304
- .context # Per-drive settings
305
- docs/
306
- research/
307
- specs/
308
- personal/
309
- .context
310
- notes/
311
-
312
- sessions/ # Agent chat history (synced)
313
- claude/
314
- codex/
315
- gemini/
316
- ```
317
-
318
- **Why not just Google Drive?**
319
-
320
- | Feature | Google Drive | Context Drives |
321
- |---------|--------------|----------------|
322
- | Sync files | Yes | Yes |
323
- | Real-time collab | Yes (Docs only) | Yes (CRDT for all files) |
324
- | Agent session sync | No | Yes |
325
- | Checkpointing | No | Yes (snapshot & rollback) |
326
- | Per-directory conflict strategy | No | Yes (`.context` file) |
327
- | Designed for AI agents | No | Yes |
328
-
329
- **Conflict resolution strategies** (configurable per directory):
330
-
331
- ```yaml
332
- # .context file
333
- strategy: crdt # Auto-merge (like Google Docs)
334
- # strategy: git # Branch/PR/merge (for code)
335
- # strategy: lock # Exclusive access
336
- # strategy: last-write-wins # Don't care about conflicts
337
-
338
- sync: realtime # or: on-demand, ignore
339
- ```
340
-
341
- **Planned commands:**
145
+ Sync docs, research, and agent chat history across machines and teams. Per-directory conflict strategies (CRDT, git, lock, last-write-wins). Checkpointing and rollback.
342
146
 
343
147
  ```bash
344
148
  agents drive create <name>
345
- agents drive list
346
- agents drive use <name>
347
149
  agents drive sync
348
150
  agents drive checkpoint "before refactor"
349
151
  agents drive rollback <checkpoint>
350
152
  ```
351
153
 
352
- **Multi-agent coordination:** When multiple agents (or developers) work on the same drive, the drive acts as a coordination layer - checkout files, see who's working on what, avoid conflicts.
353
-
354
- ## Related
355
-
356
- - [@swarmify/agents-mcp](https://www.npmjs.com/package/@swarmify/agents-mcp) - MCP server for sub-agent spawning
357
- - [Agents Extension](https://marketplace.visualstudio.com/items?itemName=swarmify.swarm-ext) - Full-screen agent terminals in VS Code/Cursor
358
-
359
154
  ## License
360
155
 
361
156
  MIT