@swarmify/agents-cli 1.5.13 → 1.5.15

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 (66) hide show
  1. package/README.md +93 -213
  2. package/dist/index.js +1194 -173
  3. package/dist/index.js.map +1 -1
  4. package/dist/lib/agents.d.ts.map +1 -1
  5. package/dist/lib/agents.js +19 -2
  6. package/dist/lib/agents.js.map +1 -1
  7. package/dist/lib/artifact-actions.d.ts +22 -0
  8. package/dist/lib/artifact-actions.d.ts.map +1 -0
  9. package/dist/lib/artifact-actions.js +55 -0
  10. package/dist/lib/artifact-actions.js.map +1 -0
  11. package/dist/lib/commands.d.ts.map +1 -1
  12. package/dist/lib/commands.js +3 -5
  13. package/dist/lib/commands.js.map +1 -1
  14. package/dist/lib/daemon.d.ts +22 -0
  15. package/dist/lib/daemon.d.ts.map +1 -0
  16. package/dist/lib/daemon.js +303 -0
  17. package/dist/lib/daemon.js.map +1 -0
  18. package/dist/lib/drive-server.d.ts +9 -0
  19. package/dist/lib/drive-server.d.ts.map +1 -0
  20. package/dist/lib/drive-server.js +217 -0
  21. package/dist/lib/drive-server.js.map +1 -0
  22. package/dist/lib/drives.d.ts +34 -0
  23. package/dist/lib/drives.d.ts.map +1 -0
  24. package/dist/lib/drives.js +267 -0
  25. package/dist/lib/drives.js.map +1 -0
  26. package/dist/lib/instructions.d.ts +31 -0
  27. package/dist/lib/instructions.d.ts.map +1 -0
  28. package/dist/lib/instructions.js +161 -0
  29. package/dist/lib/instructions.js.map +1 -0
  30. package/dist/lib/jobs.d.ts +53 -0
  31. package/dist/lib/jobs.d.ts.map +1 -0
  32. package/dist/lib/jobs.js +242 -0
  33. package/dist/lib/jobs.js.map +1 -0
  34. package/dist/lib/runner.d.ts +12 -0
  35. package/dist/lib/runner.d.ts.map +1 -0
  36. package/dist/lib/runner.js +266 -0
  37. package/dist/lib/runner.js.map +1 -0
  38. package/dist/lib/sandbox.d.ts +10 -0
  39. package/dist/lib/sandbox.d.ts.map +1 -0
  40. package/dist/lib/sandbox.js +166 -0
  41. package/dist/lib/sandbox.js.map +1 -0
  42. package/dist/lib/scheduler.d.ts +18 -0
  43. package/dist/lib/scheduler.d.ts.map +1 -0
  44. package/dist/lib/scheduler.js +64 -0
  45. package/dist/lib/scheduler.js.map +1 -0
  46. package/dist/lib/shims.d.ts +32 -0
  47. package/dist/lib/shims.d.ts.map +1 -0
  48. package/dist/lib/shims.js +175 -0
  49. package/dist/lib/shims.js.map +1 -0
  50. package/dist/lib/state.d.ts +5 -0
  51. package/dist/lib/state.d.ts.map +1 -1
  52. package/dist/lib/state.js +35 -0
  53. package/dist/lib/state.js.map +1 -1
  54. package/dist/lib/template.d.ts +24 -0
  55. package/dist/lib/template.d.ts.map +1 -0
  56. package/dist/lib/template.js +57 -0
  57. package/dist/lib/template.js.map +1 -0
  58. package/dist/lib/types.d.ts +11 -0
  59. package/dist/lib/types.d.ts.map +1 -1
  60. package/dist/lib/types.js.map +1 -1
  61. package/dist/lib/versions.d.ts +79 -0
  62. package/dist/lib/versions.d.ts.map +1 -0
  63. package/dist/lib/versions.js +289 -0
  64. package/dist/lib/versions.js.map +1 -0
  65. package/package.json +8 -5
  66. package/scripts/postinstall.js +72 -0
package/README.md CHANGED
@@ -1,275 +1,155 @@
1
- # @swarmify/agents-cli
1
+ # agents-cli
2
2
 
