@swarmclawai/swarmclaw 0.2.0

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 (319) hide show
  1. package/README.md +577 -0
  2. package/bin/server-cmd.js +359 -0
  3. package/bin/swarmclaw.js +29 -0
  4. package/bin/swarmclaw.mjs +1504 -0
  5. package/next.config.ts +33 -0
  6. package/package.json +112 -0
  7. package/postcss.config.mjs +7 -0
  8. package/public/branding/swarmclaw-org-avatar.png +0 -0
  9. package/public/branding/swarmclaw-org-avatar.svg +58 -0
  10. package/public/file.svg +1 -0
  11. package/public/globe.svg +1 -0
  12. package/public/next.svg +1 -0
  13. package/public/screenshots/agents.png +0 -0
  14. package/public/screenshots/connectors.png +0 -0
  15. package/public/screenshots/dashboard.png +0 -0
  16. package/public/screenshots/new-session-openclaw.png +0 -0
  17. package/public/screenshots/providers.png +0 -0
  18. package/public/screenshots/schedules.png +0 -0
  19. package/public/screenshots/tasks.png +0 -0
  20. package/public/vercel.svg +1 -0
  21. package/public/window.svg +1 -0
  22. package/src/app/api/agents/[id]/route.ts +30 -0
  23. package/src/app/api/agents/[id]/thread/route.ts +66 -0
  24. package/src/app/api/agents/generate/route.ts +42 -0
  25. package/src/app/api/agents/route.ts +33 -0
  26. package/src/app/api/auth/route.ts +25 -0
  27. package/src/app/api/claude-skills/route.ts +42 -0
  28. package/src/app/api/clawhub/install/route.ts +39 -0
  29. package/src/app/api/clawhub/search/route.ts +11 -0
  30. package/src/app/api/connectors/[id]/route.ts +79 -0
  31. package/src/app/api/connectors/route.ts +60 -0
  32. package/src/app/api/credentials/[id]/route.ts +14 -0
  33. package/src/app/api/credentials/route.ts +31 -0
  34. package/src/app/api/daemon/health-check/route.ts +11 -0
  35. package/src/app/api/daemon/route.ts +22 -0
  36. package/src/app/api/dirs/pick/route.ts +60 -0
  37. package/src/app/api/dirs/route.ts +29 -0
  38. package/src/app/api/documents/[id]/route.ts +47 -0
  39. package/src/app/api/documents/route.ts +93 -0
  40. package/src/app/api/files/serve/route.ts +69 -0
  41. package/src/app/api/generate/info/route.ts +12 -0
  42. package/src/app/api/generate/route.ts +106 -0
  43. package/src/app/api/ip/route.ts +6 -0
  44. package/src/app/api/knowledge/[id]/route.ts +61 -0
  45. package/src/app/api/knowledge/route.ts +48 -0
  46. package/src/app/api/knowledge/upload/route.ts +86 -0
  47. package/src/app/api/logs/route.ts +65 -0
  48. package/src/app/api/mcp-servers/[id]/route.ts +32 -0
  49. package/src/app/api/mcp-servers/[id]/test/route.ts +23 -0
  50. package/src/app/api/mcp-servers/[id]/tools/route.ts +32 -0
  51. package/src/app/api/mcp-servers/route.ts +27 -0
  52. package/src/app/api/memory/[id]/route.ts +126 -0
  53. package/src/app/api/memory/maintenance/route.ts +63 -0
  54. package/src/app/api/memory/route.ts +111 -0
  55. package/src/app/api/memory-images/[filename]/route.ts +36 -0
  56. package/src/app/api/orchestrator/run/route.ts +43 -0
  57. package/src/app/api/plugins/install/route.ts +58 -0
  58. package/src/app/api/plugins/marketplace/route.ts +33 -0
  59. package/src/app/api/plugins/route.ts +21 -0
  60. package/src/app/api/preview-server/route.ts +339 -0
  61. package/src/app/api/providers/[id]/models/route.ts +29 -0
  62. package/src/app/api/providers/[id]/route.ts +34 -0
  63. package/src/app/api/providers/configs/route.ts +7 -0
  64. package/src/app/api/providers/ollama/route.ts +30 -0
  65. package/src/app/api/providers/openclaw/health/route.ts +23 -0
  66. package/src/app/api/providers/route.ts +28 -0
  67. package/src/app/api/runs/[id]/route.ts +9 -0
  68. package/src/app/api/runs/route.ts +13 -0
  69. package/src/app/api/schedules/[id]/route.ts +28 -0
  70. package/src/app/api/schedules/[id]/run/route.ts +104 -0
  71. package/src/app/api/schedules/route.ts +78 -0
  72. package/src/app/api/secrets/[id]/route.ts +29 -0
  73. package/src/app/api/secrets/route.ts +42 -0
  74. package/src/app/api/sessions/[id]/browser/route.ts +13 -0
  75. package/src/app/api/sessions/[id]/chat/route.ts +96 -0
  76. package/src/app/api/sessions/[id]/clear/route.ts +19 -0
  77. package/src/app/api/sessions/[id]/deploy/route.ts +34 -0
  78. package/src/app/api/sessions/[id]/devserver/route.ts +69 -0
  79. package/src/app/api/sessions/[id]/mailbox/route.ts +70 -0
  80. package/src/app/api/sessions/[id]/main-loop/route.ts +94 -0
  81. package/src/app/api/sessions/[id]/messages/route.ts +9 -0
  82. package/src/app/api/sessions/[id]/retry/route.ts +28 -0
  83. package/src/app/api/sessions/[id]/route.ts +103 -0
  84. package/src/app/api/sessions/[id]/stop/route.ts +13 -0
  85. package/src/app/api/sessions/heartbeat/route.ts +26 -0
  86. package/src/app/api/sessions/route.ts +85 -0
  87. package/src/app/api/settings/route.ts +58 -0
  88. package/src/app/api/setup/check-provider/route.ts +326 -0
  89. package/src/app/api/setup/doctor/route.ts +250 -0
  90. package/src/app/api/skills/[id]/route.ts +40 -0
  91. package/src/app/api/skills/import/route.ts +69 -0
  92. package/src/app/api/skills/route.ts +28 -0
  93. package/src/app/api/tasks/[id]/route.ts +102 -0
  94. package/src/app/api/tasks/route.ts +115 -0
  95. package/src/app/api/tts/route.ts +40 -0
  96. package/src/app/api/upload/route.ts +18 -0
  97. package/src/app/api/uploads/[filename]/route.ts +59 -0
  98. package/src/app/api/usage/route.ts +35 -0
  99. package/src/app/api/version/route.ts +81 -0
  100. package/src/app/api/version/update/route.ts +95 -0
  101. package/src/app/api/webhooks/[id]/history/route.ts +13 -0
  102. package/src/app/api/webhooks/[id]/route.ts +204 -0
  103. package/src/app/api/webhooks/route.ts +37 -0
  104. package/src/app/favicon.ico +0 -0
  105. package/src/app/globals.css +370 -0
  106. package/src/app/layout.tsx +52 -0
  107. package/src/app/page.tsx +172 -0
  108. package/src/cli/index.js +1232 -0
  109. package/src/cli/index.test.js +281 -0
  110. package/src/cli/index.ts +1158 -0
  111. package/src/cli/spec.js +284 -0
  112. package/src/components/agents/agent-card.tsx +219 -0
  113. package/src/components/agents/agent-chat-list.tsx +165 -0
  114. package/src/components/agents/agent-list.tsx +110 -0
  115. package/src/components/agents/agent-sheet.tsx +1220 -0
  116. package/src/components/auth/access-key-gate.tsx +248 -0
  117. package/src/components/auth/setup-wizard.tsx +940 -0
  118. package/src/components/auth/user-picker.tsx +88 -0
  119. package/src/components/chat/chat-area.tsx +406 -0
  120. package/src/components/chat/chat-header.tsx +491 -0
  121. package/src/components/chat/chat-tool-toggles.tsx +161 -0
  122. package/src/components/chat/code-block.tsx +146 -0
  123. package/src/components/chat/dev-server-bar.tsx +39 -0
  124. package/src/components/chat/message-bubble.tsx +486 -0
  125. package/src/components/chat/message-list.tsx +299 -0
  126. package/src/components/chat/session-debug-panel.tsx +196 -0
  127. package/src/components/chat/streaming-bubble.tsx +85 -0
  128. package/src/components/chat/thinking-indicator.tsx +26 -0
  129. package/src/components/chat/tool-call-bubble.tsx +438 -0
  130. package/src/components/chat/tool-request-banner.tsx +103 -0
  131. package/src/components/connectors/connector-list.tsx +196 -0
  132. package/src/components/connectors/connector-sheet.tsx +804 -0
  133. package/src/components/input/chat-input.tsx +235 -0
  134. package/src/components/knowledge/knowledge-list.tsx +206 -0
  135. package/src/components/knowledge/knowledge-sheet.tsx +316 -0
  136. package/src/components/layout/app-layout.tsx +1016 -0
  137. package/src/components/layout/daemon-indicator.tsx +56 -0
  138. package/src/components/layout/mobile-header.tsx +31 -0
  139. package/src/components/layout/network-banner.tsx +17 -0
  140. package/src/components/layout/update-banner.tsx +130 -0
  141. package/src/components/logs/log-list.tsx +358 -0
  142. package/src/components/mcp-servers/mcp-server-list.tsx +122 -0
  143. package/src/components/mcp-servers/mcp-server-sheet.tsx +243 -0
  144. package/src/components/memory/memory-card.tsx +63 -0
  145. package/src/components/memory/memory-detail.tsx +339 -0
  146. package/src/components/memory/memory-list.tsx +198 -0
  147. package/src/components/memory/memory-sheet.tsx +70 -0
  148. package/src/components/plugins/plugin-list.tsx +60 -0
  149. package/src/components/plugins/plugin-sheet.tsx +311 -0
  150. package/src/components/providers/provider-list.tsx +96 -0
  151. package/src/components/providers/provider-sheet.tsx +542 -0
  152. package/src/components/runs/run-list.tsx +231 -0
  153. package/src/components/schedules/schedule-card.tsx +63 -0
  154. package/src/components/schedules/schedule-list.tsx +76 -0
  155. package/src/components/schedules/schedule-sheet.tsx +336 -0
  156. package/src/components/secrets/secret-sheet.tsx +180 -0
  157. package/src/components/secrets/secrets-list.tsx +91 -0
  158. package/src/components/sessions/new-session-sheet.tsx +478 -0
  159. package/src/components/sessions/session-card.tsx +144 -0
  160. package/src/components/sessions/session-list.tsx +202 -0
  161. package/src/components/shared/ai-gen-block.tsx +77 -0
  162. package/src/components/shared/avatar.tsx +48 -0
  163. package/src/components/shared/bottom-sheet.tsx +30 -0
  164. package/src/components/shared/confirm-dialog.tsx +47 -0
  165. package/src/components/shared/connector-platform-icon.tsx +113 -0
  166. package/src/components/shared/dir-browser.tsx +285 -0
  167. package/src/components/shared/dropdown.tsx +55 -0
  168. package/src/components/shared/icon-button.tsx +25 -0
  169. package/src/components/shared/settings/plugin-manager.tsx +207 -0
  170. package/src/components/shared/settings/section-capability-policy.tsx +93 -0
  171. package/src/components/shared/settings/section-embedding.tsx +99 -0
  172. package/src/components/shared/settings/section-heartbeat.tsx +168 -0
  173. package/src/components/shared/settings/section-memory.tsx +77 -0
  174. package/src/components/shared/settings/section-orchestrator.tsx +108 -0
  175. package/src/components/shared/settings/section-providers.tsx +181 -0
  176. package/src/components/shared/settings/section-runtime-loop.tsx +183 -0
  177. package/src/components/shared/settings/section-secrets.tsx +132 -0
  178. package/src/components/shared/settings/section-user-preferences.tsx +24 -0
  179. package/src/components/shared/settings/section-voice.tsx +53 -0
  180. package/src/components/shared/settings/settings-sheet.tsx +88 -0
  181. package/src/components/shared/settings/types.ts +7 -0
  182. package/src/components/shared/settings/utils.ts +13 -0
  183. package/src/components/shared/settings-sheet.tsx +1 -0
  184. package/src/components/shared/skeleton.tsx +19 -0
  185. package/src/components/shared/usage-badge.tsx +28 -0
  186. package/src/components/skills/clawhub-browser.tsx +225 -0
  187. package/src/components/skills/skill-list.tsx +70 -0
  188. package/src/components/skills/skill-sheet.tsx +254 -0
  189. package/src/components/tasks/task-board.tsx +96 -0
  190. package/src/components/tasks/task-card.tsx +179 -0
  191. package/src/components/tasks/task-column.tsx +73 -0
  192. package/src/components/tasks/task-list.tsx +118 -0
  193. package/src/components/tasks/task-sheet.tsx +415 -0
  194. package/src/components/ui/avatar.tsx +109 -0
  195. package/src/components/ui/badge.tsx +48 -0
  196. package/src/components/ui/button.tsx +64 -0
  197. package/src/components/ui/card.tsx +92 -0
  198. package/src/components/ui/dialog.tsx +158 -0
  199. package/src/components/ui/dropdown-menu.tsx +257 -0
  200. package/src/components/ui/input.tsx +21 -0
  201. package/src/components/ui/scroll-area.tsx +58 -0
  202. package/src/components/ui/select.tsx +190 -0
  203. package/src/components/ui/separator.tsx +28 -0
  204. package/src/components/ui/sheet.tsx +143 -0
  205. package/src/components/ui/sonner.tsx +22 -0
  206. package/src/components/ui/textarea.tsx +18 -0
  207. package/src/components/ui/tooltip.tsx +56 -0
  208. package/src/components/usage/usage-list.tsx +105 -0
  209. package/src/components/webhooks/webhook-list.tsx +166 -0
  210. package/src/components/webhooks/webhook-sheet.tsx +402 -0
  211. package/src/hooks/use-auto-resize.ts +20 -0
  212. package/src/hooks/use-media-query.ts +21 -0
  213. package/src/hooks/use-speech-recognition.ts +83 -0
  214. package/src/instrumentation.ts +8 -0
  215. package/src/lib/agents.ts +13 -0
  216. package/src/lib/api-client.ts +100 -0
  217. package/src/lib/chat.ts +60 -0
  218. package/src/lib/memory.ts +42 -0
  219. package/src/lib/openclaw-endpoint.test.ts +48 -0
  220. package/src/lib/openclaw-endpoint.ts +67 -0
  221. package/src/lib/provider-config.ts +13 -0
  222. package/src/lib/providers/anthropic.ts +135 -0
  223. package/src/lib/providers/claude-cli.ts +202 -0
  224. package/src/lib/providers/codex-cli.ts +260 -0
  225. package/src/lib/providers/index.ts +351 -0
  226. package/src/lib/providers/ollama.ts +131 -0
  227. package/src/lib/providers/openai.ts +164 -0
  228. package/src/lib/providers/openclaw.ts +330 -0
  229. package/src/lib/providers/opencode-cli.ts +164 -0
  230. package/src/lib/runtime-loop.ts +15 -0
  231. package/src/lib/schedule-dedupe.test.ts +84 -0
  232. package/src/lib/schedule-dedupe.ts +174 -0
  233. package/src/lib/schedule-name.ts +62 -0
  234. package/src/lib/schedules.ts +16 -0
  235. package/src/lib/server/agent-registry.ts +70 -0
  236. package/src/lib/server/api-routes.test.ts +362 -0
  237. package/src/lib/server/autonomy-contract.ts +200 -0
  238. package/src/lib/server/build-llm.ts +155 -0
  239. package/src/lib/server/capability-router.test.ts +21 -0
  240. package/src/lib/server/capability-router.ts +172 -0
  241. package/src/lib/server/chat-execution.ts +894 -0
  242. package/src/lib/server/clawhub-client.test.ts +161 -0
  243. package/src/lib/server/clawhub-client.ts +26 -0
  244. package/src/lib/server/connectors/connector-routing.test.ts +243 -0
  245. package/src/lib/server/connectors/discord.ts +116 -0
  246. package/src/lib/server/connectors/googlechat.ts +66 -0
  247. package/src/lib/server/connectors/manager.ts +559 -0
  248. package/src/lib/server/connectors/matrix.ts +78 -0
  249. package/src/lib/server/connectors/media.ts +149 -0
  250. package/src/lib/server/connectors/openclaw.test.ts +375 -0
  251. package/src/lib/server/connectors/openclaw.ts +1132 -0
  252. package/src/lib/server/connectors/signal.ts +183 -0
  253. package/src/lib/server/connectors/slack.ts +258 -0
  254. package/src/lib/server/connectors/teams.ts +94 -0
  255. package/src/lib/server/connectors/telegram.ts +221 -0
  256. package/src/lib/server/connectors/types.ts +62 -0
  257. package/src/lib/server/connectors/whatsapp.ts +349 -0
  258. package/src/lib/server/context-manager.ts +232 -0
  259. package/src/lib/server/cost.ts +31 -0
  260. package/src/lib/server/daemon-state.ts +354 -0
  261. package/src/lib/server/data-dir.ts +3 -0
  262. package/src/lib/server/embeddings.ts +111 -0
  263. package/src/lib/server/execution-log.ts +257 -0
  264. package/src/lib/server/gateway/protocol.test.ts +54 -0
  265. package/src/lib/server/gateway/protocol.ts +114 -0
  266. package/src/lib/server/heartbeat-service.ts +366 -0
  267. package/src/lib/server/knowledge-db.test.ts +441 -0
  268. package/src/lib/server/logger.ts +47 -0
  269. package/src/lib/server/main-agent-loop.ts +1017 -0
  270. package/src/lib/server/mcp-client.test.ts +342 -0
  271. package/src/lib/server/mcp-client.ts +130 -0
  272. package/src/lib/server/memory-db.ts +1078 -0
  273. package/src/lib/server/memory-graph.test.ts +153 -0
  274. package/src/lib/server/memory-graph.ts +138 -0
  275. package/src/lib/server/openclaw-health.ts +245 -0
  276. package/src/lib/server/orchestrator-lg.ts +431 -0
  277. package/src/lib/server/orchestrator.ts +364 -0
  278. package/src/lib/server/playwright-proxy.mjs +70 -0
  279. package/src/lib/server/plugins.ts +229 -0
  280. package/src/lib/server/process-manager.ts +327 -0
  281. package/src/lib/server/provider-health.ts +113 -0
  282. package/src/lib/server/queue.ts +859 -0
  283. package/src/lib/server/runtime-settings.ts +119 -0
  284. package/src/lib/server/scheduler.ts +196 -0
  285. package/src/lib/server/session-mailbox.ts +129 -0
  286. package/src/lib/server/session-run-manager.ts +512 -0
  287. package/src/lib/server/session-tools/connector.ts +124 -0
  288. package/src/lib/server/session-tools/context-mgmt.ts +103 -0
  289. package/src/lib/server/session-tools/context.ts +114 -0
  290. package/src/lib/server/session-tools/crud.ts +673 -0
  291. package/src/lib/server/session-tools/delegate.ts +708 -0
  292. package/src/lib/server/session-tools/file.ts +264 -0
  293. package/src/lib/server/session-tools/index.ts +164 -0
  294. package/src/lib/server/session-tools/memory.ts +230 -0
  295. package/src/lib/server/session-tools/session-info.ts +422 -0
  296. package/src/lib/server/session-tools/session-tools-wiring.test.ts +166 -0
  297. package/src/lib/server/session-tools/shell.ts +171 -0
  298. package/src/lib/server/session-tools/web.ts +408 -0
  299. package/src/lib/server/session-tools.ts +9 -0
  300. package/src/lib/server/skills-normalize.ts +130 -0
  301. package/src/lib/server/storage-mcp.test.ts +161 -0
  302. package/src/lib/server/storage.ts +670 -0
  303. package/src/lib/server/stream-agent-chat.ts +571 -0
  304. package/src/lib/server/task-reports.ts +122 -0
  305. package/src/lib/server/task-result.ts +161 -0
  306. package/src/lib/server/task-validation.test.ts +27 -0
  307. package/src/lib/server/task-validation.ts +90 -0
  308. package/src/lib/server/tool-capability-policy.test.ts +58 -0
  309. package/src/lib/server/tool-capability-policy.ts +262 -0
  310. package/src/lib/sessions.ts +68 -0
  311. package/src/lib/tasks.ts +20 -0
  312. package/src/lib/tts.ts +42 -0
  313. package/src/lib/upload.ts +10 -0
  314. package/src/lib/utils.ts +6 -0
  315. package/src/proxy.ts +43 -0
  316. package/src/stores/use-app-store.ts +468 -0
  317. package/src/stores/use-chat-store.ts +323 -0
  318. package/src/types/index.ts +621 -0
  319. package/tsconfig.json +34 -0
