@adverant-nexus/cli 2.0.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 (541) hide show
  1. package/ARCHITECTURE.md +1366 -0
  2. package/LICENSE +21 -0
  3. package/README.md +593 -0
  4. package/completions/_nexus +452 -0
  5. package/completions/nexus.bash +329 -0
  6. package/completions/nexus.fish +187 -0
  7. package/dist/cli.d.ts +35 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +135 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/commands/agent/index.d.ts +9 -0
  12. package/dist/commands/agent/index.d.ts.map +1 -0
  13. package/dist/commands/agent/index.js +20 -0
  14. package/dist/commands/agent/index.js.map +1 -0
  15. package/dist/commands/agent/list.d.ts +9 -0
  16. package/dist/commands/agent/list.d.ts.map +1 -0
  17. package/dist/commands/agent/list.js +122 -0
  18. package/dist/commands/agent/list.js.map +1 -0
  19. package/dist/commands/agent/run.d.ts +10 -0
  20. package/dist/commands/agent/run.d.ts.map +1 -0
  21. package/dist/commands/agent/run.js +167 -0
  22. package/dist/commands/agent/run.js.map +1 -0
  23. package/dist/commands/agent/status.d.ts +9 -0
  24. package/dist/commands/agent/status.d.ts.map +1 -0
  25. package/dist/commands/agent/status.js +157 -0
  26. package/dist/commands/agent/status.js.map +1 -0
  27. package/dist/commands/compute/agent.d.ts +21 -0
  28. package/dist/commands/compute/agent.d.ts.map +1 -0
  29. package/dist/commands/compute/agent.js +158 -0
  30. package/dist/commands/compute/agent.js.map +1 -0
  31. package/dist/commands/compute/index.d.ts +10 -0
  32. package/dist/commands/compute/index.d.ts.map +1 -0
  33. package/dist/commands/compute/index.js +27 -0
  34. package/dist/commands/compute/index.js.map +1 -0
  35. package/dist/commands/compute/lib/hardware-detection.d.ts +52 -0
  36. package/dist/commands/compute/lib/hardware-detection.d.ts.map +1 -0
  37. package/dist/commands/compute/lib/hardware-detection.js +432 -0
  38. package/dist/commands/compute/lib/hardware-detection.js.map +1 -0
  39. package/dist/commands/compute/lib/local-compute-agent.d.ts +143 -0
  40. package/dist/commands/compute/lib/local-compute-agent.d.ts.map +1 -0
  41. package/dist/commands/compute/lib/local-compute-agent.js +1162 -0
  42. package/dist/commands/compute/lib/local-compute-agent.js.map +1 -0
  43. package/dist/commands/compute/lib/local-compute-client.d.ts +89 -0
  44. package/dist/commands/compute/lib/local-compute-client.d.ts.map +1 -0
  45. package/dist/commands/compute/lib/local-compute-client.js +388 -0
  46. package/dist/commands/compute/lib/local-compute-client.js.map +1 -0
  47. package/dist/commands/compute/list.d.ts +14 -0
  48. package/dist/commands/compute/list.d.ts.map +1 -0
  49. package/dist/commands/compute/list.js +164 -0
  50. package/dist/commands/compute/list.js.map +1 -0
  51. package/dist/commands/compute/logs.d.ts +14 -0
  52. package/dist/commands/compute/logs.d.ts.map +1 -0
  53. package/dist/commands/compute/logs.js +105 -0
  54. package/dist/commands/compute/logs.js.map +1 -0
  55. package/dist/commands/compute/resources.d.ts +14 -0
  56. package/dist/commands/compute/resources.d.ts.map +1 -0
  57. package/dist/commands/compute/resources.js +163 -0
  58. package/dist/commands/compute/resources.js.map +1 -0
  59. package/dist/commands/compute/status.d.ts +13 -0
  60. package/dist/commands/compute/status.d.ts.map +1 -0
  61. package/dist/commands/compute/status.js +223 -0
  62. package/dist/commands/compute/status.js.map +1 -0
  63. package/dist/commands/compute/submit.d.ts +19 -0
  64. package/dist/commands/compute/submit.d.ts.map +1 -0
  65. package/dist/commands/compute/submit.js +99 -0
  66. package/dist/commands/compute/submit.js.map +1 -0
  67. package/dist/commands/deploy.d.ts +11 -0
  68. package/dist/commands/deploy.d.ts.map +1 -0
  69. package/dist/commands/deploy.js +117 -0
  70. package/dist/commands/deploy.js.map +1 -0
  71. package/dist/commands/dynamic/graphrag-commands.d.ts +16 -0
  72. package/dist/commands/dynamic/graphrag-commands.d.ts.map +1 -0
  73. package/dist/commands/dynamic/graphrag-commands.js +562 -0
  74. package/dist/commands/dynamic/graphrag-commands.js.map +1 -0
  75. package/dist/commands/dynamic/index.d.ts +10 -0
  76. package/dist/commands/dynamic/index.d.ts.map +1 -0
  77. package/dist/commands/dynamic/index.js +17 -0
  78. package/dist/commands/dynamic/index.js.map +1 -0
  79. package/dist/commands/dynamic/mageagent-commands.d.ts +8 -0
  80. package/dist/commands/dynamic/mageagent-commands.d.ts.map +1 -0
  81. package/dist/commands/dynamic/mageagent-commands.js +86 -0
  82. package/dist/commands/dynamic/mageagent-commands.js.map +1 -0
  83. package/dist/commands/dynamic/mcp-tool-mapper.d.ts +97 -0
  84. package/dist/commands/dynamic/mcp-tool-mapper.d.ts.map +1 -0
  85. package/dist/commands/dynamic/mcp-tool-mapper.js +328 -0
  86. package/dist/commands/dynamic/mcp-tool-mapper.js.map +1 -0
  87. package/dist/commands/dynamic/nexus-commands.d.ts +78 -0
  88. package/dist/commands/dynamic/nexus-commands.d.ts.map +1 -0
  89. package/dist/commands/dynamic/nexus-commands.js +426 -0
  90. package/dist/commands/dynamic/nexus-commands.js.map +1 -0
  91. package/dist/commands/dynamic/sandbox-commands.d.ts +8 -0
  92. package/dist/commands/dynamic/sandbox-commands.d.ts.map +1 -0
  93. package/dist/commands/dynamic/sandbox-commands.js +80 -0
  94. package/dist/commands/dynamic/sandbox-commands.js.map +1 -0
  95. package/dist/commands/init.d.ts +11 -0
  96. package/dist/commands/init.d.ts.map +1 -0
  97. package/dist/commands/init.js +128 -0
  98. package/dist/commands/init.js.map +1 -0
  99. package/dist/commands/list.d.ts +10 -0
  100. package/dist/commands/list.d.ts.map +1 -0
  101. package/dist/commands/list.js +81 -0
  102. package/dist/commands/list.js.map +1 -0
  103. package/dist/commands/login.d.ts +10 -0
  104. package/dist/commands/login.d.ts.map +1 -0
  105. package/dist/commands/login.js +83 -0
  106. package/dist/commands/login.js.map +1 -0
  107. package/dist/commands/logs.d.ts +11 -0
  108. package/dist/commands/logs.d.ts.map +1 -0
  109. package/dist/commands/logs.js +79 -0
  110. package/dist/commands/logs.js.map +1 -0
  111. package/dist/commands/nexus/index.d.ts +69 -0
  112. package/dist/commands/nexus/index.d.ts.map +1 -0
  113. package/dist/commands/nexus/index.js +336 -0
  114. package/dist/commands/nexus/index.js.map +1 -0
  115. package/dist/commands/plugin/disable.d.ts +8 -0
  116. package/dist/commands/plugin/disable.d.ts.map +1 -0
  117. package/dist/commands/plugin/disable.js +31 -0
  118. package/dist/commands/plugin/disable.js.map +1 -0
  119. package/dist/commands/plugin/enable.d.ts +8 -0
  120. package/dist/commands/plugin/enable.d.ts.map +1 -0
  121. package/dist/commands/plugin/enable.js +37 -0
  122. package/dist/commands/plugin/enable.js.map +1 -0
  123. package/dist/commands/plugin/index.d.ts +8 -0
  124. package/dist/commands/plugin/index.d.ts.map +1 -0
  125. package/dist/commands/plugin/index.js +23 -0
  126. package/dist/commands/plugin/index.js.map +1 -0
  127. package/dist/commands/plugin/info.d.ts +8 -0
  128. package/dist/commands/plugin/info.d.ts.map +1 -0
  129. package/dist/commands/plugin/info.js +129 -0
  130. package/dist/commands/plugin/info.js.map +1 -0
  131. package/dist/commands/plugin/init.d.ts +8 -0
  132. package/dist/commands/plugin/init.d.ts.map +1 -0
  133. package/dist/commands/plugin/init.js +83 -0
  134. package/dist/commands/plugin/init.js.map +1 -0
  135. package/dist/commands/plugin/install.d.ts +8 -0
  136. package/dist/commands/plugin/install.d.ts.map +1 -0
  137. package/dist/commands/plugin/install.js +56 -0
  138. package/dist/commands/plugin/install.js.map +1 -0
  139. package/dist/commands/plugin/list.d.ts +8 -0
  140. package/dist/commands/plugin/list.d.ts.map +1 -0
  141. package/dist/commands/plugin/list.js +72 -0
  142. package/dist/commands/plugin/list.js.map +1 -0
  143. package/dist/commands/plugin/uninstall.d.ts +8 -0
  144. package/dist/commands/plugin/uninstall.d.ts.map +1 -0
  145. package/dist/commands/plugin/uninstall.js +49 -0
  146. package/dist/commands/plugin/uninstall.js.map +1 -0
  147. package/dist/commands/register.d.ts +10 -0
  148. package/dist/commands/register.d.ts.map +1 -0
  149. package/dist/commands/register.js +85 -0
  150. package/dist/commands/register.js.map +1 -0
  151. package/dist/commands/services/health.d.ts +7 -0
  152. package/dist/commands/services/health.d.ts.map +1 -0
  153. package/dist/commands/services/health.js +73 -0
  154. package/dist/commands/services/health.js.map +1 -0
  155. package/dist/commands/services/index.d.ts +16 -0
  156. package/dist/commands/services/index.d.ts.map +1 -0
  157. package/dist/commands/services/index.js +26 -0
  158. package/dist/commands/services/index.js.map +1 -0
  159. package/dist/commands/services/info.d.ts +7 -0
  160. package/dist/commands/services/info.d.ts.map +1 -0
  161. package/dist/commands/services/info.js +68 -0
  162. package/dist/commands/services/info.js.map +1 -0
  163. package/dist/commands/services/list.d.ts +9 -0
  164. package/dist/commands/services/list.d.ts.map +1 -0
  165. package/dist/commands/services/list.js +43 -0
  166. package/dist/commands/services/list.js.map +1 -0
  167. package/dist/commands/services/logs.d.ts +7 -0
  168. package/dist/commands/services/logs.d.ts.map +1 -0
  169. package/dist/commands/services/logs.js +107 -0
  170. package/dist/commands/services/logs.js.map +1 -0
  171. package/dist/commands/services/ports.d.ts +7 -0
  172. package/dist/commands/services/ports.d.ts.map +1 -0
  173. package/dist/commands/services/ports.js +65 -0
  174. package/dist/commands/services/ports.js.map +1 -0
  175. package/dist/commands/services/restart.d.ts +7 -0
  176. package/dist/commands/services/restart.d.ts.map +1 -0
  177. package/dist/commands/services/restart.js +67 -0
  178. package/dist/commands/services/restart.js.map +1 -0
  179. package/dist/commands/services/start.d.ts +7 -0
  180. package/dist/commands/services/start.d.ts.map +1 -0
  181. package/dist/commands/services/start.js +67 -0
  182. package/dist/commands/services/start.js.map +1 -0
  183. package/dist/commands/services/status.d.ts +9 -0
  184. package/dist/commands/services/status.d.ts.map +1 -0
  185. package/dist/commands/services/status.js +119 -0
  186. package/dist/commands/services/status.js.map +1 -0
  187. package/dist/commands/services/stop.d.ts +7 -0
  188. package/dist/commands/services/stop.d.ts.map +1 -0
  189. package/dist/commands/services/stop.js +67 -0
  190. package/dist/commands/services/stop.js.map +1 -0
  191. package/dist/commands/session/delete.d.ts +9 -0
  192. package/dist/commands/session/delete.d.ts.map +1 -0
  193. package/dist/commands/session/delete.js +51 -0
  194. package/dist/commands/session/delete.js.map +1 -0
  195. package/dist/commands/session/export.d.ts +9 -0
  196. package/dist/commands/session/export.d.ts.map +1 -0
  197. package/dist/commands/session/export.js +36 -0
  198. package/dist/commands/session/export.js.map +1 -0
  199. package/dist/commands/session/import.d.ts +9 -0
  200. package/dist/commands/session/import.d.ts.map +1 -0
  201. package/dist/commands/session/import.js +54 -0
  202. package/dist/commands/session/import.js.map +1 -0
  203. package/dist/commands/session/index.d.ts +9 -0
  204. package/dist/commands/session/index.d.ts.map +1 -0
  205. package/dist/commands/session/index.js +28 -0
  206. package/dist/commands/session/index.js.map +1 -0
  207. package/dist/commands/session/list.d.ts +9 -0
  208. package/dist/commands/session/list.d.ts.map +1 -0
  209. package/dist/commands/session/list.js +88 -0
  210. package/dist/commands/session/list.js.map +1 -0
  211. package/dist/commands/session/load.d.ts +9 -0
  212. package/dist/commands/session/load.d.ts.map +1 -0
  213. package/dist/commands/session/load.js +71 -0
  214. package/dist/commands/session/load.js.map +1 -0
  215. package/dist/commands/session/resume.d.ts +9 -0
  216. package/dist/commands/session/resume.d.ts.map +1 -0
  217. package/dist/commands/session/resume.js +49 -0
  218. package/dist/commands/session/resume.js.map +1 -0
  219. package/dist/commands/session/save.d.ts +9 -0
  220. package/dist/commands/session/save.d.ts.map +1 -0
  221. package/dist/commands/session/save.js +69 -0
  222. package/dist/commands/session/save.js.map +1 -0
  223. package/dist/commands/workspace/git-commit.d.ts +9 -0
  224. package/dist/commands/workspace/git-commit.d.ts.map +1 -0
  225. package/dist/commands/workspace/git-commit.js +156 -0
  226. package/dist/commands/workspace/git-commit.js.map +1 -0
  227. package/dist/commands/workspace/git-status.d.ts +9 -0
  228. package/dist/commands/workspace/git-status.d.ts.map +1 -0
  229. package/dist/commands/workspace/git-status.js +192 -0
  230. package/dist/commands/workspace/git-status.js.map +1 -0
  231. package/dist/commands/workspace/index.d.ts +9 -0
  232. package/dist/commands/workspace/index.d.ts.map +1 -0
  233. package/dist/commands/workspace/index.js +24 -0
  234. package/dist/commands/workspace/index.js.map +1 -0
  235. package/dist/commands/workspace/info.d.ts +10 -0
  236. package/dist/commands/workspace/info.d.ts.map +1 -0
  237. package/dist/commands/workspace/info.js +191 -0
  238. package/dist/commands/workspace/info.js.map +1 -0
  239. package/dist/commands/workspace/init.d.ts +9 -0
  240. package/dist/commands/workspace/init.d.ts.map +1 -0
  241. package/dist/commands/workspace/init.js +193 -0
  242. package/dist/commands/workspace/init.js.map +1 -0
  243. package/dist/commands/workspace/validate.d.ts +9 -0
  244. package/dist/commands/workspace/validate.d.ts.map +1 -0
  245. package/dist/commands/workspace/validate.js +140 -0
  246. package/dist/commands/workspace/validate.js.map +1 -0
  247. package/dist/core/agent-client.d.ts +49 -0
  248. package/dist/core/agent-client.d.ts.map +1 -0
  249. package/dist/core/agent-client.js +289 -0
  250. package/dist/core/agent-client.js.map +1 -0
  251. package/dist/core/config/config-manager.d.ts +75 -0
  252. package/dist/core/config/config-manager.d.ts.map +1 -0
  253. package/dist/core/config/config-manager.js +379 -0
  254. package/dist/core/config/config-manager.js.map +1 -0
  255. package/dist/core/config/profile-manager.d.ts +76 -0
  256. package/dist/core/config/profile-manager.d.ts.map +1 -0
  257. package/dist/core/config/profile-manager.js +250 -0
  258. package/dist/core/config/profile-manager.js.map +1 -0
  259. package/dist/core/config/workspace-detector.d.ts +66 -0
  260. package/dist/core/config/workspace-detector.d.ts.map +1 -0
  261. package/dist/core/config/workspace-detector.js +291 -0
  262. package/dist/core/config/workspace-detector.js.map +1 -0
  263. package/dist/core/discovery/docker-parser.d.ts +27 -0
  264. package/dist/core/discovery/docker-parser.d.ts.map +1 -0
  265. package/dist/core/discovery/docker-parser.js +361 -0
  266. package/dist/core/discovery/docker-parser.js.map +1 -0
  267. package/dist/core/discovery/index.d.ts +11 -0
  268. package/dist/core/discovery/index.d.ts.map +1 -0
  269. package/dist/core/discovery/index.js +16 -0
  270. package/dist/core/discovery/index.js.map +1 -0
  271. package/dist/core/discovery/mcp-discovery.d.ts +41 -0
  272. package/dist/core/discovery/mcp-discovery.d.ts.map +1 -0
  273. package/dist/core/discovery/mcp-discovery.js +439 -0
  274. package/dist/core/discovery/mcp-discovery.js.map +1 -0
  275. package/dist/core/discovery/openapi-parser.d.ts +95 -0
  276. package/dist/core/discovery/openapi-parser.d.ts.map +1 -0
  277. package/dist/core/discovery/openapi-parser.js +353 -0
  278. package/dist/core/discovery/openapi-parser.js.map +1 -0
  279. package/dist/core/discovery/plugin-discovery.d.ts +63 -0
  280. package/dist/core/discovery/plugin-discovery.d.ts.map +1 -0
  281. package/dist/core/discovery/plugin-discovery.js +333 -0
  282. package/dist/core/discovery/plugin-discovery.js.map +1 -0
  283. package/dist/core/discovery/service-discovery.d.ts +107 -0
  284. package/dist/core/discovery/service-discovery.d.ts.map +1 -0
  285. package/dist/core/discovery/service-discovery.js +349 -0
  286. package/dist/core/discovery/service-discovery.js.map +1 -0
  287. package/dist/core/nexus-client.d.ts +119 -0
  288. package/dist/core/nexus-client.d.ts.map +1 -0
  289. package/dist/core/nexus-client.js +292 -0
  290. package/dist/core/nexus-client.js.map +1 -0
  291. package/dist/core/nexus-tool-executor.d.ts +102 -0
  292. package/dist/core/nexus-tool-executor.d.ts.map +1 -0
  293. package/dist/core/nexus-tool-executor.js +386 -0
  294. package/dist/core/nexus-tool-executor.js.map +1 -0
  295. package/dist/core/react-handler.d.ts +17 -0
  296. package/dist/core/react-handler.d.ts.map +1 -0
  297. package/dist/core/react-handler.js +296 -0
  298. package/dist/core/react-handler.js.map +1 -0
  299. package/dist/core/router/command-registry.d.ts +61 -0
  300. package/dist/core/router/command-registry.d.ts.map +1 -0
  301. package/dist/core/router/command-registry.js +138 -0
  302. package/dist/core/router/command-registry.js.map +1 -0
  303. package/dist/core/router/command-router.d.ts +33 -0
  304. package/dist/core/router/command-router.d.ts.map +1 -0
  305. package/dist/core/router/command-router.js +111 -0
  306. package/dist/core/router/command-router.js.map +1 -0
  307. package/dist/core/router/index.d.ts +9 -0
  308. package/dist/core/router/index.d.ts.map +1 -0
  309. package/dist/core/router/index.js +8 -0
  310. package/dist/core/router/index.js.map +1 -0
  311. package/dist/core/session/context-manager.d.ts +69 -0
  312. package/dist/core/session/context-manager.d.ts.map +1 -0
  313. package/dist/core/session/context-manager.js +109 -0
  314. package/dist/core/session/context-manager.js.map +1 -0
  315. package/dist/core/session/history-manager.d.ts +72 -0
  316. package/dist/core/session/history-manager.d.ts.map +1 -0
  317. package/dist/core/session/history-manager.js +175 -0
  318. package/dist/core/session/history-manager.js.map +1 -0
  319. package/dist/core/session/index.d.ts +9 -0
  320. package/dist/core/session/index.d.ts.map +1 -0
  321. package/dist/core/session/index.js +9 -0
  322. package/dist/core/session/index.js.map +1 -0
  323. package/dist/core/session/session-manager.d.ts +50 -0
  324. package/dist/core/session/session-manager.d.ts.map +1 -0
  325. package/dist/core/session/session-manager.js +200 -0
  326. package/dist/core/session/session-manager.js.map +1 -0
  327. package/dist/core/session/session-storage.d.ts +59 -0
  328. package/dist/core/session/session-storage.d.ts.map +1 -0
  329. package/dist/core/session/session-storage.js +226 -0
  330. package/dist/core/session/session-storage.js.map +1 -0
  331. package/dist/core/transport/http-client.d.ts +27 -0
  332. package/dist/core/transport/http-client.d.ts.map +1 -0
  333. package/dist/core/transport/http-client.js +182 -0
  334. package/dist/core/transport/http-client.js.map +1 -0
  335. package/dist/core/transport/index.d.ts +11 -0
  336. package/dist/core/transport/index.d.ts.map +1 -0
  337. package/dist/core/transport/index.js +10 -0
  338. package/dist/core/transport/index.js.map +1 -0
  339. package/dist/core/transport/mcp-client.d.ts +69 -0
  340. package/dist/core/transport/mcp-client.d.ts.map +1 -0
  341. package/dist/core/transport/mcp-client.js +252 -0
  342. package/dist/core/transport/mcp-client.js.map +1 -0
  343. package/dist/core/transport/stream-handler.d.ts +51 -0
  344. package/dist/core/transport/stream-handler.d.ts.map +1 -0
  345. package/dist/core/transport/stream-handler.js +264 -0
  346. package/dist/core/transport/stream-handler.js.map +1 -0
  347. package/dist/core/transport/websocket-client.d.ts +66 -0
  348. package/dist/core/transport/websocket-client.d.ts.map +1 -0
  349. package/dist/core/transport/websocket-client.js +232 -0
  350. package/dist/core/transport/websocket-client.js.map +1 -0
  351. package/dist/index.d.ts +9 -0
  352. package/dist/index.d.ts.map +1 -0
  353. package/dist/index.js +106 -0
  354. package/dist/index.js.map +1 -0
  355. package/dist/output/formatters/index.d.ts +9 -0
  356. package/dist/output/formatters/index.d.ts.map +1 -0
  357. package/dist/output/formatters/index.js +9 -0
  358. package/dist/output/formatters/index.js.map +1 -0
  359. package/dist/output/formatters/json-formatter.d.ts +71 -0
  360. package/dist/output/formatters/json-formatter.d.ts.map +1 -0
  361. package/dist/output/formatters/json-formatter.js +236 -0
  362. package/dist/output/formatters/json-formatter.js.map +1 -0
  363. package/dist/output/formatters/stream-formatter.d.ts +107 -0
  364. package/dist/output/formatters/stream-formatter.d.ts.map +1 -0
  365. package/dist/output/formatters/stream-formatter.js +247 -0
  366. package/dist/output/formatters/stream-formatter.js.map +1 -0
  367. package/dist/output/formatters/table-formatter.d.ts +63 -0
  368. package/dist/output/formatters/table-formatter.d.ts.map +1 -0
  369. package/dist/output/formatters/table-formatter.js +294 -0
  370. package/dist/output/formatters/table-formatter.js.map +1 -0
  371. package/dist/output/formatters/text-formatter.d.ts +63 -0
  372. package/dist/output/formatters/text-formatter.d.ts.map +1 -0
  373. package/dist/output/formatters/text-formatter.js +202 -0
  374. package/dist/output/formatters/text-formatter.js.map +1 -0
  375. package/dist/output/formatters/yaml-formatter.d.ts +71 -0
  376. package/dist/output/formatters/yaml-formatter.d.ts.map +1 -0
  377. package/dist/output/formatters/yaml-formatter.js +239 -0
  378. package/dist/output/formatters/yaml-formatter.js.map +1 -0
  379. package/dist/output/index.d.ts +7 -0
  380. package/dist/output/index.d.ts.map +1 -0
  381. package/dist/output/index.js +7 -0
  382. package/dist/output/index.js.map +1 -0
  383. package/dist/output/output-manager.d.ts +156 -0
  384. package/dist/output/output-manager.d.ts.map +1 -0
  385. package/dist/output/output-manager.js +339 -0
  386. package/dist/output/output-manager.js.map +1 -0
  387. package/dist/output/renderers/index.d.ts +6 -0
  388. package/dist/output/renderers/index.d.ts.map +1 -0
  389. package/dist/output/renderers/index.js +6 -0
  390. package/dist/output/renderers/index.js.map +1 -0
  391. package/dist/output/renderers/progress-renderer.d.ts +56 -0
  392. package/dist/output/renderers/progress-renderer.d.ts.map +1 -0
  393. package/dist/output/renderers/progress-renderer.js +306 -0
  394. package/dist/output/renderers/progress-renderer.js.map +1 -0
  395. package/dist/output/renderers/terminal-renderer.d.ts +117 -0
  396. package/dist/output/renderers/terminal-renderer.d.ts.map +1 -0
  397. package/dist/output/renderers/terminal-renderer.js +294 -0
  398. package/dist/output/renderers/terminal-renderer.js.map +1 -0
  399. package/dist/plugins/index.d.ts +12 -0
  400. package/dist/plugins/index.d.ts.map +1 -0
  401. package/dist/plugins/index.js +18 -0
  402. package/dist/plugins/index.js.map +1 -0
  403. package/dist/plugins/plugin-loader.d.ts +37 -0
  404. package/dist/plugins/plugin-loader.d.ts.map +1 -0
  405. package/dist/plugins/plugin-loader.js +155 -0
  406. package/dist/plugins/plugin-loader.js.map +1 -0
  407. package/dist/plugins/plugin-manager.d.ts +78 -0
  408. package/dist/plugins/plugin-manager.d.ts.map +1 -0
  409. package/dist/plugins/plugin-manager.js +310 -0
  410. package/dist/plugins/plugin-manager.js.map +1 -0
  411. package/dist/plugins/plugin-sdk.d.ts +136 -0
  412. package/dist/plugins/plugin-sdk.d.ts.map +1 -0
  413. package/dist/plugins/plugin-sdk.js +260 -0
  414. package/dist/plugins/plugin-sdk.js.map +1 -0
  415. package/dist/plugins/plugin-storage.d.ts +109 -0
  416. package/dist/plugins/plugin-storage.d.ts.map +1 -0
  417. package/dist/plugins/plugin-storage.js +207 -0
  418. package/dist/plugins/plugin-storage.js.map +1 -0
  419. package/dist/plugins/plugin-validator.d.ts +44 -0
  420. package/dist/plugins/plugin-validator.d.ts.map +1 -0
  421. package/dist/plugins/plugin-validator.js +272 -0
  422. package/dist/plugins/plugin-validator.js.map +1 -0
  423. package/dist/plugins/template-generator.d.ts +35 -0
  424. package/dist/plugins/template-generator.d.ts.map +1 -0
  425. package/dist/plugins/template-generator.js +438 -0
  426. package/dist/plugins/template-generator.js.map +1 -0
  427. package/dist/repl/completer.d.ts +58 -0
  428. package/dist/repl/completer.d.ts.map +1 -0
  429. package/dist/repl/completer.js +198 -0
  430. package/dist/repl/completer.js.map +1 -0
  431. package/dist/repl/evaluator.d.ts +55 -0
  432. package/dist/repl/evaluator.d.ts.map +1 -0
  433. package/dist/repl/evaluator.js +299 -0
  434. package/dist/repl/evaluator.js.map +1 -0
  435. package/dist/repl/index.d.ts +10 -0
  436. package/dist/repl/index.d.ts.map +1 -0
  437. package/dist/repl/index.js +10 -0
  438. package/dist/repl/index.js.map +1 -0
  439. package/dist/repl/renderer.d.ts +77 -0
  440. package/dist/repl/renderer.d.ts.map +1 -0
  441. package/dist/repl/renderer.js +291 -0
  442. package/dist/repl/renderer.js.map +1 -0
  443. package/dist/repl/repl.d.ts +89 -0
  444. package/dist/repl/repl.d.ts.map +1 -0
  445. package/dist/repl/repl.js +339 -0
  446. package/dist/repl/repl.js.map +1 -0
  447. package/dist/templates/python.d.ts +15 -0
  448. package/dist/templates/python.d.ts.map +1 -0
  449. package/dist/templates/python.js +375 -0
  450. package/dist/templates/python.js.map +1 -0
  451. package/dist/templates/typescript.d.ts +15 -0
  452. package/dist/templates/typescript.d.ts.map +1 -0
  453. package/dist/templates/typescript.js +274 -0
  454. package/dist/templates/typescript.js.map +1 -0
  455. package/dist/types/agent.d.ts +109 -0
  456. package/dist/types/agent.d.ts.map +1 -0
  457. package/dist/types/agent.js +7 -0
  458. package/dist/types/agent.js.map +1 -0
  459. package/dist/types/api.d.ts +125 -0
  460. package/dist/types/api.d.ts.map +1 -0
  461. package/dist/types/api.js +53 -0
  462. package/dist/types/api.js.map +1 -0
  463. package/dist/types/command.d.ts +101 -0
  464. package/dist/types/command.d.ts.map +1 -0
  465. package/dist/types/command.js +7 -0
  466. package/dist/types/command.js.map +1 -0
  467. package/dist/types/compute.d.ts +317 -0
  468. package/dist/types/compute.d.ts.map +1 -0
  469. package/dist/types/compute.js +19 -0
  470. package/dist/types/compute.js.map +1 -0
  471. package/dist/types/config.d.ts +71 -0
  472. package/dist/types/config.d.ts.map +1 -0
  473. package/dist/types/config.js +7 -0
  474. package/dist/types/config.js.map +1 -0
  475. package/dist/types/errors.d.ts +56 -0
  476. package/dist/types/errors.d.ts.map +1 -0
  477. package/dist/types/errors.js +64 -0
  478. package/dist/types/errors.js.map +1 -0
  479. package/dist/types/index.d.ts +16 -0
  480. package/dist/types/index.d.ts.map +1 -0
  481. package/dist/types/index.js +16 -0
  482. package/dist/types/index.js.map +1 -0
  483. package/dist/types/nexus.d.ts +254 -0
  484. package/dist/types/nexus.d.ts.map +1 -0
  485. package/dist/types/nexus.js +7 -0
  486. package/dist/types/nexus.js.map +1 -0
  487. package/dist/types/output.d.ts +107 -0
  488. package/dist/types/output.d.ts.map +1 -0
  489. package/dist/types/output.js +7 -0
  490. package/dist/types/output.js.map +1 -0
  491. package/dist/types/plugin.d.ts +118 -0
  492. package/dist/types/plugin.d.ts.map +1 -0
  493. package/dist/types/plugin.js +7 -0
  494. package/dist/types/plugin.js.map +1 -0
  495. package/dist/types/service.d.ts +94 -0
  496. package/dist/types/service.d.ts.map +1 -0
  497. package/dist/types/service.js +15 -0
  498. package/dist/types/service.js.map +1 -0
  499. package/dist/types/session.d.ts +80 -0
  500. package/dist/types/session.d.ts.map +1 -0
  501. package/dist/types/session.js +7 -0
  502. package/dist/types/session.js.map +1 -0
  503. package/dist/types/transport.d.ts +96 -0
  504. package/dist/types/transport.d.ts.map +1 -0
  505. package/dist/types/transport.js +7 -0
  506. package/dist/types/transport.js.map +1 -0
  507. package/dist/utils/config.d.ts +47 -0
  508. package/dist/utils/config.d.ts.map +1 -0
  509. package/dist/utils/config.js +166 -0
  510. package/dist/utils/config.js.map +1 -0
  511. package/dist/utils/error-handler.d.ts +82 -0
  512. package/dist/utils/error-handler.d.ts.map +1 -0
  513. package/dist/utils/error-handler.js +238 -0
  514. package/dist/utils/error-handler.js.map +1 -0
  515. package/dist/utils/index.d.ts +9 -0
  516. package/dist/utils/index.d.ts.map +1 -0
  517. package/dist/utils/index.js +9 -0
  518. package/dist/utils/index.js.map +1 -0
  519. package/dist/utils/logger.d.ts +61 -0
  520. package/dist/utils/logger.d.ts.map +1 -0
  521. package/dist/utils/logger.js +200 -0
  522. package/dist/utils/logger.js.map +1 -0
  523. package/dist/utils/prompt.d.ts +57 -0
  524. package/dist/utils/prompt.d.ts.map +1 -0
  525. package/dist/utils/prompt.js +141 -0
  526. package/dist/utils/prompt.js.map +1 -0
  527. package/dist/utils/spinner.d.ts +47 -0
  528. package/dist/utils/spinner.d.ts.map +1 -0
  529. package/dist/utils/spinner.js +123 -0
  530. package/dist/utils/spinner.js.map +1 -0
  531. package/dist/utils/validation.d.ts +97 -0
  532. package/dist/utils/validation.d.ts.map +1 -0
  533. package/dist/utils/validation.js +289 -0
  534. package/dist/utils/validation.js.map +1 -0
  535. package/docs/COMPLETIONS.md +528 -0
  536. package/docs/REPL.md +466 -0
  537. package/docs/graphrag-commands.md +387 -0
  538. package/package.json +154 -0
  539. package/scripts/install-completions.sh +356 -0
  540. package/scripts/prepublish.js +522 -0
  541. package/scripts/verify-package.js +505 -0