3
- Your virtual environment manager for AI coding agents.
4
-
5
- Homepage: https://swarmify.co/#agents-cli
6
- NPM: https://www.npmjs.com/package/@swarmify/agents-cli
7
- VS Code Extension: [Agents](https://marketplace.visualstudio.com/items?itemName=swarmify.swarm-ext) - full-screen agent terminals with sub-agent spawning
3
+ **`systemctl` + `venv` for AI coding agents.** Manage, configure, schedule, and sandbox Claude, Codex, Gemini, Cursor, and OpenCode from a single CLI.
8
4
 
9
5
  ```bash
10
6
  npm install -g @swarmify/agents-cli
11
7
  ```
12
8
 
13
- ## The Problem
14
-
15
- You spend hours configuring Claude Code: MCP servers, slash commands, hooks, skills. Then you switch to Codex or Gemini and start from scratch. Or you get a new machine and lose everything.
16
-
17
- ## The Solution
18
-
19
- One command to configure all your agents.
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
20
13
 
21
14
  ```bash
22
- # New machine? One command.
23
- agents pull
24
-
25
- # See what's installed
26
- agents status
27
- ```
28
-
29
- ```
30
- Agent CLIs
31
-
32
- Claude Code 2.0.65
33
-
34
- Installed Commands
35
-
36
- Claude Code:
37
- User: clean, debug, plan, recap, ship, spawn, test, verify
38
- Project: eval
39
-
40
- Installed Skills
41
-
42
- Claude Code:
43
- User: remotion-best-practices, vercel-react-best-practices
44
-
45
- Installed MCP Servers
46
-
47
- Claude Code:
48
- User: Swarm@latest, GoDaddy
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
49
19
  ```
50
20
 
51
- Your `.agents` repo becomes the source of truth for all your AI coding tools.
52
-
53
21
  ## What Gets Synced
54
22
 
55
- | Resource | Description | Agents |
56
- |----------|-------------|--------|
57
- | Slash commands | `/debug`, `/plan`, custom prompts | Claude, Codex, Gemini, Cursor, OpenCode |
58
- | MCP servers | Tools your agents can use | Claude, Codex, Gemini |
59
- | Hooks | Pre/post execution scripts | Claude, Gemini |
60
- | Skills | Reusable agent capabilities | Claude, Codex, Gemini |
61
- | 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 |
62
30
 
63
31
  ## Quick Start
64
32
 
65
33
  ```bash
66
- # 1. Install
67
34
  npm install -g @swarmify/agents-cli
68
-
69
- # 2. Pull (auto-configures from default repo on first run)
70
- agents pull
71
-
72
- # 3. Check what's installed
73
- agents status
35
+ agents pull # Auto-configures from default repo on first run
36
+ agents status # See what got installed
74
37
  ```
75
38
 
76
- Pull a specific agent only:
39
+ Use your own config repo:
77
40
 
78
41
  ```bash
79
- agents pull claude # Only configure Claude Code
80
- agents pull codex # Only configure Codex
81
- ```
82
-
83
- ## Using Your Own Config
84
-
85
- By default, `agents pull` uses the [system repo](https://github.com/muqsitnawaz/.agents). To use your own:
86
-
87
- ```bash
88
- # Fork the system repo, then:
89
42
  agents repo add gh:username/.agents
90
-
91
- # Now pull uses your repo
92
43
  agents pull
93
44
  ```
94
45
 
95
- ## .agents Repo Structure
96
-
97
- ```
98
- .agents/
99
- agents.yaml # CLI versions, MCP servers, defaults
100
- shared/commands/ # Slash commands for all agents
101
- claude/commands/ # Claude-specific commands
102
- claude/hooks/ # Claude hooks
103
- codex/prompts/ # Codex-specific prompts
104
- gemini/commands/ # Gemini commands (auto-converted to TOML)
105
- skills/ # Agent Skills (SKILL.md + rules/)
106
- ```
107
-
108
- Example `agents.yaml`:
109
-
110
- ```yaml
111
- clis:
112
- claude:
113
- package: "@anthropic-ai/claude-code"
114
- version: "latest"
115
- codex:
116
- package: "@openai/codex"
117
- version: "latest"
118
-
119
- mcp:
120
- filesystem:
121
- command: "npx -y @anthropic-ai/mcp-filesystem"
122
- transport: stdio
123
- scope: user
124
- agents: [claude, codex, gemini]
125
-
126
- memory:
127
- command: "npx -y @anthropic-ai/mcp-memory"
128
- transport: stdio
129
- scope: user
130
- agents: [claude, codex, gemini]
131
-
132
- defaults:
133
- method: symlink
134
- scope: user
135
- agents: [claude, codex, gemini]
136
- ```
137
-
138
46
  ## Commands
139
47
 
140
- ### Status
141
-
142
48
  ```bash
143
- agents status # Full overview
144
- agents status --agent claude
145
- ```
146
-
147
- ### Pull & Push
49
+ # Sync
50
+ agents pull [agent] # Pull config (optionally for one agent)
51
+ agents push # Push local changes back
148
52
 
149
- ```bash
150
- agents pull # Sync all agents from your repo
151
- agents pull claude # Sync only Claude resources
152
- agents pull cc # Same (aliases: cc, codex/cx, gemini/gx)
153
- agents pull --dry-run # Preview what would change
154
- agents pull -y # Auto-confirm, skip conflicts
155
- agents pull -f # Auto-confirm, overwrite conflicts
156
- agents push # Push local changes back
157
- ```
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
158
58
 
159
- 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.
59
+ # CLI management
60
+ agents cli list|add|remove|upgrade
160
61
 
161
- ### Slash Commands
62
+ # Registries
63
+ agents search <query> # Search MCP registries
64
+ agents add mcp:<name> # Install from registry
162
65
 
163
- ```bash
164
- agents commands list
165
- agents commands add gh:user/my-commands
166
- agents commands remove my-command
167
- 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
168
69
  ```
169
70
 
170
- ### MCP Servers
171
-
172
- ```bash
173
- # List across all agents
174
- agents mcp list
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.
175
72
 
176
- # Add (use -- before the command)
177
- agents mcp add memory -- npx -y @anthropic-ai/mcp-memory
178
- agents mcp add api https://api.example.com --transport http
73
+ ## Jobs
179
74
 
180
- # Search registries
181
- agents search filesystem
182
- 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.
183
76
 
184
- # Remove
185
- agents mcp remove memory
186
- ```
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.
187
85
 
188
- ### Skills
86
+ allow:
87
+ tools: [web_search, web_fetch]
88
+ sites: [reddit.com, old.reddit.com]
89
+ dirs: [~/.agents/reports/reddit-engagement]
189
90
 
190
- ```bash
191
- agents skills list
192
- agents skills add gh:user/my-skills
193
- agents skills info my-skill
91
+ config:
92
+ model: claude-sonnet-4-5
194
93
  ```
195
94
 
196
- ### Hooks
95
+ Jobs support `claude`, `codex`, and `gemini` agents. The `prompt` supports template variables: `{day}`, `{date}`, `{time}`, `{job_name}`, `{last_report}`.
197
96
 
198
- ```bash
199
- agents hooks list
200
- agents hooks add gh:user/my-hooks
201
- agents hooks remove my-hook
202
- ```
97
+ ### Sandboxed Execution
203
98
 
204
- ### CLI Management
99
+ Each job runs in an isolated environment. The agent doesn't see your real home directory - it gets an overlay:
205
100
 
206
- ```bash
207
- agents cli list # Show installed versions
208
- agents cli add claude # Install agent CLI
209
- agents cli remove codex # Uninstall agent CLI
210
- agents cli upgrade # Upgrade all to latest
211
101
  ```
212
-
213
- ## Scopes
214
-
215
- Resources can exist at two levels:
216
-
217
- | Scope | Location | Use |
218
- |-------|----------|-----|
219
- | User | `~/.{agent}/` | Available everywhere |
220
- | Project | `./.{agent}/` | This repo only, committed |
221
-
222
- Promote project-scoped items to user scope:
223
-
224
- ```bash
225
- agents commands push my-command
226
- agents mcp push my-server
227
- 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
228
108
  ```
229
109
 
230
- ## Filtering
110
+ Two layers of enforcement, neither relies on prompt injection:
231
111
 
232
- All list commands support filters:
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 |
233
117
 
234
- ```bash
235
- agents commands list --agent claude
236
- agents mcp list --scope project
237
- agents skills list --agent codex --scope user
238
- ```
239
-
240
- ## 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.
241
119
 
242
- Search and install from public registries:
243
-
244
- ```bash
245
- # Search
246
- agents search github --type mcp
120
+ ### Model Pinning
247
121
 
248
- # Install from registry
249
- agents add mcp:@anthropic-ai/mcp-filesystem
122
+ ```yaml
123
+ # Claude
124
+ config:
125
+ model: claude-sonnet-4-5
250
126
 
251
- # Manage registries
252
- agents registry list
253
- agents registry add mcp myregistry https://api.example.com
254
- agents registry config mcp myregistry --api-key KEY
127
+ # Codex
128
+ agent: codex
129
+ config:
130
+ model: gpt-5.2-codex
255
131
  ```
256
132
 
257
133
  ## Supported Agents
258
134
 
259
- | Agent | Commands | MCP | Hooks | Skills |
260
- |-------|----------|-----|-------|--------|
261
- | Claude Code | Yes | Yes | Yes | Yes |
262
- | Codex | Yes | Yes | - | Yes |
263
- | Gemini CLI | Yes | Yes | Yes | Yes |
264
- | Cursor | Yes | Yes | - | - |
265
- | OpenCode | Yes | Yes | - | - |
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 | - | - | - |
266
142
 
267
- Format conversion is automatic. Write commands in markdown, they're converted to TOML for Gemini.
143
+ ## Roadmap: Context Drives
268
144
 
269
- ## Related
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.
270
146
 
271
- - [@swarmify/agents-mcp](https://www.npmjs.com/package/@swarmify/agents-mcp) - MCP server for sub-agent spawning
272
- - [Agents Extension](https://marketplace.visualstudio.com/items?itemName=swarmify.swarm-ext) - Full-screen agent terminals in VS Code/Cursor
147
+ ```bash
148
+ agents drive create <name>
149
+ agents drive sync
150
+ agents drive checkpoint "before refactor"
151
+ agents drive rollback <checkpoint>
152
+ ```
273
153
 
274
154
  ## License
275
155