package/README.md ADDED
@@ -0,0 +1,577 @@
1
+ # SwarmClaw
2
+
3
+ [![CI](https://github.com/swarmclawai/swarmclaw/actions/workflows/ci.yml/badge.svg)](https://github.com/swarmclawai/swarmclaw/actions/workflows/ci.yml)
4
+ [![Release](https://img.shields.io/github/v/release/swarmclawai/swarmclaw?sort=semver)](https://github.com/swarmclawai/swarmclaw/releases)
5
+
6
+ <p align="center">
7
+ <img src="https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/public/branding/swarmclaw-org-avatar.png" alt="SwarmClaw lobster logo" width="120" />
8
+ </p>
9
+
10
+ Self-hosted AI agent orchestration dashboard. Manage multiple AI providers, orchestrate agent swarms, schedule tasks, and bridge agents to chat platforms — all from a single mobile-friendly interface.
11
+
12
+ Inspired by [OpenClaw](https://github.com/openclaw).
13
+
14
+ **[Documentation](https://swarmclaw.ai/docs)** | **[Website](https://swarmclaw.ai)**
15
+
16
+ Org avatar files: `public/branding/swarmclaw-org-avatar.png` (upload-ready), `public/branding/swarmclaw-org-avatar.svg` (source)
17
+
18
+ ![Dashboard](public/screenshots/dashboard.png)
19
+ ![Agent Builder](public/screenshots/agents.png)
20
+ ![Task Board](public/screenshots/tasks.png)
21
+
22
+ ## Security Warning
23
+
24
+ SwarmClaw can spawn **Claude Code CLI** processes with full shell access on your machine. This means agents can read, write, and execute anything your user account can. **Do not run this on a shared server or expose it to the public internet without understanding the risks.**
25
+
26
+ - Always use the access key authentication (generated on first run)
27
+ - Never expose port 3456 without a reverse proxy + TLS
28
+ - Review agent system prompts before giving them shell or browser tools
29
+
30
+ ## Features
31
+
32
+ - **15 Built-in Providers** — Claude Code CLI, OpenAI Codex CLI, OpenCode CLI, Anthropic, OpenAI, Google Gemini, DeepSeek, Groq, Together AI, Mistral AI, xAI (Grok), Fireworks AI, Ollama, plus custom OpenAI-compatible endpoints
33
+ - **OpenClaw Gateway** — Per-agent toggle to connect any agent to a local or remote OpenClaw gateway. Each agent gets its own gateway URL and token — run a swarm of OpenClaws from one dashboard. The `openclaw` CLI ships as a bundled dependency (no separate install needed)
34
+ - **Agent Builder** — Create agents with custom personalities (soul), system prompts, tools, and skills. AI-powered generation from a description
35
+ - **Agent Tools** — Shell, process control for long-running commands, files, edit file, send file, web search, web fetch, CLI delegation (Claude/Codex/OpenCode), Playwright browser automation, and persistent memory
36
+ - **Platform Tools** — Agents can manage other agents, tasks, schedules, skills, connectors, sessions, and encrypted secrets via built-in platform tools
37
+ - **Orchestration** — Multi-agent workflows powered by LangGraph with automatic sub-agent routing
38
+ - **Agentic Execution Policy** — Tool-first autonomous action loop with progress updates, evidence-driven answers, and better use of platform tools for long-lived work
39
+ - **Task Board** — Queue and track agent tasks with status, comments, results, and archiving (soft delete with show/hide toggle)
40
+ - **Background Daemon** — Auto-processes queued tasks and scheduled jobs with a 30s heartbeat plus recurring health monitoring
41
+ - **Scheduling** — Cron-based agent scheduling with human-friendly presets
42
+ - **Loop Runtime Controls** — Switch between bounded and ongoing loops with configurable step caps, runtime guards, heartbeat cadence, and timeout budgets
43
+ - **Session Run Queue** — Per-session queued runs with followup/steer/collect modes, collect coalescing for bursty inputs, and run-state APIs
44
+ - **Voice Settings** — Per-instance ElevenLabs API key + voice ID for TTS replies, plus configurable speech recognition language for chat input
45
+ - **Chat Connectors** — Bridge agents to Discord, Slack, Telegram, and WhatsApp with media-aware inbound handling
46
+ - **Skills System** — Discover local skills, import skills from URL, and load OpenClaw `SKILL.md` files (frontmatter-compatible)
47
+ - **Execution Logging** — Structured audit trail for triggers, tool calls, file ops, commits, and errors in a dedicated `logs.db`
48
+ - **Context Management** — Auto-compaction of conversation history when approaching context limits, with manual `context_status` and `context_summarize` tools for agents
49
+ - **Memory** — Per-agent and per-session memory with hybrid FTS5 + vector embeddings search, relevance-based memory recall injected into runs, and periodic auto-journaling for durable execution context
50
+ - **Cost Tracking** — Per-message token counting and cost estimation displayed in the chat header
51
+ - **Model Failover** — Automatic key rotation on rate limits and auth errors with configurable fallback credentials
52
+ - **Plugin System** — Extend agent behavior with JS plugins (hooks: beforeAgentStart, afterAgentComplete, beforeToolExec, afterToolExec, onMessage)
53
+ - **Secrets Vault** — Encrypted storage for API keys and service tokens
54
+ - **Custom Providers** — Add any OpenAI-compatible API as a provider
55
+ - **Mobile-First UI** — Responsive glass-themed dark interface, works on phone and desktop
56
+
57
+ ## Requirements
58
+
59
+ - **Node.js** 20+
60
+ - **npm** 10+
61
+ - **Claude Code CLI** (optional, for `claude-cli` provider) — [Install](https://docs.anthropic.com/en/docs/claude-code/overview)
62
+ - **OpenAI Codex CLI** (optional, for `codex-cli` provider) — [Install](https://github.com/openai/codex)
63
+ - **OpenCode CLI** (optional, for `opencode-cli` provider) — [Install](https://github.com/opencode-ai/opencode)
64
+
65
+ ## Quick Start
66
+
67
+ ```bash
68
+ curl -fsSL https://raw.githubusercontent.com/swarmclawai/swarmclaw/main/install.sh | bash
69
+ ```
70
+
71
+ The installer resolves the latest stable release tag and installs that version by default.
72
+ To pin a version: `SWARMCLAW_VERSION=v0.1.0 curl ... | bash`
73
+
74
+ Or run locally from the repo (friendly for non-technical users):
75
+
76
+ ```bash
77
+ git clone https://github.com/swarmclawai/swarmclaw.git
78
+ cd swarmclaw
79
+ npm run quickstart
80
+ ```
81
+
82
+ `npm run quickstart` will:
83
+ - Check Node/npm versions
84
+ - Install dependencies
85
+ - Prepare `.env.local` and `data/`
86
+ - Start the app at `http://localhost:3456`
87
+
88
+ On first launch, SwarmClaw will:
89
+ 1. Generate an **access key** and display it in the terminal
90
+ 2. Save it to `.env.local`
91
+ 3. Show a first-time setup screen in the browser with the key to copy
92
+
93
+ Open `http://localhost:3456` (or your machine's IP for mobile access). Enter the access key, set your name, and you're in.
94
+
95
+ ### Command-Line Setup (No UI Required)
96
+
97
+ You can complete first-time setup from terminal:
98
+
99
+ ```bash
100
+ # Start the app (if not already running)
101
+ npm run dev
102
+
103
+ # In another terminal, run setup with your provider
104
+ node ./bin/swarmclaw.js setup init --provider openai --api-key "$OPENAI_API_KEY"
105
+ ```
106
+
107
+ Notes:
108
+ - On a fresh instance, `setup init` can auto-discover and claim the first-run access key from `/api/auth`.
109
+ - For existing installs, pass `--key <ACCESS_KEY>` (or set `SWARMCLAW_ACCESS_KEY`).
110
+ - `setup init` performs provider validation, stores credentials, creates a starter agent, and marks setup complete.
111
+ - Use `--skip-check` to bypass connection validation.
112
+
113
+ ### 2-Minute Setup Wizard
114
+
115
+ After login, SwarmClaw opens a guided wizard designed for non-technical users:
116
+
117
+ 1. Choose a provider: **OpenAI**, **Anthropic**, or **Ollama**
118
+ 2. Add only required fields (API key and/or endpoint)
119
+ 3. Click **Check Connection** for live validation before continuing
120
+ 4. (Optional) click **Run System Check** for setup diagnostics
121
+ 5. Create a starter assistant (advanced settings are optional)
122
+
123
+ Notes:
124
+ - Ollama checks can auto-suggest a model from the connected endpoint.
125
+ - OpenClaw is configured per-agent via the **OpenClaw Gateway** toggle (not in the setup wizard).
126
+ - You can skip setup and configure everything later in the sidebar.
127
+
128
+ ## Configuration
129
+
130
+ All config lives in `.env.local` (auto-generated):
131
+
132
+ ```
133
+ ACCESS_KEY=<your-access-key> # Auth key for the dashboard
134
+ CREDENTIAL_SECRET=<auto-generated> # AES-256 encryption key for stored credentials
135
+ ```
136
+
137
+ Data is stored in `data/swarmclaw.db` (SQLite with WAL mode), `data/memory.db` (agent memory with FTS5 + vector embeddings), and `data/logs.db` (execution audit trail). Back the `data/` directory up if you care about your sessions, agents, and credentials. Existing JSON file data is auto-migrated to SQLite on first run.
138
+
139
+ ## Architecture
140
+
141
+ ```
142
+ src/
143
+ ├── app/
144
+ │ ├── api/ # Next.js API routes (REST + SSE streaming)
145
+ │ └── page.tsx # Auth flow → UserPicker → AppLayout
146
+ ├── components/
147
+ │ ├── agents/ # Agent builder UI
148
+ │ ├── auth/ # Access key gate + user picker
149
+ │ ├── chat/ # Message rendering, streaming, code blocks
150
+ │ ├── connectors/ # Discord/Slack/Telegram/WhatsApp config
151
+ │ ├── layout/ # App shell, sidebar, mobile header
152
+ │ ├── providers/ # Provider management
153
+ │ ├── schedules/ # Cron scheduler
154
+ │ ├── sessions/ # Session list + new session
155
+ │ ├── skills/ # Skills manager
156
+ │ ├── tasks/ # Task board
157
+ │ └── shared/ # Reusable UI (BottomSheet, IconButton, etc.)
158
+ ├── lib/
159
+ │ ├── providers/ # LLM provider implementations
160
+ │ └── server/ # Storage, orchestrator, connectors, tools
161
+ ├── stores/ # Zustand state (app store, chat store)
162
+ └── types/ # TypeScript interfaces
163
+ ```
164
+
165
+ **Stack:** Next.js 16, React 19, Tailwind v4, shadcn/ui, Zustand, LangGraph, TypeScript
166
+
167
+ ## Providers
168
+
169
+ ### CLI Providers
170
+
171
+ | Provider | Binary | Notes |
172
+ |-|-|-|
173
+ | Claude Code CLI | `claude` | Spawns with `--print --output-format stream-json`. Includes auth preflight and clearer timeout/exit diagnostics. |
174
+ | OpenAI Codex CLI | `codex` | Spawns with `--full-auto --skip-git-repo-check`. Includes login preflight and streamed CLI error events. |
175
+ | OpenCode CLI | `opencode` | Spawns with `run --format json` and tracks session resume IDs. Multi-model support. |
176
+
177
+ ### API Providers
178
+
179
+ | Provider | Endpoint | Models |
180
+ |-|-|-|
181
+ | Anthropic | api.anthropic.com | Claude Sonnet 4.6, Opus 4.6, Haiku 4.5 |
182
+ | OpenAI | api.openai.com | GPT-4o, GPT-4.1, o3, o4-mini |
183
+ | Google Gemini | generativelanguage.googleapis.com | Gemini 2.5 Pro, Flash, Flash Lite |
184
+ | DeepSeek | api.deepseek.com | DeepSeek Chat, Reasoner |
185
+ | Groq | api.groq.com | Llama 3.3 70B, DeepSeek R1, Qwen QWQ |
186
+ | Together AI | api.together.xyz | Llama 4 Maverick, DeepSeek R1, Qwen 2.5 |
187
+ | Mistral AI | api.mistral.ai | Mistral Large, Small, Magistral, Devstral |
188
+ | xAI (Grok) | api.x.ai | Grok 3, Grok 3 Fast, Grok 3 Mini |
189
+ | Fireworks AI | api.fireworks.ai | DeepSeek R1, Llama 3.3 70B, Qwen 3 |
190
+
191
+ ### Local & Remote
192
+
193
+ | Provider | Type | Notes |
194
+ |-|-|-|
195
+ | Ollama | Local/Cloud | Connects to `localhost:11434`. No API key needed. 50+ models. |
196
+ | OpenClaw | Per-Agent Gateway | Toggle in agent editor connects to any OpenClaw gateway via the bundled CLI. |
197
+ | Custom | API | Any OpenAI-compatible endpoint. Add via Providers sidebar. |
198
+
199
+ ### OpenClaw
200
+
201
+ [OpenClaw](https://github.com/openclaw/openclaw) is an open-source autonomous AI agent that runs on your own devices. SwarmClaw includes the `openclaw` CLI as a bundled dependency — no separate install needed.
202
+
203
+ To connect an agent to an OpenClaw gateway:
204
+
205
+ 1. Create or edit an agent
206
+ 2. Toggle **OpenClaw Gateway** ON
207
+ 3. Enter the gateway URL (e.g. `http://192.168.1.50:18789` or `https://my-vps:18789`)
208
+ 4. Add a gateway token if authentication is enabled on the remote gateway
209
+ 5. Click **Test & Save** to verify the connection
210
+
211
+ Each agent can point to a **different** OpenClaw gateway — one local, several remote. This is how you manage a **swarm of OpenClaws** from a single dashboard.
212
+
213
+ URLs without a protocol are auto-prefixed with `http://`. For remote gateways with TLS, use `https://` explicitly.
214
+
215
+ ## Chat Connectors
216
+
217
+ Bridge any agent to a chat platform:
218
+
219
+ | Platform | Library | Setup |
220
+ |-|-|-|
221
+ | Discord | discord.js | Bot token + channel IDs |
222
+ | Slack | @slack/bolt | Bot token + app token (Socket Mode) |
223
+ | Telegram | grammy | Bot token from @BotFather |
224
+ | WhatsApp | baileys | QR code pairing (shown in browser) |
225
+
226
+ Connector sessions preserve attachment visibility in chat context:
227
+ - WhatsApp media is decoded and persisted to `/api/uploads/...` when possible
228
+ - Telegram and Slack attachments are downloaded to uploads when possible
229
+ - Discord attachments are captured as media metadata/URLs
230
+
231
+ Agents automatically suppress replies to simple acknowledgments ("ok", "thanks", thumbs-up, etc.) via a `NO_MESSAGE` response — conversations feel natural without a forced reply to every message. This is handled at the connector layer, so agents can return `NO_MESSAGE` as their response content and the platform won't deliver anything to the channel.
232
+
233
+ For proactive outreach, `connector_message_tool` supports text plus optional `imageUrl` / `fileUrl` / `mediaPath` (local file path) payloads. All four platforms (WhatsApp, Discord, Slack, Telegram) support local file sending via `mediaPath` with auto-detected MIME types.
234
+
235
+ ## Agent Tools
236
+
237
+ Agents can use the following tools when enabled:
238
+
239
+ | Tool | Description |
240
+ |-|-|
241
+ | Shell | Execute commands in the session working directory |
242
+ | Process | Control long-running shell commands (`process_tool`) |
243
+ | Files | Read, write, list, and send files |
244
+ | Copy/Move/Delete File | Optional file ops (`copy_file`, `move_file`, `delete_file`) configurable per agent/session (`delete_file` is off by default) |
245
+ | Edit File | Search-and-replace editing (exact match required) |
246
+ | Web Search | Search the web via DuckDuckGo HTML scraping |
247
+ | Web Fetch | Fetch and extract text content from URLs (uses cheerio) |
248
+ | CLI Delegation | Delegate complex tasks to Claude Code, Codex CLI, or OpenCode CLI |
249
+ | Browser | Playwright-powered web browsing via MCP (navigate, click, type, screenshot, PDF) |
250
+ | Memory | Store and retrieve long-term memories with FTS5 + vector search, file references, image attachments, and linked memory graph traversal |
251
+
252
+ ### Platform Tools
253
+
254
+ Agents with platform tools enabled can manage the SwarmClaw instance:
255
+
256
+ | Tool | Description |
257
+ |-|-|
258
+ | Manage Agents | List, create, update, delete agents |
259
+ | Manage Tasks | Create and manage task board items with agent assignment |
260
+ | Manage Schedules | Create cron, interval, or one-time scheduled jobs |
261
+ | Manage Skills | List, create, update reusable skill definitions |
262
+ | Manage Documents | Upload/search/get/delete indexed docs for lightweight RAG workflows |
263
+ | Manage Webhooks | Register external webhook endpoints that trigger agent sessions |
264
+ | Manage Connectors | Manage chat platform bridges |
265
+ | Manage Sessions | Enable `sessions_tool` for list/history/status/send/spawn/stop, plus `context_status` and `context_summarize` for context window management |
266
+ | Manage Secrets | Store and retrieve encrypted reusable secrets |
267
+
268
+ Enable tools per-session or per-agent in the UI. CLI providers (Claude Code, Codex, OpenCode) handle tools natively through their own CLI.
269
+ OpenClaw provider capabilities are also managed remotely in OpenClaw itself, so local Tools/Platform toggles are hidden for OpenClaw agents.
270
+
271
+ ## Starter Skills (URL Import)
272
+
273
+ Import these directly in **Skills → Import via URL**:
274
+
275
+ - `https://swarmclaw.ai/skills/openclaw-swarmclaw-bridge/SKILL.md`
276
+ - `https://swarmclaw.ai/skills/swarmclaw-bootstrap/SKILL.md`
277
+
278
+ ## Cost Tracking
279
+
280
+ Token usage and estimated costs are tracked per message for API-based providers (Anthropic, OpenAI). After each response, a badge in the chat header shows token count and estimated cost.
281
+
282
+ - **API endpoint:** `GET /api/usage` — returns usage summary by session and provider
283
+ - **Data:** Stored in `data/swarmclaw.db` (usage table)
284
+ - Cost estimates use published model pricing (updated manually in `src/lib/server/cost.ts`)
285
+
286
+ ## Background Daemon
287
+
288
+ The daemon auto-processes queued tasks from the scheduler on a 30-second interval. It also runs recurring health checks that detect stale heartbeat sessions and can send proactive WhatsApp alerts when issues are detected. Toggle the daemon from the sidebar indicator or via API.
289
+
290
+ - **API:** `GET /api/daemon` (status), `POST /api/daemon` with `{"action": "start"}` or `{"action": "stop"}`
291
+ - Auto-starts on first authenticated runtime traffic (`/api/auth` or `/api/daemon`) unless `SWARMCLAW_DAEMON_AUTOSTART=0`
292
+
293
+ ## Main Agent Loop
294
+
295
+ For autonomous long-running missions, enable the **Main Loop** on a session. This lets an agent pursue a goal continuously with heartbeat-driven progress checks and automatic followups.
296
+
297
+ - **Heartbeat prompts:** `SWARM_MAIN_MISSION_TICK` triggers on each heartbeat, giving the agent its goal, status, and pending events
298
+ - **Auto-followup:** When an agent returns `[MAIN_LOOP_META] {"follow_up":true}`, the loop schedules another tick after `delay_sec`
299
+ - **Mission state:** Tracks `goal`, `status` (idle/progress/blocked/ok), `summary`, `nextAction`, `autonomyMode` (assist/autonomous), and pending events
300
+ - **Autonomy modes:**
301
+ - `autonomous`: Agent executes safe actions without confirmation, only asks when blocked by permissions/credentials
302
+ - `assist`: Agent asks before irreversible external actions (sending messages, purchases, account mutations)
303
+ - **API:** `POST /api/sessions/[id]/main-loop` with `{"tick":true}` to trigger a mission tick
304
+ - **CLI:** `swarmclaw sessions main-loop --session-id <id>` (via daemon schedule)
305
+
306
+ Use this for background agents that should "keep working" on a goal until blocked or complete.
307
+
308
+ ## Loop Modes
309
+
310
+ Configure loop behavior in **Settings → Runtime & Loop Controls**:
311
+
312
+ - **Bounded**: fixed max steps for agent and orchestrator loops (default behavior)
313
+ - **Ongoing**: loops keep iterating until they hit your safety cap and optional runtime limit
314
+
315
+ You can also tune shell timeout, Claude Code delegation timeout, and CLI provider process timeout from the same settings panel.
316
+
317
+ ## Capability Policy
318
+
319
+ Configure this in **Settings → Capability Policy** to centrally govern tool access:
320
+
321
+ - **Mode:** `permissive`, `balanced`, or `strict`
322
+ - **Blocked categories:** e.g. `execution`, `filesystem`, `platform`, `outbound`
323
+ - **Blocked tools:** specific tool families or concrete tool names
324
+ - **Allowed tools:** explicit overrides when running stricter modes
325
+
326
+ Policy is enforced in both session tool construction and direct forced tool invocations, so auto-routing and explicit tool requests use the same guardrails.
327
+
328
+ ## CLI Troubleshooting
329
+
330
+ - **Claude delegate returns no output or fails quickly:** verify Claude auth on the host with:
331
+ - `claude auth status`
332
+ - If not logged in: `claude auth login` (or `claude setup-token`)
333
+ - **Claude delegate times out:** increase **Claude Code Timeout (sec)** in Settings.
334
+ - **Codex fails outside a git repo:** SwarmClaw now uses `--skip-git-repo-check`, but if login is missing run:
335
+ - `codex login`
336
+ - `codex login status`
337
+ - **CLI provider errors are now surfaced in chat:** non-zero exits and streamed error events are emitted as chat errors instead of failing silently.
338
+
339
+ ## Voice & Heartbeat
340
+
341
+ Configure these in **Settings**:
342
+
343
+ - **Voice** — set `ElevenLabs API Key`, `ElevenLabs Voice ID`, and `Speech Recognition Language`
344
+ - **Heartbeat** — set `Heartbeat Interval (Seconds)` and `Heartbeat Prompt` for ongoing session pings
345
+ - **Global heartbeat safety** — use `Stop All Session Heartbeats` to disable heartbeat across all sessions and cancel in-flight heartbeat runs.
346
+
347
+ Heartbeat pings are internal checks for ongoing sessions. If there's no new status, the assistant returns `HEARTBEAT_OK`; otherwise it returns a concise progress update and next step. In chat UI, heartbeat entries render as compact expandable cards and consecutive heartbeat streaks are collapsed to the latest item.
348
+ The daemon health monitor also auto-disables heartbeat on sessions that remain stale for an extended period.
349
+
350
+ ## Embeddings & Hybrid Memory Search
351
+
352
+ Enable semantic search for agent memory by configuring an embedding provider in Settings:
353
+
354
+ - **Local (Free)** — runs `all-MiniLM-L6-v2` directly in Node.js via HuggingFace Transformers. No API key, no cost, works offline. Model downloads once (~23MB).
355
+ - **OpenAI** — uses `text-embedding-3-small` (requires API key)
356
+ - **Ollama** — uses local models like `nomic-embed-text`
357
+
358
+ When enabled, new memories get vector embeddings. Search uses both FTS5 keyword matching and cosine similarity, merging results for better recall.
359
+
360
+ ## Model Failover
361
+
362
+ Agents and sessions can have **fallback credentials**. If the primary API key gets a 401, 429, or 500 error, SwarmClaw automatically retries with the next credential. Configure fallback keys in the agent builder UI.
363
+
364
+ ## Plugins
365
+
366
+ Extend agent behavior with JS plugins. Three ways to install:
367
+
368
+ 1. **Marketplace** — Browse and install approved plugins from Settings → Plugins → Marketplace
369
+ 2. **URL** — Install from any HTTPS URL via Settings → Plugins → Install from URL
370
+ 3. **Manual** — Drop `.js` files into `data/plugins/`
371
+
372
+ ### Plugin Format (SwarmClaw)
373
+
374
+ ```js
375
+ module.exports = {
376
+ name: 'my-plugin',
377
+ description: 'What it does',
378
+ hooks: {
379
+ beforeAgentStart: async ({ session, message }) => { /* ... */ },
380
+ afterAgentComplete: async ({ session, response }) => { /* ... */ },
381
+ beforeToolExec: async ({ toolName, input }) => { /* ... */ },
382
+ afterToolExec: async ({ toolName, input, output }) => { /* ... */ },
383
+ onMessage: async ({ session, message }) => { /* ... */ },
384
+ },
385
+ }
386
+ ```
387
+
388
+ ### OpenClaw Plugin Compatibility
389
+
390
+ SwarmClaw natively supports the OpenClaw plugin format. Drop an OpenClaw plugin into `data/plugins/` and it works automatically — lifecycle hooks are mapped:
391
+
392
+ | OpenClaw Hook | SwarmClaw Hook |
393
+ |-|-|
394
+ | `onAgentStart` | `beforeAgentStart` |
395
+ | `onAgentComplete` | `afterAgentComplete` |
396
+ | `onToolCall` | `beforeToolExec` |
397
+ | `onToolResult` | `afterToolExec` |
398
+ | `onMessage` | `onMessage` |
399
+
400
+ Plugin API: `GET /api/plugins`, `POST /api/plugins`, `GET /api/plugins/marketplace`, `POST /api/plugins/install`.
401
+
402
+ ## Deploy to a VPS
403
+
404
+ ### Direct (pm2 + Caddy)
405
+
406
+ ```bash
407
+ # On your VPS
408
+ git clone https://github.com/swarmclawai/swarmclaw.git
409
+ cd swarmclaw
410
+ npm install
411
+ npm run build
412
+
413
+ # Run with pm2
414
+ sudo npm install -g pm2
415
+ pm2 start npm --name swarmclaw -- start
416
+ pm2 save && pm2 startup
417
+ ```
418
+
419
+ Point a reverse proxy (Caddy or nginx) at `localhost:3456` for TLS. See the [full deployment guide](https://swarmclaw.ai/docs/deployment).
420
+
421
+ ### Docker
422
+
423
+ ```bash
424
+ git clone https://github.com/swarmclawai/swarmclaw.git
425
+ cd swarmclaw
426
+ docker compose up -d
427
+ ```
428
+
429
+ Data is persisted in `data/` and `.env.local` via volume mounts. Updates: `git pull && docker compose up -d --build`.
430
+
431
+ For prebuilt images (recommended for non-technical users after releases):
432
+
433
+ ```bash
434
+ docker pull ghcr.io/swarmclawai/swarmclaw:latest
435
+ docker run -d \
436
+ --name swarmclaw \
437
+ -p 3456:3456 \
438
+ -v "$(pwd)/data:/app/data" \
439
+ -v "$(pwd)/.env.local:/app/.env.local" \
440
+ ghcr.io/swarmclawai/swarmclaw:latest
441
+ ```
442
+
443
+ ### Updating
444
+
445
+ SwarmClaw has a built-in update checker — a banner appears in the sidebar when new commits are available, with a one-click update button. Your data in `data/` and `.env.local` is never touched by updates.
446
+
447
+ For terminal users, run:
448
+
449
+ ```bash
450
+ npm run update:easy
451
+ ```
452
+
453
+ This command updates to the latest stable release tag when available (fallback: `origin/main`), installs dependencies when needed, and runs a production build check before restart.
454
+
455
+ ## Development
456
+
457
+ ```bash
458
+ npm run dev # Dev server on 0.0.0.0:3456
459
+ npm run dev:webpack # Fallback to webpack dev server (if Turbopack crashes)
460
+ npm run dev:clean # Clear .next cache then restart dev server
461
+ npm run build # Production build
462
+ npm run build:ci # CI build (skips ESLint; lint baseline runs separately)
463
+ npm run start # Start production server
464
+ npm run start:standalone # Start standalone server after build
465
+ npm run lint # ESLint
466
+ npm run lint:baseline # Fail only on net-new lint issues vs .eslint-baseline.json
467
+ npm run lint:baseline:update # Refresh lint baseline intentionally
468
+ ```
469
+
470
+ The dev server binds to `0.0.0.0` so you can access it from your phone on the same network.
471
+
472
+ ### Turbopack Panic Recovery
473
+
474
+ If you see a Turbopack panic like `Failed to lookup task type` or missing `.sst/.meta` files:
475
+
476
+ ```bash
477
+ rm -rf .next
478
+ npm run dev:clean
479
+ ```
480
+
481
+ If it still reproduces, use webpack mode:
482
+
483
+ ```bash
484
+ npm run dev:webpack
485
+ ```
486
+
487
+ ### First-Run Helpers
488
+
489
+ ```bash
490
+ npm run setup:easy # setup only (does not start server)
491
+ npm run quickstart # setup + start dev server
492
+ npm run quickstart:prod # setup + build + start production server
493
+ npm run update:easy # safe update helper for local installs
494
+ ```
495
+
496
+ ### Release Process (Maintainers)
497
+
498
+ SwarmClaw uses tag-based releases (`vX.Y.Z`) as the stable channel.
499
+
500
+ ```bash
501
+ # example patch release
502
+ npm version patch
503
+ git push origin main --follow-tags
504
+ ```
505
+
506
+ On `v*` tags, GitHub Actions will:
507
+ 1. Run CI checks
508
+ 2. Create a GitHub Release
509
+ 3. Build and publish Docker images to `ghcr.io/swarmclawai/swarmclaw` (`:vX.Y.Z`, `:latest`, `:sha-*`)
510
+
511
+ ## CLI
512
+
513
+ SwarmClaw ships a built-in CLI for core operational workflows:
514
+
515
+ ```bash
516
+ # show command help
517
+ npm run cli -- --help
518
+
519
+ # or run the executable directly
520
+ node ./bin/swarmclaw.js --help
521
+ ```
522
+
523
+ ### Usage
524
+
525
+ ```bash
526
+ swarmclaw [global-options] <group> <command> [command-options]
527
+ ```
528
+
529
+ ### Global Options
530
+
531
+ | Flag | Description |
532
+ |-|-|
533
+ | `-u, --url <url>` | SwarmClaw base URL (default: `http://localhost:3456`) |
534
+ | `-k, --key <key>` | Access key (or set `SWARMCLAW_ACCESS_KEY`) |
535
+ | `--raw` | Print compact JSON output |
536
+
537
+ ### Command Groups
538
+
539
+ Run `swarmclaw --help` to list all groups and commands (the list evolves as APIs are added).
540
+ Notable setup/operations groups include:
541
+
542
+ | Group | Purpose |
543
+ |-|-|
544
+ | `setup` | Setup helpers like provider checks and `doctor` diagnostics |
545
+ | `version` | Version status and update helpers |
546
+ | `sessions` | Session lifecycle, chat, browser/devserver controls, mailbox |
547
+ | `memory` | Memory CRUD and maintenance utilities |
548
+
549
+ ### Examples
550
+
551
+ ```bash
552
+ # list agents
553
+ swarmclaw agents list
554
+
555
+ # get agent details
556
+ swarmclaw agents get <agentId>
557
+
558
+ # create a task
559
+ swarmclaw tasks create --title "Fix flaky CI test" --description "Stabilize retry logic" --agent-id <agentId>
560
+
561
+ # run setup diagnostics
562
+ swarmclaw setup doctor
563
+
564
+ # complete setup from CLI (example: OpenAI)
565
+ swarmclaw setup init --provider openai --api-key "$OPENAI_API_KEY"
566
+
567
+ # run memory maintenance analysis
568
+ swarmclaw memory maintenance
569
+ ```
570
+
571
+ ## Credits
572
+
573
+ - Inspired by [OpenClaw](https://github.com/openclaw)
574
+
575
+ ## License
576
+
577
+ MIT