@@ -0,0 +1,1366 @@
1
+ # Adverant-Nexus CLI Architecture
2
+
3
+ **Version**: 2.0.0
4
+ **Goal**: Build a production-grade CLI that surpasses Claude Code CLI and Gemini CLI
5
+
6
+ ---
7
+
8
+ ## Design Philosophy
9
+
10
+ The Adverant-Nexus CLI is designed with these core principles:
11
+
12
+ 1. **Auto-Discovery**: Automatically discovers and integrates with all microservices and plugins
13
+ 2. **Future-Proof**: New services and plugins are automatically supported without code changes
14
+ 3. **Unified Interface**: Single CLI for all 32+ microservices, 500+ API endpoints
15
+ 4. **Developer-First**: Optimized for both interactive exploration and scripting/automation
16
+ 5. **Extensible**: Plugin system allows third-party extensions
17
+ 6. **Intelligent**: Built-in ReAct loop for autonomous task execution
18
+
19
+ ---
20
+
21
+ ## Architecture Overview
22
+
23
+ ```
24
+ ┌─────────────────────────────────────────────────────────────────┐
25
+ │ Adverant-Nexus CLI (nexus) │
26
+ ├─────────────────────────────────────────────────────────────────┤
27
+ │ │
28
+ │ ┌───────────────┐ ┌──────────────┐ ┌──────────────────┐ │
29
+ │ │ Interactive │ │ Scripting │ │ Autonomous │ │
30
+ │ │ REPL Mode │ │ Mode │ │ Agent Mode │ │
31
+ │ └───────┬───────┘ └──────┬───────┘ └────────┬─────────┘ │
32
+ │ │ │ │ │
33
+ │ └──────────────────┴────────────────────┘ │
34
+ │ │ │
35
+ │ ┌─────────▼───────────┐ │
36
+ │ │ Command Router │ │
37
+ │ │ (Auto-Discovery) │ │
38
+ │ └─────────┬───────────┘ │
39
+ │ │ │
40
+ │ ┌────────────────────┼────────────────────┐ │
41
+ │ │ │ │ │
42
+ │ ┌──────▼────────┐ ┌───────▼────────┐ ┌───────▼────────┐ │
43
+ │ │ Service │ │ Nexus MCP │ │ Plugin │ │
44
+ │ │ Commands │ │ Commands │ │ Commands │ │
45
+ │ │ (32 svcs) │ │ (70+ tools) │ │ (Dynamic) │ │
46
+ │ └──────┬────────┘ └───────┬────────┘ └───────┬────────┘ │
47
+ │ │ │ │ │
48
+ │ └────────────────────┼────────────────────┘ │
49
+ │ │ │
50
+ │ ┌─────────▼───────────┐ │
51
+ │ │ Transport Layer │ │
52
+ │ │ HTTP | WS | MCP │ │
53
+ │ └─────────┬───────────┘ │
54
+ └──────────────────────────────┼──────────────────────────────────┘
55
+
56
+ ┌──────────▼───────────┐
57
+ │ Adverant-Nexus │
58
+ │ Microservices │
59
+ │ (32+ services) │
60
+ └──────────────────────┘
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Core Components
66
+
67
+ ### 1. Command Router (Auto-Discovery Engine)
68
+
69
+ **Responsibilities:**
70
+ - Scan docker-compose.yml to discover all services
71
+ - Query service /health and /openapi endpoints for API schemas
72
+ - Auto-generate command namespaces from service metadata
73
+ - Dynamically load plugin commands from ~/.nexus/plugins/
74
+ - Route commands to appropriate handlers
75
+
76
+ **Discovery Sources:**
77
+ ```typescript
78
+ interface DiscoverySource {
79
+ dockerCompose: {
80
+ path: string[]; // Multiple compose files
81
+ services: ServiceMetadata[]; // Parsed services
82
+ };
83
+ serviceSchemas: {
84
+ openapi: OpenAPISpec[]; // Auto-discovered OpenAPI schemas
85
+ graphql: GraphQLSchema[]; // Auto-discovered GraphQL schemas
86
+ };
87
+ mcpTools: {
88
+ tools: MCPToolDefinition[]; // From nexus-mcp-server
89
+ count: number; // 70+ Nexus tools
90
+ };
91
+ plugins: {
92
+ local: Plugin[]; // From ~/.nexus/plugins/
93
+ registered: Plugin[]; // From plugin registry
94
+ };
95
+ }
96
+ ```
97
+
98
+ **Auto-Generation Strategy:**
99
+ 1. **Service Commands**: `nexus <service> <action> [args]`
100
+ - Example: `nexus graphrag store-document --file report.pdf`
101
+ - Example: `nexus mageagent orchestrate --task "Build a web scraper"`
102
+
103
+ 2. **Nexus MCP Commands**: `nexus nexus <tool-name> [args]`
104
+ - Example: `nexus nexus recall-memory --query "typescript patterns"`
105
+ - Example: `nexus nexus code-validate --file app.ts --risk-level high`
106
+
107
+ 3. **Plugin Commands**: `nexus plugin <plugin-name> <action> [args]`
108
+ - Example: `nexus plugin my-custom-tool analyze --input data.json`
109
+
110
+ ### 2. Service Commands (Namespace per Service)
111
+
112
+ **Structure:**
113
+ ```
114
+ nexus/
115
+ ├── commands/
116
+ │ ├── graphrag/ # GraphRAG service commands
117
+ │ │ ├── store-document.ts
118
+ │ │ ├── query.ts
119
+ │ │ ├── store-entity.ts
120
+ │ │ └── index.ts
121
+ │ ├── mageagent/ # MageAgent service commands
122
+ │ │ ├── orchestrate.ts
123
+ │ │ ├── analyze.ts
124
+ │ │ ├── validate.ts
125
+ │ │ └── index.ts
126
+ │ ├── sandbox/ # Sandbox service commands
127
+ │ │ ├── execute.ts
128
+ │ │ ├── list-languages.ts
129
+ │ │ └── index.ts
130
+ │ ├── videoagent/ # VideoAgent service commands
131
+ │ ├── geoagent/ # GeoAgent service commands
132
+ │ ├── orchestration/ # OrchestrationAgent commands
133
+ │ ├── learning/ # LearningAgent commands
134
+ │ ├── robotics/ # NexusRobotics commands
135
+ │ └── ... (32 total service namespaces)
136
+ ```
137
+
138
+ **Auto-Generated from OpenAPI:**
139
+ Each service with an OpenAPI spec gets commands auto-generated:
140
+ ```typescript
141
+ // Example: GraphRAG /documents endpoint → nexus graphrag store-document
142
+ interface ServiceCommand {
143
+ name: string; // "store-document"
144
+ namespace: string; // "graphrag"
145
+ endpoint: string; // "POST /documents"
146
+ params: ParameterSchema[]; // Auto-generated from OpenAPI
147
+ examples: string[]; // Generated examples
148
+ streaming: boolean; // WebSocket support
149
+ }
150
+ ```
151
+
152
+ ### 3. Nexus MCP Commands
153
+
154
+ **All 70+ Nexus Tools Exposed:**
155
+ ```bash
156
+ # Memory Operations
157
+ nexus nexus store-memory --content "..." --tags "tag1,tag2"
158
+ nexus nexus recall-memory --query "search query" --limit 10
159
+ nexus nexus store-document --file report.pdf --title "..."
160
+ nexus nexus retrieve --query "..." --strategy semantic_chunks
161
+
162
+ # Knowledge Graph
163
+ nexus nexus store-entity --domain code --type class --content "..."
164
+ nexus nexus query-entities --domain code --search "User"
165
+ nexus nexus create-relationship --source id1 --target id2 --type REFERENCES
166
+
167
+ # Code Analysis
168
+ nexus nexus validate-code --file app.ts --risk-level high --wait
169
+ nexus nexus analyze-code --file app.ts --depth deep --focus security,performance
170
+ nexus nexus validate-command --command "rm -rf /" --cwd /tmp
171
+
172
+ # Multi-Agent Orchestration
173
+ nexus nexus orchestrate --task "Analyze codebase for security issues" --max-agents 5
174
+ nexus nexus get-suggestions --context-id ctx_123
175
+
176
+ # Learning System
177
+ nexus nexus trigger-learning --topic "rust_async" --priority 9
178
+ nexus nexus recall-knowledge --topic "typescript_patterns" --layer EXPERT
179
+
180
+ # Episodes
181
+ nexus nexus store-episode --content "Fixed memory leak" --type insight
182
+ nexus nexus recall-episodes --query "refactoring sessions" --limit 10
183
+
184
+ # Health & Status
185
+ nexus nexus health --detailed
186
+ nexus nexus ingestion-status --job-id job_123
187
+ ```
188
+
189
+ ### 4. Plugin System
190
+
191
+ **Plugin Architecture:**
192
+ ```typescript
193
+ interface NexusPlugin {
194
+ name: string;
195
+ version: string;
196
+ description: string;
197
+ author: string;
198
+
199
+ // Plugin metadata
200
+ commands: PluginCommand[]; // Commands exposed by plugin
201
+ dependencies: string[]; // Required services
202
+ permissions: Permission[]; // What plugin can access
203
+
204
+ // Lifecycle hooks
205
+ onLoad?: () => Promise<void>;
206
+ onUnload?: () => Promise<void>;
207
+ onCommand?: (cmd: Command) => Promise<Result>;
208
+
209
+ // MCP integration
210
+ mcpServer?: MCPServerConfig; // Optional MCP server
211
+ }
212
+
213
+ interface PluginCommand {
214
+ name: string;
215
+ description: string;
216
+ args: ArgumentSchema[];
217
+ handler: (args: any, context: Context) => Promise<any>;
218
+ }
219
+ ```
220
+
221
+ **Plugin Discovery:**
222
+ ```
223
+ ~/.nexus/
224
+ ├── plugins/
225
+ │ ├── my-custom-plugin/
226
+ │ │ ├── plugin.json # Plugin manifest
227
+ │ │ ├── commands/ # Command implementations
228
+ │ │ └── mcp/ # Optional MCP server
229
+ │ └── another-plugin/
230
+ └── config.toml # Global CLI config
231
+ ```
232
+
233
+ **Plugin Loading:**
234
+ 1. Scan ~/.nexus/plugins/ for plugin.json manifests
235
+ 2. Validate plugin permissions and dependencies
236
+ 3. Dynamically load command handlers
237
+ 4. Register commands in router
238
+ 5. Start MCP servers if defined
239
+
240
+ ### 5. Interactive REPL Mode
241
+
242
+ **Features:**
243
+ - **Tab Completion**: Auto-complete for all commands, services, and options
244
+ - **Command History**: Up/down arrows for history navigation
245
+ - **Context Awareness**: Remembers workspace, current service, etc.
246
+ - **Multiline Input**: Support for complex queries
247
+ - **Rich Output**: Tables, JSON, YAML, streaming progress
248
+ - **Session Checkpointing**: Save/resume sessions
249
+
250
+ **REPL Commands:**
251
+ ```bash
252
+ nexus repl # Start interactive mode
253
+
254
+ # Inside REPL:
255
+ > help # Show all commands
256
+ > services # List all discovered services
257
+ > use graphrag # Switch to graphrag namespace
258
+ > store-document --file x.pdf # Execute in current namespace
259
+ > history # Show command history
260
+ > save session-1 # Save current session
261
+ > load session-1 # Resume saved session
262
+ > config show # Show current configuration
263
+ > plugins list # List installed plugins
264
+ > exit # Exit REPL
265
+ ```
266
+
267
+ ### 6. Scripting Mode
268
+
269
+ **Headless Execution for CI/CD:**
270
+ ```bash
271
+ # Non-interactive execution
272
+ nexus graphrag store-document --file report.pdf --title "Q4 Report"
273
+
274
+ # JSON output for parsing
275
+ nexus mageagent orchestrate \
276
+ --task "Analyze codebase" \
277
+ --output-format json \
278
+ > result.json
279
+
280
+ # Streaming JSON for real-time monitoring
281
+ nexus videoagent process-video \
282
+ --url "video.mp4" \
283
+ --output-format stream-json \
284
+ | jq '.progress'
285
+
286
+ # Pipe-friendly operations
287
+ cat files.txt | xargs -I {} nexus graphrag store-document --file {}
288
+
289
+ # Environment variable configuration
290
+ NEXUS_API_URL=http://localhost:9092 \
291
+ NEXUS_API_KEY=key_123 \
292
+ nexus mageagent orchestrate --task "..."
293
+
294
+ # Exit codes for error handling
295
+ nexus sandbox execute --code "print('hello')" --language python
296
+ echo $? # 0 = success, non-zero = error
297
+ ```
298
+
299
+ ### 7. Autonomous Agent Mode
300
+
301
+ **ReAct Loop Integration:**
302
+ ```bash
303
+ # Autonomous task execution with ReAct loop
304
+ nexus agent run --task "Fix all TypeScript errors in the project"
305
+
306
+ # With constraints
307
+ nexus agent run \
308
+ --task "Implement user authentication" \
309
+ --max-iterations 20 \
310
+ --budget 50 \
311
+ --workspace /path/to/project \
312
+ --approve-commands # Auto-approve safe commands
313
+
314
+ # Interactive approval mode (default)
315
+ nexus agent run --task "Refactor database schema"
316
+ # Prompts for approval at each step
317
+
318
+ # Streaming progress
319
+ nexus agent run \
320
+ --task "Analyze security vulnerabilities" \
321
+ --stream \
322
+ --output-format stream-json
323
+ ```
324
+
325
+ **ReAct Implementation:**
326
+ - Uses OrchestrationAgent (port 9109) for autonomous execution
327
+ - 20-iteration ReAct loop with thought-action-observation
328
+ - Integrated with all 70+ Nexus tools
329
+ - Codebase-aware planning
330
+ - Real-time streaming updates via WebSocket
331
+
332
+ ### 8. Service Management Commands
333
+
334
+ **Infrastructure Control:**
335
+ ```bash
336
+ # Service discovery
337
+ nexus services list # List all discovered services
338
+ nexus services status # Health status of all services
339
+ nexus services info <service> # Detailed service info
340
+
341
+ # Container management (via docker-compose)
342
+ nexus services start [service] # Start service(s)
343
+ nexus services stop [service] # Stop service(s)
344
+ nexus services restart [service] # Restart service(s)
345
+ nexus services logs <service> [--follow] # View service logs
346
+
347
+ # Health monitoring
348
+ nexus services health --all # Check all service health
349
+ nexus services health graphrag # Check specific service
350
+ nexus services ping <service> # Quick ping test
351
+
352
+ # Port mapping
353
+ nexus services ports # Show all port mappings
354
+ nexus services ports graphrag # Show specific service ports
355
+
356
+ # Service details
357
+ nexus services env <service> # Show environment variables
358
+ nexus services volumes # Show volume mappings
359
+ nexus services networks # Show network configuration
360
+ ```
361
+
362
+ ### 9. Configuration Management
363
+
364
+ **Workspace-Aware Configuration:**
365
+ ```
366
+ .nexus.toml # Project-specific config (like .claude/config)
367
+ ~/.nexus/config.toml # Global user config
368
+ ~/.nexus/profiles/ # Multiple profile support
369
+ ```
370
+
371
+ **Configuration Schema:**
372
+ ```toml
373
+ # .nexus.toml - Project configuration
374
+
375
+ [workspace]
376
+ name = "my-project"
377
+ type = "typescript" # Auto-detection available
378
+
379
+ [services]
380
+ api_url = "http://localhost:9092"
381
+ mcp_url = "http://localhost:9000"
382
+ timeout = 30000
383
+
384
+ [auth]
385
+ api_key = "${NEXUS_API_KEY}" # Environment variable support
386
+ strategy = "api-key" # api-key | oauth | jwt
387
+
388
+ [defaults]
389
+ output_format = "json" # text | json | yaml | table | stream-json
390
+ streaming = true
391
+ verbose = false
392
+
393
+ [agent]
394
+ max_iterations = 20
395
+ auto_approve_safe = true
396
+ workspace = "."
397
+
398
+ [plugins]
399
+ enabled = ["my-plugin", "another-plugin"]
400
+ disabled = []
401
+
402
+ [nexus]
403
+ auto_store = true # Auto-store results to Nexus
404
+ memory_tags = ["project:my-project"]
405
+
406
+ [[shortcuts]]
407
+ name = "qa"
408
+ command = "mageagent orchestrate --task 'Run quality analysis'"
409
+
410
+ [[shortcuts]]
411
+ name = "test"
412
+ command = "sandbox execute --file tests/run.py"
413
+ ```
414
+
415
+ **Profile Management:**
416
+ ```bash
417
+ nexus config list # Show current config
418
+ nexus config get services.api_url # Get specific value
419
+ nexus config set defaults.output_format json
420
+ nexus config profiles list # List all profiles
421
+ nexus config profiles use production # Switch profile
422
+ nexus config init # Initialize .nexus.toml in current dir
423
+ ```
424
+
425
+ ### 10. Output Formats
426
+
427
+ **Multiple Output Modes:**
428
+ ```bash
429
+ # Text output (default, human-readable)
430
+ nexus graphrag query --text "user authentication"
431
+
432
+ # JSON output (machine-parseable)
433
+ nexus mageagent orchestrate --task "..." --output-format json
434
+
435
+ # Streaming JSON (real-time events)
436
+ nexus videoagent process --url video.mp4 --output-format stream-json
437
+
438
+ # YAML output
439
+ nexus services list --output-format yaml
440
+
441
+ # Table output
442
+ nexus services status --output-format table
443
+ ┌─────────────┬─────────┬────────────┬─────────┐
444
+ │ Service │ Status │ Health │ Port │
445
+ ├─────────────┼─────────┼────────────┼─────────┤
446
+ │ graphrag │ running │ healthy │ 9090 │
447
+ │ mageagent │ running │ healthy │ 9080 │
448
+ │ sandbox │ stopped │ - │ - │
449
+ └─────────────┴─────────┴────────────┴─────────┘
450
+
451
+ # Quiet mode (minimal output)
452
+ nexus sandbox execute --code "..." --quiet
453
+
454
+ # Verbose mode (debug info)
455
+ nexus mageagent orchestrate --task "..." --verbose
456
+ ```
457
+
458
+ ### 11. Streaming & Progress Tracking
459
+
460
+ **Real-Time Operations:**
461
+ ```typescript
462
+ interface StreamingResponse {
463
+ type: 'progress' | 'result' | 'error' | 'complete';
464
+ timestamp: string;
465
+ data: any;
466
+ metadata?: {
467
+ progress?: number; // 0-100
468
+ step?: string;
469
+ eta?: number;
470
+ };
471
+ }
472
+ ```
473
+
474
+ **Streaming Commands:**
475
+ ```bash
476
+ # WebSocket streaming with progress
477
+ nexus videoagent process-video --url video.mp4 --stream
478
+ ⚙️ Processing frame 120/500 (24%)
479
+ ⚙️ Processing frame 240/500 (48%)
480
+ ⚙️ Processing frame 360/500 (72%)
481
+ ✅ Complete: 500 frames processed
482
+
483
+ # Multi-agent orchestration with live updates
484
+ nexus nexus orchestrate --task "Analyze codebase" --stream
485
+ 🤖 Agent spawned: security-analyst
486
+ ⚙️ security-analyst: Scanning for SQL injection...
487
+ 🤖 Agent spawned: performance-analyst
488
+ ⚙️ performance-analyst: Profiling database queries...
489
+ ✅ security-analyst complete: 3 findings
490
+ ✅ performance-analyst complete: 5 recommendations
491
+ 🎉 Orchestration complete: 8 total findings
492
+
493
+ # File ingestion with streaming
494
+ nexus graphrag ingest-folder --path ./docs/ --stream
495
+ ⚙️ Discovered 150 files (45.2 MB)
496
+ ⚙️ Processing file 30/150: guide.pdf
497
+ ⚙️ Processing file 60/150: api-docs.md
498
+ ✅ Complete: 150 files indexed
499
+ ```
500
+
501
+ ### 12. Context & Workspace Awareness
502
+
503
+ **Auto-Detection:**
504
+ ```typescript
505
+ interface WorkspaceContext {
506
+ cwd: string;
507
+ projectType: 'typescript' | 'python' | 'go' | 'rust' | 'unknown';
508
+ gitRepo: boolean;
509
+ gitBranch?: string;
510
+ dockerCompose: string[]; // Detected compose files
511
+ nexusConfig: Config | null; // .nexus.toml if exists
512
+
513
+ // Service availability detection
514
+ servicesAvailable: ServiceStatus[];
515
+ nexusHealthy: boolean;
516
+ }
517
+ ```
518
+
519
+ **Workspace Commands:**
520
+ ```bash
521
+ # Workspace detection
522
+ nexus workspace info # Show detected workspace info
523
+ nexus workspace init # Initialize .nexus.toml
524
+ nexus workspace validate # Validate configuration
525
+
526
+ # Git integration
527
+ nexus workspace git-status # Show git status
528
+ nexus workspace git-diff # Show changes (like Claude)
529
+ nexus workspace git-commit # Commit with AI-generated message
530
+
531
+ # Service detection
532
+ nexus workspace services # Show available services in workspace
533
+ nexus workspace docker-compose # Show detected compose files
534
+ ```
535
+
536
+ ### 13. Help System (Auto-Generated)
537
+
538
+ **Comprehensive Documentation:**
539
+ ```bash
540
+ # Global help
541
+ nexus --help
542
+ nexus -h
543
+
544
+ # Service-specific help
545
+ nexus graphrag --help
546
+ nexus graphrag store-document --help
547
+
548
+ # Nexus tool help
549
+ nexus nexus --help
550
+ nexus nexus recall-memory --help
551
+
552
+ # Plugin help
553
+ nexus plugin --help
554
+ nexus plugin my-plugin analyze --help
555
+
556
+ # Examples
557
+ nexus graphrag store-document --examples
558
+ nexus mageagent orchestrate --examples
559
+
560
+ # Interactive help (REPL mode)
561
+ > help graphrag
562
+ > help nexus orchestrate
563
+ > docs graphrag # Open service documentation
564
+ ```
565
+
566
+ **Auto-Generated from Schemas:**
567
+ - Service help from OpenAPI specs
568
+ - Nexus tool help from MCP tool definitions
569
+ - Plugin help from plugin manifests
570
+ - Rich formatting with examples
571
+
572
+ ### 14. Session Management
573
+
574
+ **Checkpointing Like Gemini:**
575
+ ```bash
576
+ # Save current session
577
+ nexus session save my-session
578
+ nexus session save --auto # Auto-generate name with timestamp
579
+
580
+ # List sessions
581
+ nexus session list
582
+
583
+ # Resume session
584
+ nexus session load my-session
585
+ nexus session resume # Resume last session
586
+
587
+ # Session info
588
+ nexus session info my-session
589
+
590
+ # Delete session
591
+ nexus session delete my-session
592
+
593
+ # Export/import
594
+ nexus session export my-session > session.json
595
+ nexus session import < session.json
596
+ ```
597
+
598
+ **Session Data:**
599
+ ```typescript
600
+ interface Session {
601
+ id: string;
602
+ name: string;
603
+ timestamp: Date;
604
+ context: WorkspaceContext;
605
+ history: Command[];
606
+ results: Result[];
607
+ nexusMemories: string[]; // Linked Nexus memory IDs
608
+ }
609
+ ```
610
+
611
+ ### 15. Advanced Features
612
+
613
+ #### A. Batch Operations
614
+ ```bash
615
+ # Bulk document ingestion
616
+ nexus graphrag ingest-batch --files docs/*.pdf
617
+
618
+ # Parallel execution
619
+ nexus parallel \
620
+ "nexus graphrag store-document --file {}" \
621
+ docs/*.pdf
622
+
623
+ # Queue-based processing
624
+ nexus queue add "mageagent orchestrate --task 'Task 1'"
625
+ nexus queue add "mageagent orchestrate --task 'Task 2'"
626
+ nexus queue process --concurrency 3
627
+ ```
628
+
629
+ #### B. Pipeline Support
630
+ ```bash
631
+ # Pipe commands together
632
+ nexus graphrag query --text "user auth" --output-format json \
633
+ | nexus mageagent analyze --input - \
634
+ | jq '.recommendations'
635
+
636
+ # Custom pipelines
637
+ nexus pipeline create my-pipeline \
638
+ --step "graphrag query" \
639
+ --step "mageagent analyze" \
640
+ --step "nexus store-document"
641
+
642
+ nexus pipeline run my-pipeline --input query.txt
643
+ ```
644
+
645
+ #### C. Aliases & Shortcuts
646
+ ```bash
647
+ # Create aliases
648
+ nexus alias create qa "mageagent orchestrate --task 'Quality analysis'"
649
+ nexus qa # Runs the alias
650
+
651
+ # Custom shortcuts (from .nexus.toml)
652
+ nexus @test # Runs configured test shortcut
653
+ nexus @deploy # Runs configured deploy shortcut
654
+ ```
655
+
656
+ #### D. Watch Mode
657
+ ```bash
658
+ # Watch files and execute on change
659
+ nexus watch "src/**/*.ts" \
660
+ --exec "sandbox execute --file {file}"
661
+
662
+ # Watch service health
663
+ nexus watch-health --all --interval 5s
664
+ ```
665
+
666
+ #### E. Notifications
667
+ ```bash
668
+ # Send notifications on completion
669
+ nexus mageagent orchestrate --task "..." --notify slack
670
+ nexus mageagent orchestrate --task "..." --notify email
671
+ nexus mageagent orchestrate --task "..." --notify webhook:https://...
672
+ ```
673
+
674
+ ---
675
+
676
+ ## Command Line Syntax
677
+
678
+ **General Structure:**
679
+ ```bash
680
+ nexus [global-options] <command> [command-options] [arguments]
681
+ ```
682
+
683
+ **Global Options:**
684
+ ```bash
685
+ --config <path> # Use specific config file
686
+ --profile <name> # Use specific profile
687
+ --output-format <format> # Output format (text|json|yaml|table|stream-json)
688
+ --verbose, -v # Verbose output
689
+ --quiet, -q # Minimal output
690
+ --no-color # Disable colors
691
+ --help, -h # Show help
692
+ --version, -V # Show version
693
+ --timeout <ms> # Request timeout
694
+ --retries <n> # Number of retries
695
+ ```
696
+
697
+ **Common Patterns:**
698
+ ```bash
699
+ # Service namespace pattern
700
+ nexus <service> <action> [options]
701
+
702
+ # Nexus tool pattern
703
+ nexus nexus <tool> [options]
704
+
705
+ # Plugin pattern
706
+ nexus plugin <plugin> <action> [options]
707
+
708
+ # Service management pattern
709
+ nexus services <action> [service]
710
+
711
+ # Agent pattern
712
+ nexus agent <action> [options]
713
+
714
+ # Session pattern
715
+ nexus session <action> [name]
716
+ ```
717
+
718
+ ---
719
+
720
+ ## Technology Stack
721
+
722
+ ### Core Framework
723
+ - **Commander.js 11.x**: CLI framework with subcommands
724
+ - **Inquirer.js 9.x**: Interactive prompts
725
+ - **Ora 8.x**: Spinners and progress indicators
726
+ - **Chalk 5.x**: Terminal colors and formatting
727
+ - **Table 6.x**: Table formatting
728
+ - **Boxen 7.x**: Boxed messages
729
+
730
+ ### Networking
731
+ - **Axios 1.6.x**: HTTP client for REST APIs
732
+ - **Socket.IO Client 4.x**: WebSocket client for streaming
733
+ - **@modelcontextprotocol/sdk 0.5.x**: MCP protocol support
734
+
735
+ ### Parsing & Validation
736
+ - **Zod 3.x**: Schema validation
737
+ - **YAML 2.x**: YAML parsing
738
+ - **js-yaml 4.x**: YAML serialization
739
+ - **dotenv 16.x**: Environment variable management
740
+
741
+ ### Auto-Discovery
742
+ - **OpenAPI Parser**: Parse OpenAPI 3.x specs
743
+ - **GraphQL Tools**: Parse GraphQL schemas
744
+ - **Docker Compose Parser**: Parse compose YAML
745
+ - **Glob 10.x**: File pattern matching
746
+
747
+ ### Development
748
+ - **TypeScript 5.3.x**: Type safety
749
+ - **TSX**: TypeScript execution
750
+ - **ESLint + Prettier**: Code quality
751
+ - **Jest 29.x**: Testing framework
752
+ - **Vitest**: Fast unit tests
753
+
754
+ ### Utilities
755
+ - **fs-extra 11.x**: Enhanced file operations
756
+ - **chokidar 3.x**: File watching
757
+ - **execa 8.x**: Process execution
758
+ - **p-queue 8.x**: Promise queue for concurrency control
759
+ - **conf 12.x**: Configuration management
760
+
761
+ ---
762
+
763
+ ## Project Structure
764
+
765
+ ```
766
+ packages/nexus-cli/
767
+ ├── src/
768
+ │ ├── index.ts # Main entry point
769
+ │ ├── cli.ts # CLI setup and routing
770
+ │ │
771
+ │ ├── core/
772
+ │ │ ├── discovery/
773
+ │ │ │ ├── service-discovery.ts # Auto-discover services
774
+ │ │ │ ├── docker-parser.ts # Parse docker-compose.yml
775
+ │ │ │ ├── openapi-parser.ts # Parse OpenAPI schemas
776
+ │ │ │ ├── mcp-discovery.ts # Discover MCP tools
777
+ │ │ │ └── plugin-discovery.ts # Discover plugins
778
+ │ │ │
779
+ │ │ ├── router/
780
+ │ │ │ ├── command-router.ts # Route commands
781
+ │ │ │ ├── namespace-manager.ts # Manage namespaces
782
+ │ │ │ └── command-registry.ts # Command registration
783
+ │ │ │
784
+ │ │ ├── transport/
785
+ │ │ │ ├── http-client.ts # HTTP transport
786
+ │ │ │ ├── websocket-client.ts # WebSocket transport
787
+ │ │ │ ├── mcp-client.ts # MCP transport
788
+ │ │ │ └── stream-handler.ts # Streaming response handler
789
+ │ │ │
790
+ │ │ ├── config/
791
+ │ │ │ ├── config-manager.ts # Configuration management
792
+ │ │ │ ├── workspace-detector.ts # Detect workspace context
793
+ │ │ │ └── profile-manager.ts # Profile management
794
+ │ │ │
795
+ │ │ └── session/
796
+ │ │ ├── session-manager.ts # Session checkpointing
797
+ │ │ ├── history-manager.ts # Command history
798
+ │ │ └── context-manager.ts # Context persistence
799
+ │ │
800
+ │ ├── commands/
801
+ │ │ ├── services/ # Service management commands
802
+ │ │ │ ├── list.ts
803
+ │ │ │ ├── status.ts
804
+ │ │ │ ├── start.ts
805
+ │ │ │ ├── stop.ts
806
+ │ │ │ ├── logs.ts
807
+ │ │ │ └── health.ts
808
+ │ │ │
809
+ │ │ ├── agent/ # Autonomous agent commands
810
+ │ │ │ ├── run.ts
811
+ │ │ │ └── status.ts
812
+ │ │ │
813
+ │ │ ├── session/ # Session management
814
+ │ │ │ ├── save.ts
815
+ │ │ │ ├── load.ts
816
+ │ │ │ ├── list.ts
817
+ │ │ │ └── delete.ts
818
+ │ │ │
819
+ │ │ ├── workspace/ # Workspace commands
820
+ │ │ │ ├── info.ts
821
+ │ │ │ ├── init.ts
822
+ │ │ │ └── validate.ts
823
+ │ │ │
824
+ │ │ ├── config/ # Configuration commands
825
+ │ │ │ ├── list.ts
826
+ │ │ │ ├── get.ts
827
+ │ │ │ ├── set.ts
828
+ │ │ │ └── profiles.ts
829
+ │ │ │
830
+ │ │ └── dynamic/ # Dynamically generated commands
831
+ │ │ ├── service-commands.ts # Service-specific commands
832
+ │ │ ├── nexus-commands.ts # Nexus MCP commands
833
+ │ │ └── plugin-commands.ts # Plugin commands
834
+ │ │
835
+ │ ├── repl/
836
+ │ │ ├── repl.ts # Interactive REPL
837
+ │ │ ├── completer.ts # Tab completion
838
+ │ │ ├── evaluator.ts # Command evaluation
839
+ │ │ └── renderer.ts # Output rendering
840
+ │ │
841
+ │ ├── plugins/
842
+ │ │ ├── plugin-loader.ts # Plugin loading
843
+ │ │ ├── plugin-validator.ts # Plugin validation
844
+ │ │ ├── plugin-manager.ts # Plugin management
845
+ │ │ └── plugin-sdk.ts # Plugin SDK
846
+ │ │
847
+ │ ├── output/
848
+ │ │ ├── formatters/
849
+ │ │ │ ├── text-formatter.ts
850
+ │ │ │ ├── json-formatter.ts
851
+ │ │ │ ├── yaml-formatter.ts
852
+ │ │ │ ├── table-formatter.ts
853
+ │ │ │ └── stream-formatter.ts
854
+ │ │ │
855
+ │ │ ├── renderers/
856
+ │ │ │ ├── terminal-renderer.ts
857
+ │ │ │ ├── progress-renderer.ts
858
+ │ │ │ └── stream-renderer.ts
859
+ │ │ │
860
+ │ │ └── output-manager.ts
861
+ │ │
862
+ │ ├── utils/
863
+ │ │ ├── logger.ts
864
+ │ │ ├── spinner.ts
865
+ │ │ ├── prompt.ts
866
+ │ │ ├── validation.ts
867
+ │ │ ├── error-handler.ts
868
+ │ │ └── retry.ts
869
+ │ │
870
+ │ └── types/
871
+ │ ├── service.ts
872
+ │ ├── command.ts
873
+ │ ├── config.ts
874
+ │ ├── plugin.ts
875
+ │ └── session.ts
876
+
877
+ ├── tests/
878
+ │ ├── unit/
879
+ │ ├── integration/
880
+ │ └── e2e/
881
+
882
+ ├── templates/
883
+ │ ├── plugin-template/ # Plugin template
884
+ │ └── workspace-template/ # Workspace template
885
+
886
+ ├── docs/
887
+ │ ├── commands/ # Command documentation
888
+ │ ├── plugins/ # Plugin development guide
889
+ │ ├── examples/ # Usage examples
890
+ │ └── api/ # API documentation
891
+
892
+ ├── package.json
893
+ ├── tsconfig.json
894
+ ├── ARCHITECTURE.md # This file
895
+ └── README.md
896
+ ```
897
+
898
+ ---
899
+
900
+ ## Command Examples
901
+
902
+ ### Service Commands
903
+ ```bash
904
+ # GraphRAG
905
+ nexus graphrag store-document --file report.pdf --title "Q4 Report"
906
+ nexus graphrag query --text "user authentication patterns"
907
+ nexus graphrag store-entity --domain code --type class --content "User"
908
+ nexus graphrag health --detailed
909
+
910
+ # MageAgent
911
+ nexus mageagent orchestrate --task "Analyze codebase for security issues"
912
+ nexus mageagent analyze --input code.ts --focus security
913
+ nexus mageagent collaborate --agents 3 --task "Build API"
914
+
915
+ # Sandbox
916
+ nexus sandbox execute --code "print('hello')" --language python
917
+ nexus sandbox execute --file script.py --stream
918
+ nexus sandbox list-languages
919
+
920
+ # VideoAgent
921
+ nexus videoagent process-video --url video.mp4 --extract-scenes --stream
922
+ nexus videoagent analyze-frame --file frame.jpg
923
+
924
+ # GeoAgent
925
+ nexus geoagent proximity-search --lat 37.7749 --lon -122.4194 --radius 10km
926
+ nexus geoagent create-geofence --bounds "[[...]]" --name "san-francisco"
927
+
928
+ # OrchestrationAgent
929
+ nexus orchestration run --task "Implement user auth" --max-iterations 20
930
+ nexus orchestration status --id task_123
931
+
932
+ # LearningAgent
933
+ nexus learning trigger --topic "rust_async" --priority 9
934
+ nexus learning recall --topic "typescript_patterns" --layer EXPERT
935
+ ```
936
+
937
+ ### Nexus Commands
938
+ ```bash
939
+ # Memory
940
+ nexus nexus store-memory --content "User prefers TypeScript" --tags "preferences"
941
+ nexus nexus recall-memory --query "typescript patterns" --limit 10
942
+
943
+ # Documents
944
+ nexus nexus store-document --file report.pdf --type code
945
+ nexus nexus retrieve --query "authentication" --strategy hybrid
946
+
947
+ # Knowledge Graph
948
+ nexus nexus store-entity --domain code --type function --content "authenticate()"
949
+ nexus nexus query-entities --domain code --search "auth"
950
+ nexus nexus create-relationship --source ent_1 --target ent_2 --type CALLS
951
+
952
+ # Code Analysis
953
+ nexus nexus validate-code --file app.ts --risk-level high
954
+ nexus nexus analyze-code --file app.ts --focus security,performance
955
+
956
+ # Multi-Agent
957
+ nexus nexus orchestrate --task "Security audit" --max-agents 5
958
+ nexus nexus get-suggestions --context-id ctx_123
959
+
960
+ # Learning
961
+ nexus nexus trigger-learning --topic "rust_concurrency" --priority 8
962
+ nexus nexus recall-knowledge --topic "async_patterns" --layer EXPERT
963
+
964
+ # Episodes
965
+ nexus nexus store-episode --content "Fixed memory leak" --type insight
966
+ nexus nexus recall-episodes --query "debugging sessions" --limit 5
967
+
968
+ # Health
969
+ nexus nexus health --detailed
970
+ nexus nexus ingestion-status --job-id job_123
971
+ ```
972
+
973
+ ### Service Management
974
+ ```bash
975
+ # List and status
976
+ nexus services list
977
+ nexus services status
978
+ nexus services info graphrag
979
+
980
+ # Control
981
+ nexus services start graphrag
982
+ nexus services stop mageagent
983
+ nexus services restart sandbox
984
+
985
+ # Monitoring
986
+ nexus services logs graphrag --follow
987
+ nexus services health --all
988
+ nexus services ports
989
+
990
+ # Docker operations
991
+ nexus services volumes
992
+ nexus services networks
993
+ nexus services env graphrag
994
+ ```
995
+
996
+ ### Agent Mode
997
+ ```bash
998
+ # Autonomous execution
999
+ nexus agent run --task "Fix TypeScript errors"
1000
+ nexus agent run --task "Implement auth" --max-iterations 20
1001
+ nexus agent run --task "Security audit" --approve-commands
1002
+
1003
+ # With streaming
1004
+ nexus agent run --task "Refactor codebase" --stream
1005
+
1006
+ # Status
1007
+ nexus agent status --id agent_123
1008
+ nexus agent list
1009
+ ```
1010
+
1011
+ ### Session Management
1012
+ ```bash
1013
+ # Save/load
1014
+ nexus session save my-work
1015
+ nexus session load my-work
1016
+ nexus session resume
1017
+
1018
+ # List and info
1019
+ nexus session list
1020
+ nexus session info my-work
1021
+
1022
+ # Export/import
1023
+ nexus session export my-work > session.json
1024
+ nexus session import < session.json
1025
+ ```
1026
+
1027
+ ### Workspace
1028
+ ```bash
1029
+ # Info and setup
1030
+ nexus workspace info
1031
+ nexus workspace init
1032
+ nexus workspace validate
1033
+
1034
+ # Git integration
1035
+ nexus workspace git-status
1036
+ nexus workspace git-diff
1037
+ nexus workspace git-commit --message "Update docs"
1038
+
1039
+ # Service detection
1040
+ nexus workspace services
1041
+ nexus workspace docker-compose
1042
+ ```
1043
+
1044
+ ### Configuration
1045
+ ```bash
1046
+ # View config
1047
+ nexus config list
1048
+ nexus config get services.api_url
1049
+ nexus config set defaults.output_format json
1050
+
1051
+ # Profiles
1052
+ nexus config profiles list
1053
+ nexus config profiles use production
1054
+ nexus config profiles create staging
1055
+
1056
+ # Init
1057
+ nexus config init
1058
+ ```
1059
+
1060
+ ### REPL Mode
1061
+ ```bash
1062
+ # Start REPL
1063
+ nexus repl
1064
+
1065
+ # Inside REPL
1066
+ > help
1067
+ > services
1068
+ > use graphrag
1069
+ > store-document --file report.pdf
1070
+ > history
1071
+ > save session-1
1072
+ > exit
1073
+ ```
1074
+
1075
+ ---
1076
+
1077
+ ## Plugin Development Guide
1078
+
1079
+ ### Creating a Plugin
1080
+
1081
+ **1. Initialize Plugin:**
1082
+ ```bash
1083
+ nexus plugin init my-plugin --template typescript
1084
+ ```
1085
+
1086
+ **2. Plugin Structure:**
1087
+ ```
1088
+ my-plugin/
1089
+ ├── plugin.json # Plugin manifest
1090
+ ├── src/
1091
+ │ ├── index.ts # Main entry point
1092
+ │ ├── commands/ # Command implementations
1093
+ │ │ ├── analyze.ts
1094
+ │ │ └── report.ts
1095
+ │ └── mcp/ # Optional MCP server
1096
+ │ └── server.ts
1097
+ ├── package.json
1098
+ └── README.md
1099
+ ```
1100
+
1101
+ **3. Plugin Manifest (plugin.json):**
1102
+ ```json
1103
+ {
1104
+ "name": "my-plugin",
1105
+ "version": "1.0.0",
1106
+ "description": "My custom plugin",
1107
+ "author": "Your Name",
1108
+ "main": "dist/index.js",
1109
+
1110
+ "commands": [
1111
+ {
1112
+ "name": "analyze",
1113
+ "description": "Analyze data",
1114
+ "args": [
1115
+ {
1116
+ "name": "input",
1117
+ "type": "string",
1118
+ "required": true,
1119
+ "description": "Input file path"
1120
+ }
1121
+ ]
1122
+ }
1123
+ ],
1124
+
1125
+ "dependencies": ["graphrag", "mageagent"],
1126
+
1127
+ "permissions": [
1128
+ "file:read",
1129
+ "network:http",
1130
+ "service:graphrag"
1131
+ ],
1132
+
1133
+ "mcp": {
1134
+ "enabled": true,
1135
+ "command": "node dist/mcp/server.js"
1136
+ }
1137
+ }
1138
+ ```
1139
+
1140
+ **4. Implement Commands:**
1141
+ ```typescript
1142
+ // src/commands/analyze.ts
1143
+ import { Command, Context } from '@adverant-nexus/cli-sdk';
1144
+
1145
+ export const analyzeCommand: Command = {
1146
+ name: 'analyze',
1147
+ description: 'Analyze data',
1148
+
1149
+ async execute(args, context: Context) {
1150
+ const { input } = args;
1151
+
1152
+ // Access Nexus services via context
1153
+ const result = await context.services.graphrag.query({
1154
+ text: `Analyze file: ${input}`
1155
+ });
1156
+
1157
+ return {
1158
+ success: true,
1159
+ data: result
1160
+ };
1161
+ }
1162
+ };
1163
+ ```
1164
+
1165
+ **5. Register Plugin:**
1166
+ ```bash
1167
+ # Install locally
1168
+ nexus plugin install ./my-plugin
1169
+
1170
+ # Publish to registry
1171
+ nexus plugin publish my-plugin
1172
+
1173
+ # Install from registry
1174
+ nexus plugin install my-plugin
1175
+ ```
1176
+
1177
+ ### Plugin SDK
1178
+
1179
+ **API:**
1180
+ ```typescript
1181
+ import {
1182
+ Command,
1183
+ Context,
1184
+ Plugin,
1185
+ PluginBuilder
1186
+ } from '@adverant-nexus/cli-sdk';
1187
+
1188
+ export default PluginBuilder
1189
+ .create('my-plugin')
1190
+ .version('1.0.0')
1191
+ .description('My plugin')
1192
+
1193
+ .command('analyze', {
1194
+ description: 'Analyze data',
1195
+ args: [{
1196
+ name: 'input',
1197
+ type: 'string',
1198
+ required: true
1199
+ }],
1200
+ handler: async (args, context) => {
1201
+ // Implementation
1202
+ }
1203
+ })
1204
+
1205
+ .onLoad(async (context) => {
1206
+ // Initialize plugin
1207
+ })
1208
+
1209
+ .onUnload(async () => {
1210
+ // Cleanup
1211
+ })
1212
+
1213
+ .build();
1214
+ ```
1215
+
1216
+ ---
1217
+
1218
+ ## Comparison: Adverant-Nexus CLI vs Claude Code vs Gemini CLI
1219
+
1220
+ | Feature | Adverant-Nexus CLI | Claude Code | Gemini CLI |
1221
+ |---------|-------------------|-------------|------------|
1222
+ | **Auto-Discovery** | ✅ All services & plugins | ❌ Manual | ❌ Manual |
1223
+ | **Service Commands** | ✅ 32+ services | ❌ Single agent | ❌ Single agent |
1224
+ | **Nexus Tools** | ✅ 70+ tools exposed | ❌ N/A | ❌ N/A |
1225
+ | **Plugin System** | ✅ Full SDK | ✅ Skills | ✅ Extensions |
1226
+ | **MCP Integration** | ✅ Native | ✅ Native | ✅ Native |
1227
+ | **Interactive REPL** | ✅ Full-featured | ❌ Chat only | ✅ Yes |
1228
+ | **Streaming** | ✅ WebSocket + SSE | ✅ Yes | ✅ Yes |
1229
+ | **Output Formats** | ✅ 5 formats | ✅ Text + JSON | ✅ Text + JSON |
1230
+ | **ReAct Agent** | ✅ 20 iterations | ✅ Task agent | ❌ No |
1231
+ | **Session Checkpointing** | ✅ Yes | ❌ No | ✅ Yes |
1232
+ | **Service Management** | ✅ Full control | ❌ N/A | ❌ N/A |
1233
+ | **Workspace Detection** | ✅ Auto | ✅ Auto | ✅ Auto |
1234
+ | **Pipeline Support** | ✅ Yes | ❌ No | ❌ No |
1235
+ | **Batch Operations** | ✅ Yes | ❌ No | ❌ No |
1236
+ | **Multi-Agent** | ✅ 10+ agents | ❌ Single | ❌ Single |
1237
+ | **Code Validation** | ✅ 3 models | ❌ No | ❌ No |
1238
+ | **Health Monitoring** | ✅ All services | ❌ N/A | ❌ N/A |
1239
+ | **Git Integration** | ✅ Built-in | ✅ Built-in | ✅ Via extension |
1240
+ | **Watch Mode** | ✅ Yes | ❌ No | ❌ No |
1241
+ | **Notifications** | ✅ Multiple | ❌ No | ❌ No |
1242
+
1243
+ **Verdict**: Adverant-Nexus CLI is **more powerful and comprehensive** than both Claude Code and Gemini CLI.
1244
+
1245
+ ---
1246
+
1247
+ ## Implementation Roadmap
1248
+
1249
+ ### Phase 1: Core Framework (Week 1)
1250
+ - ✅ CLI framework setup (Commander.js)
1251
+ - ✅ Configuration management
1252
+ - ✅ Workspace detection
1253
+ - ✅ HTTP transport layer
1254
+ - ✅ Output formatters (text, JSON, YAML, table)
1255
+ - ✅ Error handling
1256
+
1257
+ ### Phase 2: Service Discovery (Week 2)
1258
+ - ✅ Docker Compose parser
1259
+ - ✅ OpenAPI schema parser
1260
+ - ✅ Service discovery engine
1261
+ - ✅ Auto-command generation
1262
+ - ✅ Service health monitoring
1263
+
1264
+ ### Phase 3: Service Commands (Week 3)
1265
+ - ✅ GraphRAG commands
1266
+ - ✅ MageAgent commands
1267
+ - ✅ Sandbox commands
1268
+ - ✅ Service management commands
1269
+ - ✅ Dynamic command registration
1270
+
1271
+ ### Phase 4: Nexus MCP Integration (Week 4)
1272
+ - ✅ MCP client implementation
1273
+ - ✅ All 70+ Nexus tools exposed
1274
+ - ✅ MCP tool discovery
1275
+ - ✅ MCP command generation
1276
+
1277
+ ### Phase 5: Streaming & Real-Time (Week 5)
1278
+ - ✅ WebSocket client
1279
+ - ✅ Streaming response handler
1280
+ - ✅ Progress tracking
1281
+ - ✅ Stream-JSON output format
1282
+
1283
+ ### Phase 6: Interactive REPL (Week 6)
1284
+ - ✅ REPL implementation
1285
+ - ✅ Tab completion
1286
+ - ✅ Command history
1287
+ - ✅ Multiline input
1288
+ - ✅ Context awareness
1289
+
1290
+ ### Phase 7: Plugin System (Week 7)
1291
+ - ✅ Plugin loader
1292
+ - ✅ Plugin SDK
1293
+ - ✅ Plugin discovery
1294
+ - ✅ Plugin validation
1295
+ - ✅ Plugin registry integration
1296
+
1297
+ ### Phase 8: Agent Mode (Week 8)
1298
+ - ✅ OrchestrationAgent integration
1299
+ - ✅ ReAct loop implementation
1300
+ - ✅ Interactive approval mode
1301
+ - ✅ Streaming agent progress
1302
+
1303
+ ### Phase 9: Advanced Features (Week 9)
1304
+ - ✅ Session management
1305
+ - ✅ Batch operations
1306
+ - ✅ Pipeline support
1307
+ - ✅ Watch mode
1308
+ - ✅ Notifications
1309
+
1310
+ ### Phase 10: Documentation & Testing (Week 10)
1311
+ - ✅ Comprehensive documentation
1312
+ - ✅ Unit tests
1313
+ - ✅ Integration tests
1314
+ - ✅ E2E tests
1315
+ - ✅ Examples and tutorials
1316
+
1317
+ ---
1318
+
1319
+ ## Success Metrics
1320
+
1321
+ ### Functionality
1322
+ - ✅ All 32+ services accessible via CLI
1323
+ - ✅ All 70+ Nexus tools exposed
1324
+ - ✅ Plugin system operational
1325
+ - ✅ Auto-discovery working
1326
+ - ✅ Streaming operations supported
1327
+
1328
+ ### Performance
1329
+ - ✅ Command execution < 100ms (cached)
1330
+ - ✅ Service discovery < 2s
1331
+ - ✅ Streaming latency < 50ms
1332
+ - ✅ REPL response < 50ms
1333
+
1334
+ ### Usability
1335
+ - ✅ Comprehensive help system
1336
+ - ✅ Tab completion for all commands
1337
+ - ✅ Rich output formatting
1338
+ - ✅ Error messages with suggestions
1339
+ - ✅ Examples for every command
1340
+
1341
+ ### Extensibility
1342
+ - ✅ Plugin SDK documented
1343
+ - ✅ Third-party plugins loadable
1344
+ - ✅ Custom commands registrable
1345
+ - ✅ Service schemas parseable
1346
+
1347
+ ### Developer Experience
1348
+ - ✅ TypeScript type safety
1349
+ - ✅ 100% test coverage
1350
+ - ✅ CI/CD pipeline
1351
+ - ✅ Published to npm
1352
+ - ✅ Docker image available
1353
+
1354
+ ---
1355
+
1356
+ ## Conclusion
1357
+
1358
+ The Adverant-Nexus CLI is designed to be:
1359
+
1360
+ 1. **More Powerful**: Exposes all 32+ services and 70+ Nexus tools
1361
+ 2. **More Intelligent**: Built-in ReAct agent, multi-agent orchestration, code validation
1362
+ 3. **More Extensible**: Plugin system, auto-discovery, MCP integration
1363
+ 4. **More Productive**: Streaming, batch operations, pipelines, watch mode
1364
+ 5. **Future-Proof**: Auto-discovers new services and plugins without code changes
1365
+
1366
+ **It surpasses both Claude Code CLI and Gemini CLI** in functionality, extensibility, and intelligence while maintaining excellent developer experience.