claude-flow 3.0.0-alpha.5 → 3.0.0-alpha.63

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 (429) hide show
  1. package/README.md +1573 -41
  2. package/bin/cli.js +140 -26
  3. package/bin/mcp-server.js +188 -0
  4. package/dist/src/commands/agent.d.ts +8 -0
  5. package/dist/src/commands/agent.d.ts.map +1 -0
  6. package/dist/src/commands/agent.js +819 -0
  7. package/dist/src/commands/agent.js.map +1 -0
  8. package/dist/src/commands/analyze.d.ts +19 -0
  9. package/dist/src/commands/analyze.d.ts.map +1 -0
  10. package/dist/src/commands/analyze.js +1823 -0
  11. package/dist/src/commands/analyze.js.map +1 -0
  12. package/dist/src/commands/claims.d.ts +10 -0
  13. package/dist/src/commands/claims.d.ts.map +1 -0
  14. package/dist/src/commands/claims.js +288 -0
  15. package/dist/src/commands/claims.js.map +1 -0
  16. package/dist/src/commands/completions.d.ts +10 -0
  17. package/dist/src/commands/completions.d.ts.map +1 -0
  18. package/dist/src/commands/completions.js +539 -0
  19. package/dist/src/commands/completions.js.map +1 -0
  20. package/dist/src/commands/config.d.ts +8 -0
  21. package/dist/src/commands/config.d.ts.map +1 -0
  22. package/dist/src/commands/config.js +406 -0
  23. package/dist/src/commands/config.js.map +1 -0
  24. package/dist/src/commands/daemon.d.ts +8 -0
  25. package/dist/src/commands/daemon.d.ts.map +1 -0
  26. package/dist/src/commands/daemon.js +593 -0
  27. package/dist/src/commands/daemon.js.map +1 -0
  28. package/dist/src/commands/deployment.d.ts +10 -0
  29. package/dist/src/commands/deployment.d.ts.map +1 -0
  30. package/dist/src/commands/deployment.js +289 -0
  31. package/dist/src/commands/deployment.js.map +1 -0
  32. package/dist/src/commands/doctor.d.ts +10 -0
  33. package/dist/src/commands/doctor.d.ts.map +1 -0
  34. package/dist/src/commands/doctor.js +448 -0
  35. package/dist/src/commands/doctor.js.map +1 -0
  36. package/dist/src/commands/embeddings.d.ts +18 -0
  37. package/dist/src/commands/embeddings.d.ts.map +1 -0
  38. package/dist/src/commands/embeddings.js +831 -0
  39. package/dist/src/commands/embeddings.js.map +1 -0
  40. package/dist/src/commands/hive-mind.d.ts +8 -0
  41. package/dist/src/commands/hive-mind.d.ts.map +1 -0
  42. package/dist/src/commands/hive-mind.js +844 -0
  43. package/dist/src/commands/hive-mind.js.map +1 -0
  44. package/dist/src/commands/hooks.d.ts +8 -0
  45. package/dist/src/commands/hooks.d.ts.map +1 -0
  46. package/dist/src/commands/hooks.js +2892 -0
  47. package/dist/src/commands/hooks.js.map +1 -0
  48. package/dist/src/commands/index.d.ts +89 -0
  49. package/dist/src/commands/index.d.ts.map +1 -0
  50. package/dist/src/commands/index.js +258 -0
  51. package/dist/src/commands/index.js.map +1 -0
  52. package/dist/src/commands/init.d.ts +8 -0
  53. package/dist/src/commands/init.d.ts.map +1 -0
  54. package/dist/src/commands/init.js +603 -0
  55. package/dist/src/commands/init.js.map +1 -0
  56. package/dist/src/commands/issues.d.ts +21 -0
  57. package/dist/src/commands/issues.d.ts.map +1 -0
  58. package/dist/src/commands/issues.js +567 -0
  59. package/dist/src/commands/issues.js.map +1 -0
  60. package/dist/src/commands/mcp.d.ts +11 -0
  61. package/dist/src/commands/mcp.d.ts.map +1 -0
  62. package/dist/src/commands/mcp.js +662 -0
  63. package/dist/src/commands/mcp.js.map +1 -0
  64. package/dist/src/commands/memory.d.ts +8 -0
  65. package/dist/src/commands/memory.d.ts.map +1 -0
  66. package/dist/src/commands/memory.js +1200 -0
  67. package/dist/src/commands/memory.js.map +1 -0
  68. package/dist/src/commands/migrate.d.ts +8 -0
  69. package/dist/src/commands/migrate.d.ts.map +1 -0
  70. package/dist/src/commands/migrate.js +398 -0
  71. package/dist/src/commands/migrate.js.map +1 -0
  72. package/dist/src/commands/neural.d.ts +10 -0
  73. package/dist/src/commands/neural.d.ts.map +1 -0
  74. package/dist/src/commands/neural.js +224 -0
  75. package/dist/src/commands/neural.js.map +1 -0
  76. package/dist/src/commands/performance.d.ts +10 -0
  77. package/dist/src/commands/performance.d.ts.map +1 -0
  78. package/dist/src/commands/performance.js +262 -0
  79. package/dist/src/commands/performance.js.map +1 -0
  80. package/dist/src/commands/plugins.d.ts +11 -0
  81. package/dist/src/commands/plugins.d.ts.map +1 -0
  82. package/dist/src/commands/plugins.js +630 -0
  83. package/dist/src/commands/plugins.js.map +1 -0
  84. package/dist/src/commands/process.d.ts +10 -0
  85. package/dist/src/commands/process.d.ts.map +1 -0
  86. package/dist/src/commands/process.js +641 -0
  87. package/dist/src/commands/process.js.map +1 -0
  88. package/dist/src/commands/progress.d.ts +11 -0
  89. package/dist/src/commands/progress.d.ts.map +1 -0
  90. package/dist/src/commands/progress.js +259 -0
  91. package/dist/src/commands/progress.js.map +1 -0
  92. package/dist/src/commands/providers.d.ts +10 -0
  93. package/dist/src/commands/providers.d.ts.map +1 -0
  94. package/dist/src/commands/providers.js +232 -0
  95. package/dist/src/commands/providers.js.map +1 -0
  96. package/dist/src/commands/route.d.ts +16 -0
  97. package/dist/src/commands/route.d.ts.map +1 -0
  98. package/dist/src/commands/route.js +813 -0
  99. package/dist/src/commands/route.js.map +1 -0
  100. package/dist/src/commands/security.d.ts +10 -0
  101. package/dist/src/commands/security.d.ts.map +1 -0
  102. package/dist/src/commands/security.js +261 -0
  103. package/dist/src/commands/security.js.map +1 -0
  104. package/dist/src/commands/session.d.ts +8 -0
  105. package/dist/src/commands/session.d.ts.map +1 -0
  106. package/dist/src/commands/session.js +750 -0
  107. package/dist/src/commands/session.js.map +1 -0
  108. package/dist/src/commands/start.d.ts +8 -0
  109. package/dist/src/commands/start.d.ts.map +1 -0
  110. package/dist/src/commands/start.js +418 -0
  111. package/dist/src/commands/start.js.map +1 -0
  112. package/dist/src/commands/status.d.ts +8 -0
  113. package/dist/src/commands/status.d.ts.map +1 -0
  114. package/dist/src/commands/status.js +584 -0
  115. package/dist/src/commands/status.js.map +1 -0
  116. package/dist/src/commands/swarm.d.ts +8 -0
  117. package/dist/src/commands/swarm.d.ts.map +1 -0
  118. package/dist/src/commands/swarm.js +726 -0
  119. package/dist/src/commands/swarm.js.map +1 -0
  120. package/dist/src/commands/task.d.ts +8 -0
  121. package/dist/src/commands/task.d.ts.map +1 -0
  122. package/dist/src/commands/task.js +671 -0
  123. package/dist/src/commands/task.js.map +1 -0
  124. package/dist/src/commands/transfer-store.d.ts +13 -0
  125. package/dist/src/commands/transfer-store.d.ts.map +1 -0
  126. package/dist/src/commands/transfer-store.js +428 -0
  127. package/dist/src/commands/transfer-store.js.map +1 -0
  128. package/dist/src/commands/workflow.d.ts +8 -0
  129. package/dist/src/commands/workflow.d.ts.map +1 -0
  130. package/dist/src/commands/workflow.js +617 -0
  131. package/dist/src/commands/workflow.js.map +1 -0
  132. package/dist/src/config-adapter.d.ts +15 -0
  133. package/dist/src/config-adapter.d.ts.map +1 -0
  134. package/dist/src/config-adapter.js +185 -0
  135. package/dist/src/config-adapter.js.map +1 -0
  136. package/dist/src/index.d.ts +57 -0
  137. package/dist/src/index.d.ts.map +1 -0
  138. package/dist/src/index.js +388 -0
  139. package/dist/src/index.js.map +1 -0
  140. package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
  141. package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
  142. package/dist/src/infrastructure/in-memory-repositories.js +264 -0
  143. package/dist/src/infrastructure/in-memory-repositories.js.map +1 -0
  144. package/dist/src/init/claudemd-generator.d.ts +15 -0
  145. package/dist/src/init/claudemd-generator.d.ts.map +1 -0
  146. package/dist/src/init/claudemd-generator.js +674 -0
  147. package/dist/src/init/claudemd-generator.js.map +1 -0
  148. package/dist/src/init/executor.d.ts +11 -0
  149. package/dist/src/init/executor.d.ts.map +1 -0
  150. package/dist/src/init/executor.js +763 -0
  151. package/dist/src/init/executor.js.map +1 -0
  152. package/dist/src/init/helpers-generator.d.ts +42 -0
  153. package/dist/src/init/helpers-generator.d.ts.map +1 -0
  154. package/dist/src/init/helpers-generator.js +613 -0
  155. package/dist/src/init/helpers-generator.js.map +1 -0
  156. package/dist/src/init/index.d.ts +12 -0
  157. package/dist/src/init/index.d.ts.map +1 -0
  158. package/dist/src/init/index.js +15 -0
  159. package/dist/src/init/index.js.map +1 -0
  160. package/dist/src/init/mcp-generator.d.ts +27 -0
  161. package/dist/src/init/mcp-generator.d.ts.map +1 -0
  162. package/dist/src/init/mcp-generator.js +100 -0
  163. package/dist/src/init/mcp-generator.js.map +1 -0
  164. package/dist/src/init/settings-generator.d.ts +14 -0
  165. package/dist/src/init/settings-generator.d.ts.map +1 -0
  166. package/dist/src/init/settings-generator.js +311 -0
  167. package/dist/src/init/settings-generator.js.map +1 -0
  168. package/dist/src/init/statusline-generator.d.ts +20 -0
  169. package/dist/src/init/statusline-generator.d.ts.map +1 -0
  170. package/dist/src/init/statusline-generator.js +369 -0
  171. package/dist/src/init/statusline-generator.js.map +1 -0
  172. package/dist/src/init/types.d.ts +246 -0
  173. package/dist/src/init/types.d.ts.map +1 -0
  174. package/dist/src/init/types.js +216 -0
  175. package/dist/src/init/types.js.map +1 -0
  176. package/dist/src/mcp-client.d.ts +92 -0
  177. package/dist/src/mcp-client.d.ts.map +1 -0
  178. package/dist/src/mcp-client.js +207 -0
  179. package/dist/src/mcp-client.js.map +1 -0
  180. package/dist/src/mcp-server.d.ts +158 -0
  181. package/dist/src/mcp-server.d.ts.map +1 -0
  182. package/dist/src/mcp-server.js +584 -0
  183. package/dist/src/mcp-server.js.map +1 -0
  184. package/dist/src/mcp-tools/agent-tools.d.ts +8 -0
  185. package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -0
  186. package/dist/src/mcp-tools/agent-tools.js +426 -0
  187. package/dist/src/mcp-tools/agent-tools.js.map +1 -0
  188. package/dist/src/mcp-tools/analyze-tools.d.ts +38 -0
  189. package/dist/src/mcp-tools/analyze-tools.d.ts.map +1 -0
  190. package/dist/src/mcp-tools/analyze-tools.js +317 -0
  191. package/dist/src/mcp-tools/analyze-tools.js.map +1 -0
  192. package/dist/src/mcp-tools/config-tools.d.ts +8 -0
  193. package/dist/src/mcp-tools/config-tools.d.ts.map +1 -0
  194. package/dist/src/mcp-tools/config-tools.js +333 -0
  195. package/dist/src/mcp-tools/config-tools.js.map +1 -0
  196. package/dist/src/mcp-tools/hive-mind-tools.d.ts +8 -0
  197. package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -0
  198. package/dist/src/mcp-tools/hive-mind-tools.js +447 -0
  199. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -0
  200. package/dist/src/mcp-tools/hooks-tools.d.ts +41 -0
  201. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -0
  202. package/dist/src/mcp-tools/hooks-tools.js +1836 -0
  203. package/dist/src/mcp-tools/hooks-tools.js.map +1 -0
  204. package/dist/src/mcp-tools/index.d.ts +20 -0
  205. package/dist/src/mcp-tools/index.d.ts.map +1 -0
  206. package/dist/src/mcp-tools/index.js +19 -0
  207. package/dist/src/mcp-tools/index.js.map +1 -0
  208. package/dist/src/mcp-tools/memory-tools.d.ts +8 -0
  209. package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -0
  210. package/dist/src/mcp-tools/memory-tools.js +235 -0
  211. package/dist/src/mcp-tools/memory-tools.js.map +1 -0
  212. package/dist/src/mcp-tools/progress-tools.d.ts +14 -0
  213. package/dist/src/mcp-tools/progress-tools.d.ts.map +1 -0
  214. package/dist/src/mcp-tools/progress-tools.js +343 -0
  215. package/dist/src/mcp-tools/progress-tools.js.map +1 -0
  216. package/dist/src/mcp-tools/session-tools.d.ts +8 -0
  217. package/dist/src/mcp-tools/session-tools.d.ts.map +1 -0
  218. package/dist/src/mcp-tools/session-tools.js +315 -0
  219. package/dist/src/mcp-tools/session-tools.js.map +1 -0
  220. package/dist/src/mcp-tools/swarm-tools.d.ts +8 -0
  221. package/dist/src/mcp-tools/swarm-tools.d.ts.map +1 -0
  222. package/dist/src/mcp-tools/swarm-tools.js +102 -0
  223. package/dist/src/mcp-tools/swarm-tools.js.map +1 -0
  224. package/dist/src/mcp-tools/task-tools.d.ts +8 -0
  225. package/dist/src/mcp-tools/task-tools.d.ts.map +1 -0
  226. package/dist/src/mcp-tools/task-tools.js +302 -0
  227. package/dist/src/mcp-tools/task-tools.js.map +1 -0
  228. package/dist/src/mcp-tools/transfer-tools.d.ts +14 -0
  229. package/dist/src/mcp-tools/transfer-tools.d.ts.map +1 -0
  230. package/dist/src/mcp-tools/transfer-tools.js +396 -0
  231. package/dist/src/mcp-tools/transfer-tools.js.map +1 -0
  232. package/dist/src/mcp-tools/types.d.ts +31 -0
  233. package/dist/src/mcp-tools/types.d.ts.map +1 -0
  234. package/dist/src/mcp-tools/types.js +7 -0
  235. package/dist/src/mcp-tools/types.js.map +1 -0
  236. package/dist/src/mcp-tools/workflow-tools.d.ts +8 -0
  237. package/dist/src/mcp-tools/workflow-tools.d.ts.map +1 -0
  238. package/dist/src/mcp-tools/workflow-tools.js +481 -0
  239. package/dist/src/mcp-tools/workflow-tools.js.map +1 -0
  240. package/dist/src/memory/memory-initializer.d.ts +229 -0
  241. package/dist/src/memory/memory-initializer.d.ts.map +1 -0
  242. package/dist/src/memory/memory-initializer.js +1248 -0
  243. package/dist/src/memory/memory-initializer.js.map +1 -0
  244. package/dist/src/output.d.ts +133 -0
  245. package/dist/src/output.d.ts.map +1 -0
  246. package/dist/src/output.js +513 -0
  247. package/dist/src/output.js.map +1 -0
  248. package/dist/src/parser.d.ts +41 -0
  249. package/dist/src/parser.d.ts.map +1 -0
  250. package/dist/src/parser.js +353 -0
  251. package/dist/src/parser.js.map +1 -0
  252. package/dist/src/plugins/store/discovery.d.ts +73 -0
  253. package/dist/src/plugins/store/discovery.d.ts.map +1 -0
  254. package/dist/src/plugins/store/discovery.js +568 -0
  255. package/dist/src/plugins/store/discovery.js.map +1 -0
  256. package/dist/src/plugins/store/index.d.ts +76 -0
  257. package/dist/src/plugins/store/index.d.ts.map +1 -0
  258. package/dist/src/plugins/store/index.js +141 -0
  259. package/dist/src/plugins/store/index.js.map +1 -0
  260. package/dist/src/plugins/store/search.d.ts +46 -0
  261. package/dist/src/plugins/store/search.d.ts.map +1 -0
  262. package/dist/src/plugins/store/search.js +230 -0
  263. package/dist/src/plugins/store/search.js.map +1 -0
  264. package/dist/src/plugins/store/types.d.ts +274 -0
  265. package/dist/src/plugins/store/types.d.ts.map +1 -0
  266. package/dist/src/plugins/store/types.js +7 -0
  267. package/dist/src/plugins/store/types.js.map +1 -0
  268. package/dist/src/plugins/tests/demo-plugin-store.d.ts +7 -0
  269. package/dist/src/plugins/tests/demo-plugin-store.d.ts.map +1 -0
  270. package/dist/src/plugins/tests/demo-plugin-store.js +126 -0
  271. package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -0
  272. package/dist/src/plugins/tests/standalone-test.d.ts +12 -0
  273. package/dist/src/plugins/tests/standalone-test.d.ts.map +1 -0
  274. package/dist/src/plugins/tests/standalone-test.js +188 -0
  275. package/dist/src/plugins/tests/standalone-test.js.map +1 -0
  276. package/dist/src/plugins/tests/test-plugin-store.d.ts +7 -0
  277. package/dist/src/plugins/tests/test-plugin-store.d.ts.map +1 -0
  278. package/dist/src/plugins/tests/test-plugin-store.js +206 -0
  279. package/dist/src/plugins/tests/test-plugin-store.js.map +1 -0
  280. package/dist/src/prompt.d.ts +44 -0
  281. package/dist/src/prompt.d.ts.map +1 -0
  282. package/dist/src/prompt.js +501 -0
  283. package/dist/src/prompt.js.map +1 -0
  284. package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
  285. package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
  286. package/dist/src/ruvector/ast-analyzer.js +277 -0
  287. package/dist/src/ruvector/ast-analyzer.js.map +1 -0
  288. package/dist/src/ruvector/coverage-router.d.ts +160 -0
  289. package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
  290. package/dist/src/ruvector/coverage-router.js +529 -0
  291. package/dist/src/ruvector/coverage-router.js.map +1 -0
  292. package/dist/src/ruvector/coverage-tools.d.ts +33 -0
  293. package/dist/src/ruvector/coverage-tools.d.ts.map +1 -0
  294. package/dist/src/ruvector/coverage-tools.js +157 -0
  295. package/dist/src/ruvector/coverage-tools.js.map +1 -0
  296. package/dist/src/ruvector/diff-classifier.d.ts +175 -0
  297. package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
  298. package/dist/src/ruvector/diff-classifier.js +698 -0
  299. package/dist/src/ruvector/diff-classifier.js.map +1 -0
  300. package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
  301. package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
  302. package/dist/src/ruvector/graph-analyzer.js +929 -0
  303. package/dist/src/ruvector/graph-analyzer.js.map +1 -0
  304. package/dist/src/ruvector/index.d.ts +27 -0
  305. package/dist/src/ruvector/index.d.ts.map +1 -0
  306. package/dist/src/ruvector/index.js +53 -0
  307. package/dist/src/ruvector/index.js.map +1 -0
  308. package/dist/src/ruvector/q-learning-router.d.ts +211 -0
  309. package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
  310. package/dist/src/ruvector/q-learning-router.js +681 -0
  311. package/dist/src/ruvector/q-learning-router.js.map +1 -0
  312. package/dist/src/ruvector/vector-db.d.ts +69 -0
  313. package/dist/src/ruvector/vector-db.d.ts.map +1 -0
  314. package/dist/src/ruvector/vector-db.js +243 -0
  315. package/dist/src/ruvector/vector-db.js.map +1 -0
  316. package/dist/src/services/claim-service.d.ts +204 -0
  317. package/dist/src/services/claim-service.d.ts.map +1 -0
  318. package/dist/src/services/claim-service.js +818 -0
  319. package/dist/src/services/claim-service.js.map +1 -0
  320. package/dist/src/services/container-worker-pool.d.ts +197 -0
  321. package/dist/src/services/container-worker-pool.d.ts.map +1 -0
  322. package/dist/src/services/container-worker-pool.js +581 -0
  323. package/dist/src/services/container-worker-pool.js.map +1 -0
  324. package/dist/src/services/headless-worker-executor.d.ts +304 -0
  325. package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
  326. package/dist/src/services/headless-worker-executor.js +997 -0
  327. package/dist/src/services/headless-worker-executor.js.map +1 -0
  328. package/dist/src/services/index.d.ts +13 -0
  329. package/dist/src/services/index.d.ts.map +1 -0
  330. package/dist/src/services/index.js +11 -0
  331. package/dist/src/services/index.js.map +1 -0
  332. package/dist/src/services/worker-daemon.d.ts +203 -0
  333. package/dist/src/services/worker-daemon.d.ts.map +1 -0
  334. package/dist/src/services/worker-daemon.js +745 -0
  335. package/dist/src/services/worker-daemon.js.map +1 -0
  336. package/dist/src/services/worker-queue.d.ts +194 -0
  337. package/dist/src/services/worker-queue.d.ts.map +1 -0
  338. package/dist/src/services/worker-queue.js +511 -0
  339. package/dist/src/services/worker-queue.js.map +1 -0
  340. package/dist/src/suggest.d.ts +53 -0
  341. package/dist/src/suggest.d.ts.map +1 -0
  342. package/dist/src/suggest.js +200 -0
  343. package/dist/src/suggest.js.map +1 -0
  344. package/dist/src/transfer/anonymization/index.d.ts +25 -0
  345. package/dist/src/transfer/anonymization/index.d.ts.map +1 -0
  346. package/dist/src/transfer/anonymization/index.js +175 -0
  347. package/dist/src/transfer/anonymization/index.js.map +1 -0
  348. package/dist/src/transfer/deploy-seraphine.d.ts +13 -0
  349. package/dist/src/transfer/deploy-seraphine.d.ts.map +1 -0
  350. package/dist/src/transfer/deploy-seraphine.js +205 -0
  351. package/dist/src/transfer/deploy-seraphine.js.map +1 -0
  352. package/dist/src/transfer/export.d.ts +25 -0
  353. package/dist/src/transfer/export.d.ts.map +1 -0
  354. package/dist/src/transfer/export.js +113 -0
  355. package/dist/src/transfer/export.js.map +1 -0
  356. package/dist/src/transfer/index.d.ts +12 -0
  357. package/dist/src/transfer/index.d.ts.map +1 -0
  358. package/dist/src/transfer/index.js +31 -0
  359. package/dist/src/transfer/index.js.map +1 -0
  360. package/dist/src/transfer/ipfs/client.d.ts +31 -0
  361. package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
  362. package/dist/src/transfer/ipfs/client.js +74 -0
  363. package/dist/src/transfer/ipfs/client.js.map +1 -0
  364. package/dist/src/transfer/ipfs/upload.d.ts +95 -0
  365. package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
  366. package/dist/src/transfer/ipfs/upload.js +410 -0
  367. package/dist/src/transfer/ipfs/upload.js.map +1 -0
  368. package/dist/src/transfer/models/seraphine.d.ts +72 -0
  369. package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
  370. package/dist/src/transfer/models/seraphine.js +373 -0
  371. package/dist/src/transfer/models/seraphine.js.map +1 -0
  372. package/dist/src/transfer/serialization/cfp.d.ts +49 -0
  373. package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
  374. package/dist/src/transfer/serialization/cfp.js +180 -0
  375. package/dist/src/transfer/serialization/cfp.js.map +1 -0
  376. package/dist/src/transfer/store/discovery.d.ts +84 -0
  377. package/dist/src/transfer/store/discovery.d.ts.map +1 -0
  378. package/dist/src/transfer/store/discovery.js +275 -0
  379. package/dist/src/transfer/store/discovery.js.map +1 -0
  380. package/dist/src/transfer/store/download.d.ts +70 -0
  381. package/dist/src/transfer/store/download.d.ts.map +1 -0
  382. package/dist/src/transfer/store/download.js +295 -0
  383. package/dist/src/transfer/store/download.js.map +1 -0
  384. package/dist/src/transfer/store/index.d.ts +84 -0
  385. package/dist/src/transfer/store/index.d.ts.map +1 -0
  386. package/dist/src/transfer/store/index.js +153 -0
  387. package/dist/src/transfer/store/index.js.map +1 -0
  388. package/dist/src/transfer/store/publish.d.ts +76 -0
  389. package/dist/src/transfer/store/publish.d.ts.map +1 -0
  390. package/dist/src/transfer/store/publish.js +262 -0
  391. package/dist/src/transfer/store/publish.js.map +1 -0
  392. package/dist/src/transfer/store/registry.d.ts +58 -0
  393. package/dist/src/transfer/store/registry.d.ts.map +1 -0
  394. package/dist/src/transfer/store/registry.js +285 -0
  395. package/dist/src/transfer/store/registry.js.map +1 -0
  396. package/dist/src/transfer/store/search.d.ts +54 -0
  397. package/dist/src/transfer/store/search.d.ts.map +1 -0
  398. package/dist/src/transfer/store/search.js +232 -0
  399. package/dist/src/transfer/store/search.js.map +1 -0
  400. package/dist/src/transfer/store/tests/standalone-test.d.ts +12 -0
  401. package/dist/src/transfer/store/tests/standalone-test.d.ts.map +1 -0
  402. package/dist/src/transfer/store/tests/standalone-test.js +190 -0
  403. package/dist/src/transfer/store/tests/standalone-test.js.map +1 -0
  404. package/dist/src/transfer/store/types.d.ts +193 -0
  405. package/dist/src/transfer/store/types.d.ts.map +1 -0
  406. package/dist/src/transfer/store/types.js +6 -0
  407. package/dist/src/transfer/store/types.js.map +1 -0
  408. package/dist/src/transfer/test-seraphine.d.ts +6 -0
  409. package/dist/src/transfer/test-seraphine.d.ts.map +1 -0
  410. package/dist/src/transfer/test-seraphine.js +105 -0
  411. package/dist/src/transfer/test-seraphine.js.map +1 -0
  412. package/dist/src/transfer/tests/test-store.d.ts +7 -0
  413. package/dist/src/transfer/tests/test-store.d.ts.map +1 -0
  414. package/dist/src/transfer/tests/test-store.js +214 -0
  415. package/dist/src/transfer/tests/test-store.js.map +1 -0
  416. package/dist/src/transfer/types.d.ts +245 -0
  417. package/dist/src/transfer/types.d.ts.map +1 -0
  418. package/dist/src/transfer/types.js +6 -0
  419. package/dist/src/transfer/types.js.map +1 -0
  420. package/dist/src/types.d.ts +198 -0
  421. package/dist/src/types.d.ts.map +1 -0
  422. package/dist/src/types.js +38 -0
  423. package/dist/src/types.js.map +1 -0
  424. package/dist/tsconfig.tsbuildinfo +1 -0
  425. package/package.json +33 -47
  426. package/dist/index.d.ts +0 -30
  427. package/dist/index.d.ts.map +0 -1
  428. package/dist/index.js +0 -30
  429. package/dist/index.js.map +0 -1
package/README.md CHANGED
@@ -1,75 +1,1607 @@
1
- # claude-flow
1
+ # @claude-flow/cli
2
2
 
3
- **Multi-agent AI orchestration for Claude Code**
3
+ [![npm version](https://img.shields.io/npm/v/@claude-flow/cli.svg)](https://www.npmjs.com/package/@claude-flow/cli)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@claude-flow/cli.svg)](https://www.npmjs.com/package/@claude-flow/cli)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)](https://www.typescriptlang.org/)
7
+ [![Node.js](https://img.shields.io/badge/Node.js-20+-green.svg)](https://nodejs.org/)
8
+ [![Commands](https://img.shields.io/badge/Commands-29-orange.svg)](https://github.com/ruvnet/claude-flow)
9
+ [![Subcommands](https://img.shields.io/badge/Subcommands-170+-purple.svg)](https://github.com/ruvnet/claude-flow)
4
10
 
5
- Deploy 54+ specialized agents in coordinated swarms with self-learning capabilities, fault-tolerant consensus, and enterprise-grade security.
11
+ > Modern CLI module for Claude Flow V3 - comprehensive command-line interface with 29 commands, 170+ subcommands, interactive prompts, self-learning hooks, background workers, hive-mind coordination, Q-Learning agent routing, code analysis, collaborative issue claims, smart error suggestions, and beautiful output formatting.
6
12
 
7
- ## Installation
13
+ ## Features
14
+
15
+ ### Core Capabilities
16
+ - **29 Main Commands** - Complete CLI coverage for all Claude Flow operations
17
+ - **170+ Subcommands** - Fine-grained control over every aspect of the system
18
+ - **Advanced Argument Parsing** - Full support for flags, options, subcommands, and positional arguments
19
+ - **Interactive Prompts** - Rich interactive mode with confirmations, selections, and input validation
20
+ - **Beautiful Output** - Colored output, tables, progress bars, spinners, and multiple formats (text, JSON, table)
21
+ - **Smart Error Suggestions** - Levenshtein distance-based typo detection with helpful corrections
22
+
23
+ ### V3-Specific Features
24
+ - **Self-Learning Hooks** - 17 hook subcommands + 12 background workers with pattern learning and neural integration
25
+ - **Hive-Mind Coordination** - Queen-led Byzantine fault-tolerant multi-agent consensus
26
+ - **15-Agent Swarm** - V3 hierarchical mesh coordination with domain specialization
27
+ - **AgentDB Integration** - 150x-12,500x faster vector search with HNSW indexing
28
+ - **SONA Learning** - Sub-0.05ms adaptation with Mixture of Experts routing
29
+ - **Q-Learning Routing** - Intelligent task-to-agent routing with reinforcement learning
30
+ - **Code Analysis** - AST analysis, diff classification, complexity metrics, boundary detection
31
+ - **Issue Claims (ADR-016)** - Collaborative human-agent issue management with work stealing
8
32
 
9
- Works with both **Node.js** and **Bun** runtimes.
33
+ ### Developer Experience
34
+ - **Type-Safe** - Full TypeScript support with comprehensive type definitions
35
+ - **Global Options** - Built-in `--help`, `--version`, `--verbose`, `--quiet`, `--format`
36
+ - **Shell Completions** - Full tab completion for bash, zsh, fish, and PowerShell
37
+ - **Doctor Command** - System diagnostics with health checks and suggested fixes
38
+ - **Migration Tools** - Built-in V2 to V3 migration with rollback support
39
+
40
+ ## Installation
10
41
 
11
42
  ```bash
12
- # With npm/npx (Node.js)
13
- npm install claude-flow@v3alpha
14
- npx claude-flow@v3alpha init
43
+ npm install @claude-flow/cli
44
+ ```
45
+
46
+ Or use globally:
15
47
 
16
- # With Bun (faster)
17
- bun add claude-flow@v3alpha
18
- bunx claude-flow@v3alpha init
48
+ ```bash
49
+ npm install -g @claude-flow/cli
50
+ claude-flow --version
19
51
  ```
20
52
 
21
53
  ## Quick Start
22
54
 
23
55
  ```bash
24
- # Initialize in your project
25
- npx claude-flow@v3alpha init
56
+ # Initialize a new project
57
+ claude-flow init --wizard
26
58
 
27
- # Start MCP server for Claude Code integration
28
- npx claude-flow@v3alpha mcp start
59
+ # Start MCP server
60
+ claude-flow mcp start
29
61
 
30
- # Run a task with agents
31
- npx claude-flow@v3alpha --agent coder --task "Implement user authentication"
62
+ # Spawn an agent
63
+ claude-flow agent spawn -t coder --name my-coder
32
64
 
33
65
  # Initialize a swarm
34
- npx claude-flow@v3alpha swarm init --topology hierarchical
66
+ claude-flow swarm init --v3-mode
67
+
68
+ # Search memory
69
+ claude-flow memory search -q "authentication patterns"
70
+
71
+ # Route task to optimal agent (Q-Learning)
72
+ claude-flow route task "Implement OAuth2 authentication"
73
+
74
+ # Analyze code complexity
75
+ claude-flow analyze complexity ./src
35
76
 
36
- # Route tasks intelligently
37
- npx claude-flow@v3alpha hooks route "Optimize database queries"
77
+ # Claim an issue
78
+ claude-flow issues claim ISSUE-123
79
+
80
+ # Check system status
81
+ claude-flow status --watch
38
82
  ```
39
83
 
40
- ## Features
84
+ ## Complete Command Reference
85
+
86
+ ### Overview
87
+
88
+ | Command | Subcommands | Description |
89
+ |---------|-------------|-------------|
90
+ | `init` | 4 | Project initialization with wizard, presets, and configuration |
91
+ | `agent` | 8 | Agent lifecycle management (spawn, list, status, stop, metrics, pool, health, logs) |
92
+ | `swarm` | 6 | Multi-agent swarm coordination and orchestration |
93
+ | `memory` | 11 | AgentDB memory operations with vector search |
94
+ | `mcp` | 9 | MCP server management and tool execution |
95
+ | `task` | 6 | Task creation, assignment, and lifecycle management |
96
+ | `session` | 7 | Session state management and persistence |
97
+ | `config` | 7 | Configuration management and provider setup |
98
+ | `status` | 3 | System status monitoring with watch mode |
99
+ | `start` | 3 | Service startup and quick launch |
100
+ | `workflow` | 6 | Workflow execution and template management |
101
+ | `hooks` | 17 | Self-learning hooks with neural pattern recognition + 12 background workers |
102
+ | `hive-mind` | 6 | Queen-led consensus-based multi-agent coordination |
103
+ | `migrate` | 5 | V2 to V3 migration with rollback support |
104
+ | `process` | 4 | Background process management and monitoring |
105
+ | `daemon` | 5 | Node.js worker daemon (start, stop, status, trigger, enable) |
106
+ | `neural` | 5 | Neural pattern training (train, status, patterns, predict, optimize) |
107
+ | `security` | 6 | Security scanning (scan, audit, cve, threats, validate, report) |
108
+ | `performance` | 5 | Performance profiling (benchmark, profile, metrics, optimize, report) |
109
+ | `providers` | 5 | AI providers (list, add, remove, test, configure) |
110
+ | `plugins` | 5 | Plugin management (list, install, uninstall, enable, disable) |
111
+ | `deployment` | 5 | Deployment management (deploy, rollback, status, environments, release) |
112
+ | `embeddings` | 4 | Vector embeddings (embed, batch, search, init) - 75x faster with agentic-flow |
113
+ | `claims` | 4 | Claims-based authorization (check, grant, revoke, list) |
114
+ | `issues` | 10 | Collaborative issue claims with work stealing (ADR-016) |
115
+ | `route` | 7 | Q-Learning agent routing with reinforcement learning |
116
+ | `analyze` | 11 | Code analysis (AST, diff, complexity, boundaries, dependencies) |
117
+ | `doctor` | 1 | System diagnostics with health checks and suggested fixes |
118
+ | `completions` | 4 | Shell completions for bash, zsh, fish, and PowerShell |
119
+
120
+ ---
121
+
122
+ ### `init` - Project Initialization
123
+
124
+ Initialize Claude Flow V3 with interactive wizard or presets.
125
+
126
+ ```bash
127
+ claude-flow init [subcommand] [options]
128
+ ```
129
+
130
+ #### Subcommands
131
+
132
+ | Subcommand | Description |
133
+ |------------|-------------|
134
+ | `wizard` | Interactive setup wizard with step-by-step configuration |
135
+ | `check` | Validate current configuration and environment |
136
+ | `skills` | List and manage available skills |
137
+ | `hooks` | Configure and validate hooks integration |
138
+
139
+ #### Options
140
+
141
+ | Option | Short | Description | Default |
142
+ |--------|-------|-------------|---------|
143
+ | `--preset` | `-p` | Configuration preset (minimal, default, full, custom) | `default` |
144
+ | `--force` | `-f` | Overwrite existing configuration | `false` |
145
+ | `--skip-deps` | | Skip dependency installation | `false` |
146
+ | `--topology` | `-t` | Swarm topology (hierarchical, mesh, hybrid) | `hierarchical` |
147
+ | `--max-agents` | `-m` | Maximum concurrent agents | `15` |
148
+ | `--memory-backend` | | Memory backend (agentdb, sqlite, hybrid) | `hybrid` |
149
+ | `--enable-hnsw` | | Enable HNSW indexing (150x faster) | `true` |
150
+ | `--enable-neural` | | Enable SONA neural learning | `true` |
151
+
152
+ #### Examples
153
+
154
+ ```bash
155
+ # Interactive wizard
156
+ claude-flow init --wizard
157
+
158
+ # Quick setup with defaults
159
+ claude-flow init --preset default
160
+
161
+ # Full V3 setup with all features
162
+ claude-flow init --preset full --enable-hnsw --enable-neural
163
+
164
+ # Validate configuration
165
+ claude-flow init check
166
+ ```
167
+
168
+ ---
169
+
170
+ ### `agent` - Agent Management
171
+
172
+ Spawn, manage, and monitor AI agents with various specializations.
173
+
174
+ ```bash
175
+ claude-flow agent <subcommand> [options]
176
+ ```
177
+
178
+ #### Subcommands
179
+
180
+ | Subcommand | Aliases | Description |
181
+ |------------|---------|-------------|
182
+ | `spawn` | | Spawn a new agent with specified type and configuration |
183
+ | `list` | `ls` | List all active agents with filtering options |
184
+ | `status` | | Show detailed status and metrics for an agent |
185
+ | `stop` | `kill` | Stop a running agent (graceful or forced) |
186
+ | `metrics` | | Show agent performance metrics over time |
187
+ | `pool` | | Manage agent pool for auto-scaling |
188
+ | `health` | | Show agent health and resource metrics |
189
+ | `logs` | | View agent activity logs with filtering |
190
+
191
+ #### Agent Types
192
+
193
+ | Type | Description | Capabilities |
194
+ |------|-------------|--------------|
195
+ | `coder` | Code development with neural patterns | code-generation, refactoring, debugging, testing |
196
+ | `researcher` | Research with web access and data analysis | web-search, data-analysis, summarization, citation |
197
+ | `tester` | Comprehensive testing with automation | unit-testing, integration-testing, coverage-analysis |
198
+ | `reviewer` | Code review with security and quality checks | code-review, security-audit, quality-check |
199
+ | `architect` | System design with enterprise patterns | system-design, pattern-analysis, scalability |
200
+ | `coordinator` | Multi-agent orchestration and workflow | task-orchestration, agent-management, workflow-control |
201
+ | `security-architect` | Security architecture and threat modeling | threat-modeling, security-patterns, compliance |
202
+ | `security-auditor` | CVE remediation and security testing | vulnerability-scan, penetration-testing |
203
+ | `memory-specialist` | AgentDB unification (150x-12,500x faster) | vector-search, agentdb, caching, optimization |
204
+ | `performance-engineer` | 2.49x-7.47x optimization targets | benchmarking, profiling, optimization |
205
+
206
+ #### Spawn Options
207
+
208
+ | Option | Short | Description | Default |
209
+ |--------|-------|-------------|---------|
210
+ | `--type` | `-t` | Agent type to spawn | required |
211
+ | `--name` | `-n` | Agent name/identifier | auto-generated |
212
+ | `--provider` | `-p` | LLM provider (anthropic, openrouter, ollama) | `anthropic` |
213
+ | `--model` | `-m` | Model to use | provider default |
214
+ | `--task` | | Initial task for the agent | none |
215
+ | `--timeout` | | Agent timeout in seconds | `300` |
216
+ | `--auto-tools` | | Enable automatic tool usage | `true` |
217
+
218
+ #### Examples
219
+
220
+ ```bash
221
+ # Spawn a coder agent
222
+ claude-flow agent spawn -t coder --name my-coder
223
+
224
+ # Spawn researcher with initial task
225
+ claude-flow agent spawn -t researcher --task "Research React 19 features"
226
+
227
+ # List all active agents
228
+ claude-flow agent list
229
+
230
+ # List agents by type
231
+ claude-flow agent list -t coder
232
+
233
+ # Get detailed agent status
234
+ claude-flow agent status agent-001
235
+
236
+ # Show agent metrics for 24 hours
237
+ claude-flow agent metrics -p 24h
238
+
239
+ # View agent logs
240
+ claude-flow agent logs -i agent-001 -f
241
+
242
+ # Configure agent pool
243
+ claude-flow agent pool --size 5 --min 2 --max 15 --auto-scale
244
+
245
+ # Health check with detailed metrics
246
+ claude-flow agent health -d
247
+
248
+ # Stop agent gracefully
249
+ claude-flow agent stop agent-001
250
+
251
+ # Force stop
252
+ claude-flow agent stop agent-001 -f
253
+ ```
254
+
255
+ ---
256
+
257
+ ### `swarm` - Swarm Coordination
258
+
259
+ Multi-agent swarm initialization, coordination, and management.
260
+
261
+ ```bash
262
+ claude-flow swarm <subcommand> [options]
263
+ ```
264
+
265
+ #### Subcommands
266
+
267
+ | Subcommand | Description |
268
+ |------------|-------------|
269
+ | `init` | Initialize a new swarm with specified topology |
270
+ | `start` | Start swarm execution with objective and strategy |
271
+ | `status` | Show swarm status, progress, and metrics |
272
+ | `stop` | Stop swarm execution (with state save option) |
273
+ | `scale` | Scale swarm agent count up or down |
274
+ | `coordinate` | Execute V3 15-agent hierarchical mesh coordination |
275
+
276
+ #### Topologies
277
+
278
+ | Topology | Description | Best For |
279
+ |----------|-------------|----------|
280
+ | `hierarchical` | Queen-led coordination with worker agents | Structured tasks, clear authority |
281
+ | `mesh` | Fully connected peer-to-peer network | Collaborative work, redundancy |
282
+ | `ring` | Circular communication pattern | Sequential processing |
283
+ | `star` | Central coordinator with spoke agents | Centralized control |
284
+ | `hybrid` | Hierarchical mesh for maximum flexibility | Complex multi-domain tasks |
285
+
286
+ #### Strategies
287
+
288
+ | Strategy | Description | Agent Distribution |
289
+ |----------|-------------|-------------------|
290
+ | `research` | Distributed research and analysis | 1 coordinator, 4 researchers, 2 analysts |
291
+ | `development` | Collaborative code development | 1 coordinator, 1 architect, 3 coders, 2 testers, 1 reviewer |
292
+ | `testing` | Comprehensive test coverage | 1 test lead, 2 unit testers, 2 integration testers, 1 QA |
293
+ | `optimization` | Performance optimization | 1 performance lead, 2 profilers, 2 optimizers |
294
+ | `maintenance` | Codebase maintenance and refactoring | 1 coordinator, 2 refactorers, 1 documenter |
295
+ | `analysis` | Code analysis and documentation | 1 analyst lead, 2 code analysts, 1 security analyst |
296
+
297
+ #### Examples
298
+
299
+ ```bash
300
+ # Initialize V3 swarm (recommended)
301
+ claude-flow swarm init --v3-mode
302
+
303
+ # Initialize with specific topology
304
+ claude-flow swarm init -t mesh --max-agents 10
305
+
306
+ # Start development swarm
307
+ claude-flow swarm start -o "Build REST API with authentication" -s development
308
+
309
+ # Parallel analysis swarm
310
+ claude-flow swarm start -o "Analyze codebase for performance issues" --parallel
311
+
312
+ # Check swarm status
313
+ claude-flow swarm status swarm-123
314
+
315
+ # Scale swarm
316
+ claude-flow swarm scale swarm-123 --agents 20
317
+
318
+ # V3 15-agent coordination
319
+ claude-flow swarm coordinate --agents 15
320
+
321
+ # Stop with state save
322
+ claude-flow swarm stop swarm-123 --save-state
323
+ ```
324
+
325
+ ---
326
+
327
+ ### `memory` - Memory Management
328
+
329
+ AgentDB memory operations with vector search, caching, and optimization.
330
+
331
+ ```bash
332
+ claude-flow memory <subcommand> [options]
333
+ ```
334
+
335
+ #### Subcommands
336
+
337
+ | Subcommand | Aliases | Description |
338
+ |------------|---------|-------------|
339
+ | `store` | | Store data in memory with optional vector embedding |
340
+ | `retrieve` | `get` | Retrieve data from memory by key |
341
+ | `search` | | Semantic/vector search with HNSW indexing |
342
+ | `list` | `ls` | List memory entries with filtering |
343
+ | `delete` | `rm` | Delete memory entry |
344
+ | `stats` | | Show memory statistics and performance |
345
+ | `configure` | `config` | Configure memory backend and HNSW parameters |
346
+ | `cleanup` | | Clean up stale and expired entries |
347
+ | `compress` | | Compress and optimize memory storage |
348
+ | `export` | | Export memory to file (JSON, CSV, binary) |
349
+ | `import` | | Import memory from file |
350
+
351
+ #### Memory Backends
352
+
353
+ | Backend | Description | Performance |
354
+ |---------|-------------|-------------|
355
+ | `agentdb` | Vector database with HNSW indexing | 150x-12,500x faster search |
356
+ | `sqlite` | Lightweight local storage | Good for small datasets |
357
+ | `hybrid` | SQLite + AgentDB (recommended) | Best of both worlds |
358
+ | `memory` | In-memory (non-persistent) | Fastest, no persistence |
359
+
360
+ #### Search Options
361
+
362
+ | Option | Short | Description | Default |
363
+ |--------|-------|-------------|---------|
364
+ | `--query` | `-q` | Search query | required |
365
+ | `--namespace` | `-n` | Memory namespace | all |
366
+ | `--limit` | `-l` | Maximum results | `10` |
367
+ | `--threshold` | | Similarity threshold (0-1) | `0.7` |
368
+ | `--type` | `-t` | Search type (semantic, keyword, hybrid) | `semantic` |
369
+
370
+ #### Examples
371
+
372
+ ```bash
373
+ # Store text data
374
+ claude-flow memory store -k "api/auth" -v "JWT implementation with refresh tokens"
375
+
376
+ # Store as vector embedding
377
+ claude-flow memory store -k "pattern/singleton" -v "Singleton pattern description" --vector
378
+
379
+ # Semantic search
380
+ claude-flow memory search -q "authentication patterns"
381
+
382
+ # Keyword search
383
+ claude-flow memory search -q "JWT" -t keyword
384
+
385
+ # Hybrid search with threshold
386
+ claude-flow memory search -q "security best practices" -t hybrid --threshold 0.8
387
+
388
+ # List entries by namespace
389
+ claude-flow memory list -n patterns
390
+
391
+ # Show memory statistics
392
+ claude-flow memory stats
393
+
394
+ # Configure HNSW parameters
395
+ claude-flow memory configure -b hybrid --hnsw-m 16 --hnsw-ef 200
396
+
397
+ # Cleanup old entries
398
+ claude-flow memory cleanup --older-than 30d
399
+
400
+ # Cleanup expired TTL entries
401
+ claude-flow memory cleanup --expired-only
402
+
403
+ # Compress with quantization (32x memory reduction)
404
+ claude-flow memory compress --quantize --bits 4
405
+
406
+ # Export memory
407
+ claude-flow memory export -o ./backup.json -f json
408
+
409
+ # Import memory
410
+ claude-flow memory import -i ./backup.json --merge
411
+ ```
412
+
413
+ ---
414
+
415
+ ### `mcp` - MCP Server Management
416
+
417
+ Model Context Protocol server control and tool execution.
418
+
419
+ ```bash
420
+ claude-flow mcp <subcommand> [options]
421
+ ```
422
+
423
+ #### Subcommands
424
+
425
+ | Subcommand | Description |
426
+ |------------|-------------|
427
+ | `start` | Start MCP server with specified transport |
428
+ | `stop` | Stop MCP server (graceful or forced) |
429
+ | `status` | Show MCP server status and metrics |
430
+ | `health` | Check MCP server health |
431
+ | `restart` | Restart MCP server |
432
+ | `tools` | List available MCP tools by category |
433
+ | `toggle` | Enable or disable specific tools |
434
+ | `exec` | Execute an MCP tool directly |
435
+ | `logs` | Show MCP server logs |
436
+
437
+ #### Transport Types
438
+
439
+ | Transport | Description | Use Case |
440
+ |-----------|-------------|----------|
441
+ | `stdio` | Standard I/O (default) | Claude Code integration |
442
+ | `http` | HTTP REST API | Web integrations, remote access |
443
+ | `websocket` | WebSocket connection | Real-time bidirectional |
444
+
445
+ #### Tool Categories
446
+
447
+ | Category | Description | Tool Count |
448
+ |----------|-------------|------------|
449
+ | `agent` | Agent lifecycle management | 4 |
450
+ | `swarm` | Swarm coordination | 3 |
451
+ | `memory` | Memory operations | 3 |
452
+ | `config` | Configuration | 3 |
453
+ | `hooks` | Hook execution | 9 |
454
+ | `system` | System operations | 3 |
455
+
456
+ #### Examples
457
+
458
+ ```bash
459
+ # Start with stdio (default)
460
+ claude-flow mcp start
461
+
462
+ # Start HTTP server on port 8080
463
+ claude-flow mcp start -t http -p 8080
464
+
465
+ # Start as background daemon
466
+ claude-flow mcp start -d
467
+
468
+ # Check server status
469
+ claude-flow mcp status
470
+
471
+ # Health check
472
+ claude-flow mcp health
473
+
474
+ # List all tools
475
+ claude-flow mcp tools
476
+
477
+ # List tools by category
478
+ claude-flow mcp tools -c memory
479
+
480
+ # Execute a tool
481
+ claude-flow mcp exec -t swarm/init -p '{"topology":"mesh"}'
482
+
483
+ # View logs
484
+ claude-flow mcp logs -n 50 -f
485
+
486
+ # Restart server
487
+ claude-flow mcp restart
488
+
489
+ # Stop server
490
+ claude-flow mcp stop
491
+ ```
492
+
493
+ ---
494
+
495
+ ### `task` - Task Management
496
+
497
+ Create, assign, and manage tasks across agents.
498
+
499
+ ```bash
500
+ claude-flow task <subcommand> [options]
501
+ ```
502
+
503
+ #### Subcommands
504
+
505
+ | Subcommand | Description |
506
+ |------------|-------------|
507
+ | `create` | Create a new task with priority and dependencies |
508
+ | `list` | List tasks with status filtering |
509
+ | `status` | Show detailed task status |
510
+ | `cancel` | Cancel a pending or running task |
511
+ | `assign` | Assign task to specific agent |
512
+ | `retry` | Retry a failed task |
513
+
514
+ #### Examples
515
+
516
+ ```bash
517
+ # Create a task
518
+ claude-flow task create "Implement user authentication" -p high
519
+
520
+ # Create task with dependencies
521
+ claude-flow task create "Write tests" --depends-on task-001
522
+
523
+ # List all tasks
524
+ claude-flow task list
525
+
526
+ # List pending tasks
527
+ claude-flow task list -s pending
528
+
529
+ # Get task status
530
+ claude-flow task status task-001
531
+
532
+ # Assign to agent
533
+ claude-flow task assign task-001 --agent coder-001
534
+
535
+ # Cancel task
536
+ claude-flow task cancel task-001
537
+
538
+ # Retry failed task
539
+ claude-flow task retry task-001
540
+ ```
541
+
542
+ ---
543
+
544
+ ### `session` - Session Management
545
+
546
+ Manage session state, persistence, and restoration.
547
+
548
+ ```bash
549
+ claude-flow session <subcommand> [options]
550
+ ```
551
+
552
+ #### Subcommands
553
+
554
+ | Subcommand | Description |
555
+ |------------|-------------|
556
+ | `list` | List all sessions |
557
+ | `save` | Save current session state |
558
+ | `restore` | Restore a previous session |
559
+ | `delete` | Delete a session |
560
+ | `export` | Export session to file |
561
+ | `import` | Import session from file |
562
+ | `current` | Show current session info |
563
+
564
+ #### Examples
565
+
566
+ ```bash
567
+ # List all sessions
568
+ claude-flow session list
569
+
570
+ # Save current session
571
+ claude-flow session save --name "feature-auth"
572
+
573
+ # Restore session
574
+ claude-flow session restore session-123
575
+
576
+ # Export session
577
+ claude-flow session export -o ./session-backup.json
578
+
579
+ # Import session
580
+ claude-flow session import -i ./session-backup.json
581
+
582
+ # Show current session
583
+ claude-flow session current
584
+
585
+ # Delete old session
586
+ claude-flow session delete session-123
587
+ ```
588
+
589
+ ---
590
+
591
+ ### `config` - Configuration Management
592
+
593
+ Manage configuration, providers, and settings.
594
+
595
+ ```bash
596
+ claude-flow config <subcommand> [options]
597
+ ```
598
+
599
+ #### Subcommands
600
+
601
+ | Subcommand | Description |
602
+ |------------|-------------|
603
+ | `init` | Initialize configuration file |
604
+ | `get` | Get configuration value |
605
+ | `set` | Set configuration value |
606
+ | `providers` | Manage LLM provider configurations |
607
+ | `reset` | Reset configuration to defaults |
608
+ | `export` | Export configuration |
609
+ | `import` | Import configuration |
610
+
611
+ #### Examples
612
+
613
+ ```bash
614
+ # Initialize config
615
+ claude-flow config init
616
+
617
+ # Get a value
618
+ claude-flow config get memory.backend
619
+
620
+ # Set a value
621
+ claude-flow config set swarm.topology mesh
622
+
623
+ # Configure providers
624
+ claude-flow config providers --add anthropic --api-key $ANTHROPIC_API_KEY
625
+
626
+ # Reset to defaults
627
+ claude-flow config reset --confirm
628
+
629
+ # Export config
630
+ claude-flow config export -o ./config-backup.json
631
+
632
+ # Import config
633
+ claude-flow config import -i ./config.json
634
+ ```
635
+
636
+ ---
637
+
638
+ ### `status` - System Status
639
+
640
+ Monitor system status with real-time updates.
641
+
642
+ ```bash
643
+ claude-flow status [subcommand] [options]
644
+ ```
645
+
646
+ #### Subcommands
647
+
648
+ | Subcommand | Description |
649
+ |------------|-------------|
650
+ | `agents` | Show status of all agents |
651
+ | `tasks` | Show status of all tasks |
652
+ | `memory` | Show memory system status |
653
+
654
+ #### Options
655
+
656
+ | Option | Short | Description | Default |
657
+ |--------|-------|-------------|---------|
658
+ | `--watch` | `-w` | Watch mode with auto-refresh | `false` |
659
+ | `--interval` | `-i` | Refresh interval in seconds | `5` |
660
+
661
+ #### Examples
662
+
663
+ ```bash
664
+ # Show all status
665
+ claude-flow status
666
+
667
+ # Watch mode with 2s refresh
668
+ claude-flow status --watch -i 2
669
+
670
+ # Agent status only
671
+ claude-flow status agents
672
+
673
+ # Task status
674
+ claude-flow status tasks
675
+
676
+ # Memory status
677
+ claude-flow status memory
678
+ ```
679
+
680
+ ---
681
+
682
+ ### `workflow` - Workflow Management
683
+
684
+ Execute and manage automated workflows.
685
+
686
+ ```bash
687
+ claude-flow workflow <subcommand> [options]
688
+ ```
689
+
690
+ #### Subcommands
691
+
692
+ | Subcommand | Description |
693
+ |------------|-------------|
694
+ | `run` | Execute a workflow |
695
+ | `validate` | Validate workflow definition |
696
+ | `list` | List available workflows |
697
+ | `status` | Show workflow execution status |
698
+ | `stop` | Stop running workflow |
699
+ | `template` | Manage workflow templates (list, show, create) |
700
+
701
+ #### Examples
702
+
703
+ ```bash
704
+ # Run a workflow
705
+ claude-flow workflow run ./workflows/deploy.yaml
706
+
707
+ # Validate workflow
708
+ claude-flow workflow validate ./workflows/deploy.yaml
709
+
710
+ # List workflows
711
+ claude-flow workflow list
712
+
713
+ # Check workflow status
714
+ claude-flow workflow status workflow-123
715
+
716
+ # Stop workflow
717
+ claude-flow workflow stop workflow-123
718
+
719
+ # List templates
720
+ claude-flow workflow template list
721
+
722
+ # Create from template
723
+ claude-flow workflow template create --from deploy-standard
724
+ ```
725
+
726
+ ---
727
+
728
+ ### `hooks` - Self-Learning Hooks
729
+
730
+ Advanced self-learning hooks with 17 subcommands for neural pattern recognition and background worker management.
731
+
732
+ ```bash
733
+ claude-flow hooks <subcommand> [options]
734
+ ```
735
+
736
+ #### Subcommands
737
+
738
+ | Subcommand | Description |
739
+ |------------|-------------|
740
+ | `pre-edit` | Execute before file edit (get context, agent suggestions) |
741
+ | `post-edit` | Execute after file edit (record outcome for learning) |
742
+ | `pre-command` | Execute before command (risk assessment) |
743
+ | `post-command` | Execute after command (record outcome) |
744
+ | `pre-task` | Execute before task (setup, validation) |
745
+ | `post-task` | Execute after task (cleanup, learning) |
746
+ | `session-end` | Execute on session end (save state) |
747
+ | `session-restore` | Execute on session restore (load state) |
748
+ | `route` | Route task to optimal agent using learned patterns |
749
+ | `explain` | Explain routing decision with transparency |
750
+ | `pretrain` | Bootstrap intelligence from repository |
751
+ | `build-agents` | Generate optimized agent configs from pretrain data |
752
+ | `metrics` | View learning metrics dashboard |
753
+ | `transfer` | Transfer patterns from another project |
754
+ | `list` | List all registered hooks |
755
+ | `intelligence` | RuVector intelligence (SONA, MoE, HNSW) |
756
+ | `worker` | Background worker management (12 workers) |
757
+
758
+ #### Learning Pipeline
759
+
760
+ The hooks system implements a 4-step learning pipeline:
761
+
762
+ 1. **RETRIEVE** - Top-k memory injection with MMR diversity
763
+ 2. **JUDGE** - LLM-as-judge trajectory evaluation
764
+ 3. **DISTILL** - Extract strategy memories from trajectories
765
+ 4. **CONSOLIDATE** - Dedup, detect contradictions, prune old patterns
766
+
767
+ #### Examples
768
+
769
+ ```bash
770
+ # Pre-edit hook (get context and suggestions)
771
+ claude-flow hooks pre-edit ./src/auth/login.ts
772
+
773
+ # Post-edit hook (record success for learning)
774
+ claude-flow hooks post-edit ./src/auth/login.ts --success true
775
+
776
+ # Pre-command risk assessment
777
+ claude-flow hooks pre-command "rm -rf ./node_modules"
778
+
779
+ # Route task to optimal agent
780
+ claude-flow hooks route "Implement OAuth2 authentication"
781
+
782
+ # Explain routing decision
783
+ claude-flow hooks explain "Implement OAuth2 authentication"
41
784
 
42
- - **54+ Specialized Agents** - Coder, tester, reviewer, security, DevOps, and more
43
- - **Swarm Coordination** - Queen-led hierarchy with 5 consensus algorithms
44
- - **Self-Learning** - SONA neural architecture with <0.05ms adaptation
45
- - **HNSW Memory** - 150x-12,500x faster vector search
46
- - **Multi-Provider LLM** - Claude, GPT, Gemini, Cohere, Ollama with failover
47
- - **Background Workers** - 12 auto-triggered workers for continuous optimization
48
- - **Enterprise Security** - CVE-hardened with input validation and sandboxing
785
+ # Bootstrap from repository
786
+ claude-flow hooks pretrain
49
787
 
50
- ## Programmatic Usage
788
+ # Build optimized agent configs
789
+ claude-flow hooks build-agents --focus "security"
790
+
791
+ # View learning metrics
792
+ claude-flow hooks metrics
793
+
794
+ # Transfer patterns from another project
795
+ claude-flow hooks transfer ../other-project
796
+
797
+ # View intelligence status (SONA, MoE, HNSW)
798
+ claude-flow hooks intelligence
799
+ ```
800
+
801
+ #### Worker Subcommands
802
+
803
+ The `hooks worker` command manages 12 background workers for analysis and optimization tasks.
804
+
805
+ | Worker | Priority | Est. Time | Description |
806
+ |--------|----------|-----------|-------------|
807
+ | `ultralearn` | normal | 60s | Deep knowledge acquisition and learning |
808
+ | `optimize` | high | 30s | Performance optimization and tuning |
809
+ | `consolidate` | low | 20s | Memory consolidation and cleanup |
810
+ | `predict` | normal | 15s | Predictive preloading and anticipation |
811
+ | `audit` | critical | 45s | Security analysis and vulnerability scanning |
812
+ | `map` | normal | 30s | Codebase mapping and architecture analysis |
813
+ | `preload` | low | 10s | Resource preloading and cache warming |
814
+ | `deepdive` | normal | 60s | Deep code analysis and examination |
815
+ | `document` | normal | 45s | Auto-documentation generation |
816
+ | `refactor` | normal | 30s | Code refactoring suggestions |
817
+ | `benchmark` | normal | 60s | Performance benchmarking |
818
+ | `testgaps` | normal | 30s | Test coverage analysis |
819
+
820
+ ##### Worker Commands
821
+
822
+ ```bash
823
+ # List all available workers
824
+ claude-flow hooks worker list
825
+
826
+ # Detect triggers from prompt text
827
+ claude-flow hooks worker detect --prompt "optimize performance"
828
+
829
+ # Auto-dispatch workers when triggers match (min confidence 0.6)
830
+ claude-flow hooks worker detect --prompt "deep dive into auth" --auto-dispatch --min-confidence 0.6
831
+
832
+ # Manually dispatch a worker
833
+ claude-flow hooks worker dispatch --trigger refactor --context "auth module"
834
+
835
+ # Check worker status
836
+ claude-flow hooks worker status
837
+
838
+ # Cancel a running worker
839
+ claude-flow hooks worker cancel --id worker_refactor_1_abc123
840
+ ```
841
+
842
+ ##### Performance Targets
843
+
844
+ | Metric | Target |
845
+ |--------|--------|
846
+ | Trigger detection | <5ms |
847
+ | Worker spawn | <50ms |
848
+ | Max concurrent | 10 |
849
+
850
+ ##### UserPromptSubmit Integration
851
+
852
+ Workers are automatically triggered via the `UserPromptSubmit` hook when prompt patterns match worker triggers with confidence ≥0.6.
853
+
854
+ ---
855
+
856
+ ### `hive-mind` - Consensus Coordination
857
+
858
+ Queen-led Byzantine fault-tolerant multi-agent coordination.
859
+
860
+ ```bash
861
+ claude-flow hive-mind <subcommand> [options]
862
+ ```
863
+
864
+ #### Subcommands
865
+
866
+ | Subcommand | Description |
867
+ |------------|-------------|
868
+ | `init` | Initialize hive-mind with topology and consensus strategy |
869
+ | `spawn` | Spawn agents in the hive (queen, worker, specialist) |
870
+ | `status` | Show hive-mind status with consensus health |
871
+ | `task` | Submit task to hive-mind for collaborative execution |
872
+ | `optimize-memory` | Optimize collective memory (distill, compress) |
873
+ | `shutdown` | Gracefully shutdown hive-mind |
874
+
875
+ #### Topologies
876
+
877
+ | Topology | Description |
878
+ |----------|-------------|
879
+ | `hierarchical` | Queen controls workers directly |
880
+ | `mesh` | Fully connected peer network |
881
+ | `hierarchical-mesh` | Hybrid: Queen + mesh workers |
882
+ | `adaptive` | Dynamic topology based on load |
883
+
884
+ #### Consensus Strategies
885
+
886
+ | Strategy | Description | Fault Tolerance |
887
+ |----------|-------------|-----------------|
888
+ | `byzantine` | Byzantine fault-tolerant (BFT) | Tolerates f < n/3 faulty nodes |
889
+ | `raft` | Leader-based consensus | Tolerates f < n/2 failures |
890
+ | `gossip` | Epidemic protocol for eventual consistency | High partition tolerance |
891
+ | `crdt` | Conflict-free replicated data types | Strong eventual consistency |
892
+ | `quorum` | Configurable quorum-based | Flexible fault tolerance |
893
+
894
+ #### Examples
895
+
896
+ ```bash
897
+ # Initialize with defaults
898
+ claude-flow hive-mind init
899
+
900
+ # Initialize with Byzantine consensus
901
+ claude-flow hive-mind init -t hierarchical-mesh -c byzantine --agents 15
902
+
903
+ # Spawn queen
904
+ claude-flow hive-mind spawn --role queen --name hive-queen
905
+
906
+ # Spawn workers
907
+ claude-flow hive-mind spawn --role worker --count 5
908
+
909
+ # Spawn specialist
910
+ claude-flow hive-mind spawn --role specialist --specialty security
911
+
912
+ # Submit task for collaborative execution
913
+ claude-flow hive-mind task "Implement secure API endpoints" --consensus-required
914
+
915
+ # Check hive status
916
+ claude-flow hive-mind status --detailed
917
+
918
+ # Optimize collective memory
919
+ claude-flow hive-mind optimize-memory --distill --compress
920
+
921
+ # Graceful shutdown
922
+ claude-flow hive-mind shutdown --save-state
923
+ ```
924
+
925
+ ---
926
+
927
+ ### `migrate` - V2 to V3 Migration
928
+
929
+ Migration tools for transitioning from V2 to V3.
930
+
931
+ ```bash
932
+ claude-flow migrate <subcommand> [options]
933
+ ```
934
+
935
+ #### Subcommands
936
+
937
+ | Subcommand | Description |
938
+ |------------|-------------|
939
+ | `status` | Check migration status and pending items |
940
+ | `run` | Execute migration (with dry-run option) |
941
+ | `verify` | Verify migration integrity |
942
+ | `rollback` | Rollback to previous version |
943
+ | `breaking` | Show V3 breaking changes |
944
+
945
+ #### Migration Targets
946
+
947
+ | Target | Description |
948
+ |--------|-------------|
949
+ | `config` | Migrate configuration files |
950
+ | `memory` | Migrate memory/database content |
951
+ | `agents` | Migrate agent configurations |
952
+ | `hooks` | Migrate hook definitions |
953
+ | `workflows` | Migrate workflow definitions |
954
+ | `all` | Full migration |
955
+
956
+ #### Examples
957
+
958
+ ```bash
959
+ # Check migration status
960
+ claude-flow migrate status
961
+
962
+ # Preview migration (dry run)
963
+ claude-flow migrate run --dry-run
964
+
965
+ # Run full migration with backup
966
+ claude-flow migrate run -t all --backup
967
+
968
+ # Migrate specific component
969
+ claude-flow migrate run -t memory
970
+
971
+ # Verify migration
972
+ claude-flow migrate verify
973
+
974
+ # Auto-fix issues
975
+ claude-flow migrate verify --fix
976
+
977
+ # Show breaking changes
978
+ claude-flow migrate breaking
979
+
980
+ # Rollback
981
+ claude-flow migrate rollback --backup-id backup-1704369600
982
+ ```
983
+
984
+ ---
985
+
986
+ ### `doctor` - System Diagnostics
987
+
988
+ System health checks with automatic fix suggestions.
989
+
990
+ ```bash
991
+ claude-flow doctor [options]
992
+ ```
993
+
994
+ #### Health Checks
995
+
996
+ | Check | Description | Auto-Fix |
997
+ |-------|-------------|----------|
998
+ | Node.js Version | Verify Node.js 20+ | nvm install 20 |
999
+ | npm Version | Verify npm 9+ | npm install -g npm@latest |
1000
+ | Git | Check git installation | Install git |
1001
+ | Git Repository | Check if in git repo | git init |
1002
+ | Config File | Validate configuration | claude-flow config init |
1003
+ | Daemon Status | Check daemon running | claude-flow daemon start |
1004
+ | Memory Database | Check memory DB | claude-flow memory configure |
1005
+ | API Keys | Check for API keys | export ANTHROPIC_API_KEY=... |
1006
+ | MCP Servers | Check MCP configuration | claude mcp add claude-flow ... |
1007
+ | Disk Space | Check available space | Free up disk |
1008
+ | TypeScript | Check TypeScript install | npm install -D typescript |
1009
+
1010
+ #### Options
1011
+
1012
+ | Option | Short | Description | Default |
1013
+ |--------|-------|-------------|---------|
1014
+ | `--fix` | `-f` | Show fix commands for issues | `false` |
1015
+ | `--component` | `-c` | Check specific component | all |
1016
+ | `--verbose` | `-v` | Verbose output | `false` |
1017
+
1018
+ #### Examples
1019
+
1020
+ ```bash
1021
+ # Run full health check
1022
+ claude-flow doctor
1023
+
1024
+ # Show fixes for issues
1025
+ claude-flow doctor --fix
1026
+
1027
+ # Check specific component
1028
+ claude-flow doctor -c daemon
1029
+ claude-flow doctor -c mcp
1030
+ claude-flow doctor -c memory
1031
+ ```
1032
+
1033
+ #### Output Example
1034
+
1035
+ ```
1036
+ Claude Flow Doctor
1037
+ System diagnostics and health check
1038
+ ──────────────────────────────────────────────────
1039
+
1040
+ ✓ Node.js Version: v22.21.1 (>= 20 required)
1041
+ ✓ npm Version: v10.9.4
1042
+ ✓ Git: v2.52.0
1043
+ ✓ Git Repository: In a git repository
1044
+ ⚠ Config File: No config file (using defaults)
1045
+ ⚠ Daemon Status: Not running
1046
+ ⚠ Memory Database: Not initialized
1047
+ ⚠ API Keys: No API keys found
1048
+ ⚠ MCP Servers: No MCP config found
1049
+ ✓ Disk Space: 73G available
1050
+ ✓ TypeScript: v5.9.3
1051
+
1052
+ ──────────────────────────────────────────────────
1053
+
1054
+ Summary: 6 passed, 5 warnings
1055
+
1056
+ All checks passed with some warnings.
1057
+ ```
1058
+
1059
+ ---
1060
+
1061
+ ### `route` - Q-Learning Agent Router
1062
+
1063
+ Intelligent task-to-agent routing using reinforcement learning.
1064
+
1065
+ ```bash
1066
+ claude-flow route <subcommand> [options]
1067
+ ```
1068
+
1069
+ #### Subcommands
1070
+
1071
+ | Subcommand | Description |
1072
+ |------------|-------------|
1073
+ | `task` | Route a task to optimal agent using Q-Learning |
1074
+ | `list-agents` | List available agent types with capabilities |
1075
+ | `stats` | Show router statistics and learning metrics |
1076
+ | `feedback` | Provide routing feedback for continuous learning |
1077
+ | `reset` | Reset Q-Learning router state |
1078
+ | `export` | Export Q-table for persistence |
1079
+ | `import` | Import Q-table from file |
1080
+
1081
+ #### Agent Types
1082
+
1083
+ | Type | Description |
1084
+ |------|-------------|
1085
+ | `coder` | Code implementation and debugging |
1086
+ | `tester` | Testing and quality assurance |
1087
+ | `reviewer` | Code review and quality checks |
1088
+ | `architect` | System design and architecture |
1089
+ | `researcher` | Research and information gathering |
1090
+ | `optimizer` | Performance optimization |
1091
+ | `debugger` | Bug fixing and troubleshooting |
1092
+ | `documenter` | Documentation and comments |
1093
+
1094
+ #### How It Works
1095
+
1096
+ 1. **State Encoding** - Analyzes task description using hash-based feature extraction
1097
+ 2. **Q-Learning** - Uses Q-table to map (state, action) pairs to expected rewards
1098
+ 3. **Epsilon-Greedy** - Balances exploration (try new agents) vs exploitation (use best known)
1099
+ 4. **Feedback Loop** - Learns from success/failure outcomes to improve routing
1100
+
1101
+ #### Examples
1102
+
1103
+ ```bash
1104
+ # Route a task to optimal agent
1105
+ claude-flow route task "Implement user authentication with JWT"
1106
+
1107
+ # Route with verbose output showing decision process
1108
+ claude-flow route task "Fix memory leak in API handler" --verbose
1109
+
1110
+ # List available agent types
1111
+ claude-flow route list-agents
1112
+
1113
+ # View router statistics
1114
+ claude-flow route stats
1115
+
1116
+ # Provide feedback (reward: -1 to 1)
1117
+ claude-flow route feedback --agent coder --reward 0.8 --task "auth implementation"
1118
+
1119
+ # Export Q-table for backup
1120
+ claude-flow route export -o ./q-table.json
1121
+
1122
+ # Import Q-table
1123
+ claude-flow route import -i ./q-table.json
1124
+
1125
+ # Reset router (start fresh)
1126
+ claude-flow route reset --confirm
1127
+ ```
1128
+
1129
+ ---
1130
+
1131
+ ### `analyze` - Code Analysis
1132
+
1133
+ Comprehensive code analysis with AST parsing, diff classification, complexity metrics, and dependency analysis.
1134
+
1135
+ ```bash
1136
+ claude-flow analyze <subcommand> [options]
1137
+ ```
1138
+
1139
+ #### Subcommands
1140
+
1141
+ | Subcommand | Description | Algorithm |
1142
+ |------------|-------------|-----------|
1143
+ | `ast` | AST analysis with symbol extraction | tree-sitter (regex fallback) |
1144
+ | `complexity` | Cyclomatic and cognitive complexity | McCabe + cognitive metrics |
1145
+ | `symbols` | Extract functions, classes, types | AST parsing |
1146
+ | `imports` | Import dependency analysis | Static analysis |
1147
+ | `diff` | Diff classification and risk assessment | Pattern matching |
1148
+ | `boundaries` | Code boundaries detection | MinCut algorithm |
1149
+ | `modules` | Module community detection | Louvain algorithm |
1150
+ | `dependencies` | Full dependency graph | Graph building |
1151
+ | `circular` | Circular dependency detection | Tarjan's SCC |
1152
+ | `deps` | Project dependency analysis | npm/yarn |
1153
+ | `code` | Static code quality analysis | Multi-metric |
1154
+
1155
+ #### Diff Risk Levels
1156
+
1157
+ | Risk | Color | Description |
1158
+ |------|-------|-------------|
1159
+ | `critical` | Red | Breaking changes, security-sensitive |
1160
+ | `high` | Orange | Core logic, API changes |
1161
+ | `medium` | Yellow | Feature additions, significant refactoring |
1162
+ | `low` | Green | Documentation, tests, formatting |
1163
+
1164
+ #### Examples
1165
+
1166
+ ```bash
1167
+ # Analyze AST of a file
1168
+ claude-flow analyze ast ./src/auth/login.ts
1169
+
1170
+ # Analyze with symbol extraction
1171
+ claude-flow analyze symbols ./src/services/ --recursive
1172
+
1173
+ # Check cyclomatic complexity
1174
+ claude-flow analyze complexity ./src --threshold 10
1175
+
1176
+ # Classify a git diff
1177
+ claude-flow analyze diff HEAD~1
1178
+
1179
+ # Classify staged changes
1180
+ claude-flow analyze diff --staged
1181
+
1182
+ # Find code boundaries (module splits)
1183
+ claude-flow analyze boundaries ./src --min-cut
1184
+
1185
+ # Detect module communities
1186
+ claude-flow analyze modules ./src --algorithm louvain
1187
+
1188
+ # Find circular dependencies
1189
+ claude-flow analyze circular ./src
1190
+
1191
+ # Full dependency graph
1192
+ claude-flow analyze dependencies ./src -o ./deps.dot --format dot
1193
+
1194
+ # Project dependency analysis
1195
+ claude-flow analyze deps --outdated
1196
+ ```
1197
+
1198
+ ---
1199
+
1200
+ ### `issues` - Collaborative Issue Claims (ADR-016)
1201
+
1202
+ Human-agent collaborative issue management with work stealing, load balancing, and handoffs.
1203
+
1204
+ ```bash
1205
+ claude-flow issues <subcommand> [options]
1206
+ ```
1207
+
1208
+ #### Subcommands
1209
+
1210
+ | Subcommand | Description |
1211
+ |------------|-------------|
1212
+ | `list` | List all active claims |
1213
+ | `claim` | Claim an issue for yourself or an agent |
1214
+ | `release` | Release a claim |
1215
+ | `handoff` | Request handoff to another agent/user |
1216
+ | `status` | Update claim status and progress |
1217
+ | `stealable` | List issues available for work stealing |
1218
+ | `steal` | Steal an issue from overloaded/stale claimant |
1219
+ | `load` | View agent load distribution |
1220
+ | `rebalance` | Rebalance claims across swarm |
1221
+ | `board` | Visual Kanban-style claim board |
1222
+
1223
+ #### Claim Status
1224
+
1225
+ | Status | Description |
1226
+ |--------|-------------|
1227
+ | `active` | Actively being worked on |
1228
+ | `paused` | Temporarily paused |
1229
+ | `blocked` | Blocked by dependency |
1230
+ | `stealable` | Available for work stealing |
1231
+ | `completed` | Work completed |
1232
+ | `handoff-pending` | Awaiting handoff acceptance |
1233
+ | `review-requested` | Needs review |
1234
+
1235
+ #### Work Stealing
1236
+
1237
+ Issues can be marked stealable when:
1238
+ - **Overloaded** - Claimant has too many active claims
1239
+ - **Stale** - No progress for extended period
1240
+ - **Blocked** - Blocked beyond timeout threshold
1241
+ - **Voluntary** - Claimant voluntarily releases
1242
+
1243
+ #### Examples
1244
+
1245
+ ```bash
1246
+ # List all claims
1247
+ claude-flow issues list
1248
+
1249
+ # List with status filter
1250
+ claude-flow issues list --status active
1251
+
1252
+ # Claim an issue
1253
+ claude-flow issues claim ISSUE-123
1254
+
1255
+ # Claim as agent
1256
+ claude-flow issues claim ISSUE-123 --as-agent --type coder
1257
+
1258
+ # Update progress
1259
+ claude-flow issues status ISSUE-123 --progress 50
1260
+
1261
+ # Mark as blocked
1262
+ claude-flow issues status ISSUE-123 --set blocked --note "Waiting for API"
1263
+
1264
+ # Request handoff to another user
1265
+ claude-flow issues handoff ISSUE-123 --to user:alice:Alice
1266
+
1267
+ # Request handoff to agent
1268
+ claude-flow issues handoff ISSUE-123 --to agent:coder:coder-001
1269
+
1270
+ # View stealable issues
1271
+ claude-flow issues stealable
1272
+
1273
+ # Steal an issue
1274
+ claude-flow issues steal ISSUE-123 --reason overloaded
1275
+
1276
+ # View agent load
1277
+ claude-flow issues load
1278
+
1279
+ # Rebalance swarm
1280
+ claude-flow issues rebalance --strategy even
1281
+
1282
+ # Visual board view
1283
+ claude-flow issues board
1284
+ ```
1285
+
1286
+ #### Board View
1287
+
1288
+ ```
1289
+ 📋 Issue Claims Board
1290
+ ────────────────────────────────────────────────────────────────
1291
+
1292
+ ACTIVE (3) PAUSED (1) BLOCKED (1)
1293
+ ──────────────── ──────────────── ────────────────
1294
+ │ ISSUE-123 │ │ ISSUE-456 │ │ ISSUE-789 │
1295
+ │ 🤖 coder │ │ 👤 alice │ │ 🤖 tester │
1296
+ │ 75% ████░░░ │ │ 30% ██░░░░░ │ │ 50% ███░░░░ │
1297
+ └──────────────┘ └──────────────┘ └──────────────┘
1298
+ ```
1299
+
1300
+ ---
1301
+
1302
+ ### `completions` - Shell Completions
1303
+
1304
+ Generate shell completion scripts for tab completion of commands.
1305
+
1306
+ ```bash
1307
+ claude-flow completions <shell>
1308
+ ```
1309
+
1310
+ #### Supported Shells
1311
+
1312
+ | Shell | Installation | File Location |
1313
+ |-------|-------------|---------------|
1314
+ | `bash` | `claude-flow completions bash >> ~/.bashrc` | `~/.bash_completion.d/claude-flow` |
1315
+ | `zsh` | `claude-flow completions zsh > ~/.zfunc/_claude-flow` | `~/.zfunc/_claude-flow` |
1316
+ | `fish` | `claude-flow completions fish > ~/.config/fish/completions/claude-flow.fish` | `~/.config/fish/completions/` |
1317
+ | `powershell` | `claude-flow completions powershell >> $PROFILE` | PowerShell profile |
1318
+
1319
+ #### Examples
1320
+
1321
+ ```bash
1322
+ # Install bash completions
1323
+ claude-flow completions bash > ~/.bash_completion.d/claude-flow
1324
+ source ~/.bash_completion.d/claude-flow
1325
+
1326
+ # Install zsh completions
1327
+ mkdir -p ~/.zfunc
1328
+ claude-flow completions zsh > ~/.zfunc/_claude-flow
1329
+ # Add to .zshrc: fpath=(~/.zfunc $fpath); autoload -Uz compinit; compinit
1330
+
1331
+ # Install fish completions
1332
+ claude-flow completions fish > ~/.config/fish/completions/claude-flow.fish
1333
+
1334
+ # Install PowerShell completions
1335
+ claude-flow completions powershell >> $PROFILE
1336
+ ```
1337
+
1338
+ #### Completion Features
1339
+
1340
+ - All 29 top-level commands
1341
+ - Full subcommand completion for each command
1342
+ - Flag and option completion
1343
+ - Dynamic suggestions based on context
1344
+
1345
+ ---
1346
+
1347
+ ### Smart Error Suggestions
1348
+
1349
+ When you mistype a command, the CLI provides helpful suggestions using Levenshtein distance matching.
1350
+
1351
+ ```bash
1352
+ $ claude-flow swram
1353
+ [ERROR] Unknown command: swram
1354
+ Did you mean one of these?
1355
+ - swarm
1356
+ - neural
1357
+ - start
1358
+
1359
+ $ claude-flow memroy
1360
+ [ERROR] Unknown command: memroy
1361
+ Did you mean "memory"?
1362
+
1363
+ $ claude-flow agnet
1364
+ [ERROR] Unknown command: agnet
1365
+ Did you mean "agent"?
1366
+ ```
1367
+
1368
+ The suggestion system:
1369
+ - Uses Levenshtein distance to find similar commands
1370
+ - Recognizes 40+ common typos (e.g., `memroy` → `memory`, `swram` → `swarm`)
1371
+ - Suggests up to 3 alternatives sorted by similarity
1372
+ - Boosts prefix matches for better suggestions
1373
+
1374
+ ---
1375
+
1376
+ ## Global Options
1377
+
1378
+ All commands support these global options:
1379
+
1380
+ | Option | Short | Description | Default |
1381
+ |--------|-------|-------------|---------|
1382
+ | `--help` | `-h` | Show help information | |
1383
+ | `--version` | `-V` | Show version number | |
1384
+ | `--verbose` | `-v` | Enable verbose output | `false` |
1385
+ | `--quiet` | `-q` | Suppress non-essential output | `false` |
1386
+ | `--config` | `-c` | Path to configuration file | `./claude-flow.config.json` |
1387
+ | `--format` | `-f` | Output format (text, json, table) | `text` |
1388
+ | `--no-color` | | Disable colored output | `false` |
1389
+ | `--interactive` | `-i` | Enable interactive mode | `true` (if TTY) |
1390
+
1391
+ ## Programmatic API
1392
+
1393
+ ### CommandParser
51
1394
 
52
1395
  ```typescript
53
- import { createUnifiedSwarmCoordinator } from 'claude-flow';
1396
+ import { CommandParser, OutputFormatter } from '@claude-flow/cli';
1397
+
1398
+ // Create a parser instance
1399
+ const parser = new CommandParser();
54
1400
 
55
- const coordinator = createUnifiedSwarmCoordinator({
56
- topology: { type: 'hierarchical', maxAgents: 15 },
57
- consensus: { algorithm: 'raft' },
1401
+ // Register a command
1402
+ parser.registerCommand({
1403
+ name: 'mycommand',
1404
+ description: 'My custom command',
1405
+ options: [
1406
+ {
1407
+ name: 'type',
1408
+ short: 't',
1409
+ description: 'Operation type',
1410
+ type: 'string',
1411
+ choices: ['a', 'b', 'c'],
1412
+ default: 'a'
1413
+ }
1414
+ ],
1415
+ subcommands: [
1416
+ { name: 'sub1', description: 'First subcommand' },
1417
+ { name: 'sub2', description: 'Second subcommand' }
1418
+ ],
1419
+ action: async (ctx) => {
1420
+ // Command implementation
1421
+ return { success: true };
1422
+ }
58
1423
  });
59
1424
 
60
- await coordinator.initialize();
61
- await coordinator.spawnFullHierarchy();
1425
+ // Parse arguments
1426
+ const result = parser.parse(process.argv.slice(2));
1427
+
1428
+ // Validate flags
1429
+ const errors = parser.validateFlags(result.flags, result.command);
1430
+
1431
+ // Get all registered commands
1432
+ const commands = parser.getAllCommands();
1433
+ ```
1434
+
1435
+ ### Output Formatting
1436
+
1437
+ ```typescript
1438
+ import { OutputFormatter, output, Progress, Spinner } from '@claude-flow/cli';
62
1439
 
63
- const result = await coordinator.submitTask({
64
- type: 'coding',
65
- name: 'Implement feature',
66
- priority: 'high',
1440
+ // Use the singleton instance
1441
+ output.printSuccess('Operation completed');
1442
+ output.printError('Something went wrong');
1443
+ output.printWarning('Proceed with caution');
1444
+ output.printInfo('FYI: This is informational');
1445
+
1446
+ // Or create a custom formatter
1447
+ const formatter = new OutputFormatter({ color: true });
1448
+
1449
+ // Color methods
1450
+ formatter.success('Green text');
1451
+ formatter.error('Red text');
1452
+ formatter.warning('Yellow text');
1453
+ formatter.bold('Bold text');
1454
+ formatter.dim('Dimmed text');
1455
+ formatter.highlight('Highlighted text');
1456
+
1457
+ // Structured output
1458
+ output.printTable({
1459
+ columns: [
1460
+ { key: 'name', header: 'Name', width: 20 },
1461
+ { key: 'status', header: 'Status', width: 10, align: 'right' }
1462
+ ],
1463
+ data: [
1464
+ { name: 'Agent 1', status: 'active' },
1465
+ { name: 'Agent 2', status: 'idle' }
1466
+ ]
67
1467
  });
1468
+
1469
+ output.printJson({ key: 'value' });
1470
+ output.printList(['Item 1', 'Item 2', 'Item 3']);
1471
+ output.printBox('Content here', 'Title');
1472
+ output.progressBar(50, 100, 40); // 50% of 100, width 40
1473
+
1474
+ // Progress indication
1475
+ const spinner = new Spinner('Loading...');
1476
+ spinner.start();
1477
+ // ... do work
1478
+ spinner.succeed('Completed');
1479
+
1480
+ const progress = new Progress({ total: 100 });
1481
+ progress.update(50); // 50%
1482
+ progress.finish();
68
1483
  ```
69
1484
 
70
- ## Documentation
1485
+ ### Interactive Prompts
1486
+
1487
+ ```typescript
1488
+ import { text, select, confirm, input, multiSelect } from '@claude-flow/cli';
1489
+
1490
+ // Text input
1491
+ const name = await text('Enter your name:');
1492
+
1493
+ // Selection
1494
+ const choice = await select({
1495
+ message: 'Choose option:',
1496
+ options: [
1497
+ { label: 'Option A', value: 'A', hint: 'First option' },
1498
+ { label: 'Option B', value: 'B', hint: 'Second option' },
1499
+ ],
1500
+ default: 'A'
1501
+ });
1502
+
1503
+ // Confirmation
1504
+ const confirmed = await confirm({
1505
+ message: 'Continue?',
1506
+ default: false
1507
+ });
1508
+
1509
+ // Input with validation
1510
+ const email = await input({
1511
+ message: 'Enter email:',
1512
+ validate: (v) => v.includes('@') || 'Invalid email'
1513
+ });
1514
+
1515
+ // Multi-select
1516
+ const features = await multiSelect({
1517
+ message: 'Select features:',
1518
+ options: [
1519
+ { label: 'Feature A', value: 'a' },
1520
+ { label: 'Feature B', value: 'b' },
1521
+ { label: 'Feature C', value: 'c' },
1522
+ ]
1523
+ });
1524
+ ```
1525
+
1526
+ ## TypeScript Types
1527
+
1528
+ ```typescript
1529
+ import type {
1530
+ // Command types
1531
+ Command,
1532
+ CommandOption,
1533
+ CommandContext,
1534
+ CommandResult,
1535
+
1536
+ // Parser types
1537
+ ParseResult,
1538
+ ParsedFlags,
1539
+ ParserOptions,
1540
+
1541
+ // Config types
1542
+ V3Config,
1543
+ ProviderConfig,
1544
+ SwarmConfig,
1545
+ MemoryConfig,
1546
+
1547
+ // Output types
1548
+ TableColumn,
1549
+ TableOptions,
1550
+ SpinnerOptions,
1551
+ ProgressOptions,
1552
+
1553
+ // Prompt types
1554
+ SelectOption,
1555
+ InputOptions,
1556
+ ConfirmOptions,
1557
+ } from '@claude-flow/cli';
1558
+ ```
1559
+
1560
+ ## Environment Variables
1561
+
1562
+ ```bash
1563
+ # Configuration
1564
+ CLAUDE_FLOW_CONFIG=./claude-flow.config.json
1565
+ CLAUDE_FLOW_LOG_LEVEL=info
1566
+
1567
+ # Provider API Keys
1568
+ ANTHROPIC_API_KEY=sk-ant-...
1569
+ OPENAI_API_KEY=sk-...
1570
+ GOOGLE_API_KEY=...
1571
+
1572
+ # MCP Server
1573
+ CLAUDE_FLOW_MCP_PORT=3000
1574
+ CLAUDE_FLOW_MCP_HOST=localhost
1575
+ CLAUDE_FLOW_MCP_TRANSPORT=stdio
1576
+
1577
+ # Memory
1578
+ CLAUDE_FLOW_MEMORY_BACKEND=hybrid
1579
+ CLAUDE_FLOW_MEMORY_PATH=./data/memory
1580
+ ```
1581
+
1582
+ ## Performance Targets
1583
+
1584
+ The CLI is optimized for V3 performance targets:
1585
+
1586
+ | Metric | Target | Description |
1587
+ |--------|--------|-------------|
1588
+ | Startup | <500ms | CLI initialization time |
1589
+ | Command parsing | <5ms | Argument parsing time |
1590
+ | MCP tool execution | <100ms | Tool call overhead |
1591
+ | Memory search | 150x-12,500x faster | With HNSW indexing |
1592
+ | SONA adaptation | <0.05ms | Neural learning overhead |
1593
+
1594
+ ## Related Packages
71
1595
 
72
- See the [main repository](https://github.com/ruvnet/claude-flow) for full documentation.
1596
+ - [@claude-flow/shared](../shared) - Shared types and utilities
1597
+ - [@claude-flow/swarm](../swarm) - Swarm coordination module
1598
+ - [@claude-flow/memory](../memory) - AgentDB memory system
1599
+ - [@claude-flow/mcp](../mcp) - MCP server implementation
1600
+ - [@claude-flow/hooks](../hooks) - Self-learning hooks system
1601
+ - [@claude-flow/neural](../neural) - SONA neural learning
1602
+ - [@claude-flow/embeddings](../embeddings) - Vector embeddings (75x faster with agentic-flow)
1603
+ - [@claude-flow/security](../security) - CVE remediation & security patterns
1604
+ - [@claude-flow/providers](../providers) - Multi-LLM provider system
73
1605
 
74
1606
  ## License
75
1607