@maiaos/cli 0.1.0-canary.2

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 (413) hide show
  1. package/README.md +287 -0
  2. package/dist/bin/maia.NOTICES.txt +59 -0
  3. package/dist/bin/maia.cdx.json +145 -0
  4. package/dist/bin/maia.mjs +2 -0
  5. package/dist/bootstrap/index.d.ts +3 -0
  6. package/dist/bootstrap/index.js +3 -0
  7. package/dist/bootstrap/process.d.ts +5 -0
  8. package/dist/bootstrap/process.js +45 -0
  9. package/dist/bootstrap/run.d.ts +25 -0
  10. package/dist/bootstrap/run.js +95 -0
  11. package/dist/bootstrap/stdio.d.ts +4 -0
  12. package/dist/bootstrap/stdio.js +9 -0
  13. package/dist/cli/cli.d.ts +17 -0
  14. package/dist/cli/cli.js +481 -0
  15. package/dist/cli/environment.d.ts +8 -0
  16. package/dist/cli/environment.js +12 -0
  17. package/dist/cli/index.d.ts +2 -0
  18. package/dist/cli/index.js +2 -0
  19. package/dist/cli/services.d.ts +4 -0
  20. package/dist/cli/services.js +4 -0
  21. package/dist/command-line/context.d.ts +178 -0
  22. package/dist/command-line/context.js +2 -0
  23. package/dist/command-line/index.d.ts +7 -0
  24. package/dist/command-line/index.js +6 -0
  25. package/dist/command-line/input/arguments.d.ts +55 -0
  26. package/dist/command-line/input/arguments.js +220 -0
  27. package/dist/command-line/input/index.d.ts +4 -0
  28. package/dist/command-line/input/index.js +4 -0
  29. package/dist/command-line/input/prompt.d.ts +8 -0
  30. package/dist/command-line/input/prompt.js +44 -0
  31. package/dist/command-line/input/stdin-stream.d.ts +4 -0
  32. package/dist/command-line/input/stdin-stream.js +3 -0
  33. package/dist/command-line/input/stdin.d.ts +11 -0
  34. package/dist/command-line/input/stdin.js +23 -0
  35. package/dist/command-line/json-decoder.d.ts +3 -0
  36. package/dist/command-line/json-decoder.js +3 -0
  37. package/dist/command-line/json.d.ts +3 -0
  38. package/dist/command-line/json.js +4 -0
  39. package/dist/command-line/output.d.ts +57 -0
  40. package/dist/command-line/output.js +94 -0
  41. package/dist/command-line/rows.d.ts +10 -0
  42. package/dist/command-line/rows.js +32 -0
  43. package/dist/command-line/two-phase.d.ts +57 -0
  44. package/dist/command-line/two-phase.js +148 -0
  45. package/dist/command-receipt/command.d.ts +4 -0
  46. package/dist/command-receipt/command.js +59 -0
  47. package/dist/command-receipt/compact-list.d.ts +20 -0
  48. package/dist/command-receipt/compact-list.js +29 -0
  49. package/dist/command-receipt/index.d.ts +3 -0
  50. package/dist/command-receipt/index.js +3 -0
  51. package/dist/command-tree/commands.d.ts +17 -0
  52. package/dist/command-tree/commands.js +41 -0
  53. package/dist/command-tree/completion.d.ts +6 -0
  54. package/dist/command-tree/completion.js +36 -0
  55. package/dist/command-tree/grammar.d.ts +18 -0
  56. package/dist/command-tree/grammar.js +160 -0
  57. package/dist/command-tree/help.d.ts +62 -0
  58. package/dist/command-tree/help.js +219 -0
  59. package/dist/command-tree/index.d.ts +8 -0
  60. package/dist/command-tree/index.js +6 -0
  61. package/dist/command-tree/local.d.ts +3 -0
  62. package/dist/command-tree/local.js +126 -0
  63. package/dist/command-tree/placeholder.d.ts +3 -0
  64. package/dist/command-tree/placeholder.js +4 -0
  65. package/dist/command-tree/row.d.ts +29 -0
  66. package/dist/command-tree/row.js +2 -0
  67. package/dist/command-tree/suggest.d.ts +3 -0
  68. package/dist/command-tree/suggest.js +81 -0
  69. package/dist/command-tree/tree.d.ts +34 -0
  70. package/dist/command-tree/tree.js +124 -0
  71. package/dist/connection/client.d.ts +692 -0
  72. package/dist/connection/client.js +28 -0
  73. package/dist/connection/commands.d.ts +15 -0
  74. package/dist/connection/commands.js +118 -0
  75. package/dist/connection/index.d.ts +7 -0
  76. package/dist/connection/index.js +7 -0
  77. package/dist/connection/input.d.ts +50 -0
  78. package/dist/connection/input.js +90 -0
  79. package/dist/connection/login.d.ts +13 -0
  80. package/dist/connection/login.js +69 -0
  81. package/dist/connection/output/format.d.ts +32 -0
  82. package/dist/connection/output/format.js +94 -0
  83. package/dist/connection/output/index.d.ts +2 -0
  84. package/dist/connection/output/index.js +2 -0
  85. package/dist/connection/resolve.d.ts +60 -0
  86. package/dist/connection/resolve.js +30 -0
  87. package/dist/connection/signin.d.ts +4 -0
  88. package/dist/connection/signin.js +32 -0
  89. package/dist/connection/system.d.ts +4 -0
  90. package/dist/connection/system.js +190 -0
  91. package/dist/connection/tree/index.d.ts +2 -0
  92. package/dist/connection/tree/index.js +2 -0
  93. package/dist/connection/tree/tree.d.ts +3 -0
  94. package/dist/connection/tree/tree.js +209 -0
  95. package/dist/container/client.d.ts +142 -0
  96. package/dist/container/client.js +11 -0
  97. package/dist/container/commands.d.ts +7 -0
  98. package/dist/container/commands.js +100 -0
  99. package/dist/container/index.d.ts +3 -0
  100. package/dist/container/index.js +3 -0
  101. package/dist/container/output/format.d.ts +11 -0
  102. package/dist/container/output/format.js +28 -0
  103. package/dist/container/output/index.d.ts +2 -0
  104. package/dist/container/output/index.js +2 -0
  105. package/dist/context/client.d.ts +7 -0
  106. package/dist/context/client.js +21 -0
  107. package/dist/context/commands.d.ts +3 -0
  108. package/dist/context/commands.js +27 -0
  109. package/dist/context/index.d.ts +3 -0
  110. package/dist/context/index.js +3 -0
  111. package/dist/development/cli.d.ts +3 -0
  112. package/dist/development/cli.js +44 -0
  113. package/dist/execution/client.d.ts +25 -0
  114. package/dist/execution/client.js +24 -0
  115. package/dist/execution/index.d.ts +3 -0
  116. package/dist/execution/index.js +3 -0
  117. package/dist/execution/relocation.d.ts +6 -0
  118. package/dist/execution/relocation.js +123 -0
  119. package/dist/execution/tree/index.d.ts +2 -0
  120. package/dist/execution/tree/index.js +2 -0
  121. package/dist/execution/tree/tree.d.ts +3 -0
  122. package/dist/execution/tree/tree.js +137 -0
  123. package/dist/hold/client.d.ts +137 -0
  124. package/dist/hold/client.js +12 -0
  125. package/dist/hold/commands.d.ts +5 -0
  126. package/dist/hold/commands.js +91 -0
  127. package/dist/hold/index.d.ts +3 -0
  128. package/dist/hold/index.js +3 -0
  129. package/dist/hold/output/format.d.ts +11 -0
  130. package/dist/hold/output/format.js +29 -0
  131. package/dist/hold/output/index.d.ts +2 -0
  132. package/dist/hold/output/index.js +2 -0
  133. package/dist/hold/tree/index.d.ts +2 -0
  134. package/dist/hold/tree/index.js +2 -0
  135. package/dist/hold/tree/tree.d.ts +3 -0
  136. package/dist/hold/tree/tree.js +96 -0
  137. package/dist/import/client.d.ts +14 -0
  138. package/dist/import/client.js +16 -0
  139. package/dist/import/commands.d.ts +5 -0
  140. package/dist/import/commands.js +76 -0
  141. package/dist/import/index.d.ts +3 -0
  142. package/dist/import/index.js +3 -0
  143. package/dist/import/input.d.ts +16 -0
  144. package/dist/import/input.js +92 -0
  145. package/dist/import/output.d.ts +6 -0
  146. package/dist/import/output.js +40 -0
  147. package/dist/index.d.ts +2 -0
  148. package/dist/index.js +2 -0
  149. package/dist/integration/client.d.ts +1284 -0
  150. package/dist/integration/client.js +24 -0
  151. package/dist/integration/commands.d.ts +10 -0
  152. package/dist/integration/commands.js +104 -0
  153. package/dist/integration/index.d.ts +3 -0
  154. package/dist/integration/index.js +3 -0
  155. package/dist/integration/output.d.ts +22 -0
  156. package/dist/integration/output.js +20 -0
  157. package/dist/local-node/call.d.ts +7 -0
  158. package/dist/local-node/call.js +13 -0
  159. package/dist/local-node/client.d.ts +67 -0
  160. package/dist/local-node/client.js +241 -0
  161. package/dist/local-node/index.d.ts +3 -0
  162. package/dist/local-node/index.js +3 -0
  163. package/dist/login/agent-provider.d.ts +20 -0
  164. package/dist/login/agent-provider.js +109 -0
  165. package/dist/login/commands.d.ts +4 -0
  166. package/dist/login/commands.js +93 -0
  167. package/dist/login/failure.d.ts +3 -0
  168. package/dist/login/failure.js +14 -0
  169. package/dist/login/gateway.d.ts +12 -0
  170. package/dist/login/gateway.js +71 -0
  171. package/dist/login/index.d.ts +3 -0
  172. package/dist/login/index.js +2 -0
  173. package/dist/login/menu.d.ts +4 -0
  174. package/dist/login/menu.js +105 -0
  175. package/dist/login/output/format.d.ts +16 -0
  176. package/dist/login/output/format.js +31 -0
  177. package/dist/login/output/index.d.ts +2 -0
  178. package/dist/login/output/index.js +2 -0
  179. package/dist/login/vendor-account.d.ts +95 -0
  180. package/dist/login/vendor-account.js +75 -0
  181. package/dist/login/vendor-input.d.ts +14 -0
  182. package/dist/login/vendor-input.js +36 -0
  183. package/dist/mcp/calls.d.ts +7 -0
  184. package/dist/mcp/calls.js +202 -0
  185. package/dist/mcp/commands.d.ts +9 -0
  186. package/dist/mcp/commands.js +21 -0
  187. package/dist/mcp/index.d.ts +2 -0
  188. package/dist/mcp/index.js +2 -0
  189. package/dist/mcp/server.d.ts +11 -0
  190. package/dist/mcp/server.js +57 -0
  191. package/dist/orchestration/client.d.ts +78 -0
  192. package/dist/orchestration/client.js +89 -0
  193. package/dist/orchestration/commands.d.ts +14 -0
  194. package/dist/orchestration/commands.js +312 -0
  195. package/dist/orchestration/index.d.ts +3 -0
  196. package/dist/orchestration/index.js +3 -0
  197. package/dist/orchestration/output/compact-aggregate.d.ts +121 -0
  198. package/dist/orchestration/output/compact-aggregate.js +110 -0
  199. package/dist/orchestration/output/compact-run-list.d.ts +20 -0
  200. package/dist/orchestration/output/compact-run-list.js +16 -0
  201. package/dist/orchestration/output/human.d.ts +80 -0
  202. package/dist/orchestration/output/human.js +252 -0
  203. package/dist/orchestration/output/index.d.ts +4 -0
  204. package/dist/orchestration/output/index.js +4 -0
  205. package/dist/orchestration/tree/index.d.ts +2 -0
  206. package/dist/orchestration/tree/index.js +2 -0
  207. package/dist/orchestration/tree/tree.d.ts +3 -0
  208. package/dist/orchestration/tree/tree.js +142 -0
  209. package/dist/port-lease/client.d.ts +160 -0
  210. package/dist/port-lease/client.js +11 -0
  211. package/dist/port-lease/commands.d.ts +6 -0
  212. package/dist/port-lease/commands.js +17 -0
  213. package/dist/port-lease/index.d.ts +3 -0
  214. package/dist/port-lease/index.js +3 -0
  215. package/dist/port-lease/input.d.ts +65 -0
  216. package/dist/port-lease/input.js +67 -0
  217. package/dist/port-lease/output/format.d.ts +11 -0
  218. package/dist/port-lease/output/format.js +24 -0
  219. package/dist/port-lease/output/index.d.ts +2 -0
  220. package/dist/port-lease/output/index.js +2 -0
  221. package/dist/presentation/client.d.ts +10 -0
  222. package/dist/presentation/client.js +9 -0
  223. package/dist/presentation/commands.d.ts +6 -0
  224. package/dist/presentation/commands.js +78 -0
  225. package/dist/presentation/index.d.ts +4 -0
  226. package/dist/presentation/index.js +3 -0
  227. package/dist/presentation/output/format.d.ts +11 -0
  228. package/dist/presentation/output/format.js +32 -0
  229. package/dist/presentation/output/index.d.ts +3 -0
  230. package/dist/presentation/output/index.js +2 -0
  231. package/dist/project-guard/client.d.ts +88 -0
  232. package/dist/project-guard/client.js +7 -0
  233. package/dist/project-guard/commands.d.ts +4 -0
  234. package/dist/project-guard/commands.js +39 -0
  235. package/dist/project-guard/index.d.ts +3 -0
  236. package/dist/project-guard/index.js +3 -0
  237. package/dist/project-guard/input.d.ts +18 -0
  238. package/dist/project-guard/input.js +47 -0
  239. package/dist/project-guard/output/format.d.ts +11 -0
  240. package/dist/project-guard/output/format.js +35 -0
  241. package/dist/project-guard/output/index.d.ts +2 -0
  242. package/dist/project-guard/output/index.js +2 -0
  243. package/dist/project-workspace/client.d.ts +86 -0
  244. package/dist/project-workspace/client.js +159 -0
  245. package/dist/project-workspace/commands.d.ts +30 -0
  246. package/dist/project-workspace/commands.js +700 -0
  247. package/dist/project-workspace/index.d.ts +5 -0
  248. package/dist/project-workspace/index.js +5 -0
  249. package/dist/project-workspace/metadata-client.d.ts +99 -0
  250. package/dist/project-workspace/metadata-client.js +8 -0
  251. package/dist/project-workspace/metadata-commands.d.ts +4 -0
  252. package/dist/project-workspace/metadata-commands.js +56 -0
  253. package/dist/project-workspace/output/human.d.ts +126 -0
  254. package/dist/project-workspace/output/human.js +103 -0
  255. package/dist/project-workspace/output/index.d.ts +3 -0
  256. package/dist/project-workspace/output/index.js +3 -0
  257. package/dist/project-workspace/output/metadata.d.ts +11 -0
  258. package/dist/project-workspace/output/metadata.js +17 -0
  259. package/dist/project-workspace/tree/index.d.ts +2 -0
  260. package/dist/project-workspace/tree/index.js +2 -0
  261. package/dist/project-workspace/tree/tree.d.ts +3 -0
  262. package/dist/project-workspace/tree/tree.js +197 -0
  263. package/dist/provider/client.d.ts +6 -0
  264. package/dist/provider/client.js +5 -0
  265. package/dist/provider/commands.d.ts +3 -0
  266. package/dist/provider/commands.js +38 -0
  267. package/dist/provider/index.d.ts +3 -0
  268. package/dist/provider/index.js +3 -0
  269. package/dist/reference/commands.d.ts +3 -0
  270. package/dist/reference/commands.js +39 -0
  271. package/dist/reference/index.d.ts +3 -0
  272. package/dist/reference/index.js +3 -0
  273. package/dist/reference/resolve.d.ts +29 -0
  274. package/dist/reference/resolve.js +294 -0
  275. package/dist/reference/tree/index.d.ts +2 -0
  276. package/dist/reference/tree/index.js +2 -0
  277. package/dist/reference/tree/tree.d.ts +3 -0
  278. package/dist/reference/tree/tree.js +17 -0
  279. package/dist/remote-node/client.d.ts +258 -0
  280. package/dist/remote-node/client.js +12 -0
  281. package/dist/remote-node/commands.d.ts +6 -0
  282. package/dist/remote-node/commands.js +264 -0
  283. package/dist/remote-node/connector.d.ts +59 -0
  284. package/dist/remote-node/connector.js +122 -0
  285. package/dist/remote-node/index.d.ts +4 -0
  286. package/dist/remote-node/index.js +4 -0
  287. package/dist/remote-node/reachability.d.ts +22 -0
  288. package/dist/remote-node/reachability.js +34 -0
  289. package/dist/remote-node/text.d.ts +9 -0
  290. package/dist/remote-node/text.js +64 -0
  291. package/dist/remote-node/tree/index.d.ts +2 -0
  292. package/dist/remote-node/tree/index.js +2 -0
  293. package/dist/remote-node/tree/tree.d.ts +3 -0
  294. package/dist/remote-node/tree/tree.js +51 -0
  295. package/dist/run-ledger/client.d.ts +358 -0
  296. package/dist/run-ledger/client.js +13 -0
  297. package/dist/run-ledger/commands.d.ts +8 -0
  298. package/dist/run-ledger/commands.js +19 -0
  299. package/dist/run-ledger/index.d.ts +3 -0
  300. package/dist/run-ledger/index.js +3 -0
  301. package/dist/run-ledger/input.d.ts +42 -0
  302. package/dist/run-ledger/input.js +107 -0
  303. package/dist/run-ledger/output/format.d.ts +11 -0
  304. package/dist/run-ledger/output/format.js +49 -0
  305. package/dist/run-ledger/output/index.d.ts +2 -0
  306. package/dist/run-ledger/output/index.js +2 -0
  307. package/dist/session/agent-permission.d.ts +63 -0
  308. package/dist/session/agent-permission.js +20 -0
  309. package/dist/session/approval/client.d.ts +117 -0
  310. package/dist/session/approval/client.js +7 -0
  311. package/dist/session/approval/commands.d.ts +7 -0
  312. package/dist/session/approval/commands.js +123 -0
  313. package/dist/session/approval/index.d.ts +3 -0
  314. package/dist/session/approval/index.js +3 -0
  315. package/dist/session/approval/output/format.d.ts +12 -0
  316. package/dist/session/approval/output/format.js +25 -0
  317. package/dist/session/approval/output/index.d.ts +2 -0
  318. package/dist/session/approval/output/index.js +2 -0
  319. package/dist/session/attach-client.d.ts +16 -0
  320. package/dist/session/attach-client.js +8 -0
  321. package/dist/session/attach-render.d.ts +16 -0
  322. package/dist/session/attach-render.js +154 -0
  323. package/dist/session/attach.d.ts +5 -0
  324. package/dist/session/attach.js +106 -0
  325. package/dist/session/client.d.ts +132 -0
  326. package/dist/session/client.js +128 -0
  327. package/dist/session/coding-client.d.ts +16 -0
  328. package/dist/session/coding-client.js +15 -0
  329. package/dist/session/coding-commands.d.ts +4 -0
  330. package/dist/session/coding-commands.js +50 -0
  331. package/dist/session/commands.d.ts +13 -0
  332. package/dist/session/commands.js +488 -0
  333. package/dist/session/create-tasks.d.ts +20 -0
  334. package/dist/session/create-tasks.js +110 -0
  335. package/dist/session/index.d.ts +9 -0
  336. package/dist/session/index.js +7 -0
  337. package/dist/session/interaction/client.d.ts +347 -0
  338. package/dist/session/interaction/client.js +15 -0
  339. package/dist/session/interaction/commands.d.ts +7 -0
  340. package/dist/session/interaction/commands.js +101 -0
  341. package/dist/session/interaction/index.d.ts +3 -0
  342. package/dist/session/interaction/index.js +3 -0
  343. package/dist/session/interaction/input.d.ts +15 -0
  344. package/dist/session/interaction/input.js +46 -0
  345. package/dist/session/interaction/output/format.d.ts +11 -0
  346. package/dist/session/interaction/output/format.js +3 -0
  347. package/dist/session/interaction/output/index.d.ts +2 -0
  348. package/dist/session/interaction/output/index.js +2 -0
  349. package/dist/session/output/diff.d.ts +3 -0
  350. package/dist/session/output/diff.js +30 -0
  351. package/dist/session/output/failure.d.ts +11 -0
  352. package/dist/session/output/failure.js +24 -0
  353. package/dist/session/output/human.d.ts +112 -0
  354. package/dist/session/output/human.js +71 -0
  355. package/dist/session/output/index.d.ts +6 -0
  356. package/dist/session/output/index.js +6 -0
  357. package/dist/session/output/observe.d.ts +4 -0
  358. package/dist/session/output/observe.js +46 -0
  359. package/dist/session/output/tasks.d.ts +19 -0
  360. package/dist/session/output/tasks.js +34 -0
  361. package/dist/session/rename.d.ts +3 -0
  362. package/dist/session/rename.js +37 -0
  363. package/dist/session/task-file.d.ts +5 -0
  364. package/dist/session/task-file.js +23 -0
  365. package/dist/session/tree/index.d.ts +2 -0
  366. package/dist/session/tree/index.js +2 -0
  367. package/dist/session/tree/tree.d.ts +3 -0
  368. package/dist/session/tree/tree.js +309 -0
  369. package/dist/session/turn/client.d.ts +25 -0
  370. package/dist/session/turn/client.js +40 -0
  371. package/dist/session/turn/commands.d.ts +6 -0
  372. package/dist/session/turn/commands.js +157 -0
  373. package/dist/session/turn/index.d.ts +4 -0
  374. package/dist/session/turn/index.js +3 -0
  375. package/dist/session/turn/output.d.ts +42 -0
  376. package/dist/session/turn/output.js +38 -0
  377. package/dist/status/client.d.ts +119 -0
  378. package/dist/status/client.js +5 -0
  379. package/dist/status/command.d.ts +4 -0
  380. package/dist/status/command.js +40 -0
  381. package/dist/status/doctor.d.ts +15 -0
  382. package/dist/status/doctor.js +111 -0
  383. package/dist/status/index.d.ts +5 -0
  384. package/dist/status/index.js +4 -0
  385. package/dist/status/output/compact.d.ts +31 -0
  386. package/dist/status/output/compact.js +46 -0
  387. package/dist/status/output/human.d.ts +7 -0
  388. package/dist/status/output/human.js +30 -0
  389. package/dist/status/output/index.d.ts +3 -0
  390. package/dist/status/output/index.js +3 -0
  391. package/dist/terminal/arguments.d.ts +13 -0
  392. package/dist/terminal/arguments.js +79 -0
  393. package/dist/terminal/client.d.ts +79 -0
  394. package/dist/terminal/client.js +68 -0
  395. package/dist/terminal/commands.d.ts +7 -0
  396. package/dist/terminal/commands.js +131 -0
  397. package/dist/terminal/control-commands.d.ts +10 -0
  398. package/dist/terminal/control-commands.js +212 -0
  399. package/dist/terminal/index.d.ts +4 -0
  400. package/dist/terminal/index.js +4 -0
  401. package/dist/terminal/output/compact-list.d.ts +147 -0
  402. package/dist/terminal/output/compact-list.js +152 -0
  403. package/dist/terminal/output/human.d.ts +59 -0
  404. package/dist/terminal/output/human.js +55 -0
  405. package/dist/terminal/output/index.d.ts +3 -0
  406. package/dist/terminal/output/index.js +3 -0
  407. package/dist/terminal/tree/index.d.ts +2 -0
  408. package/dist/terminal/tree/index.js +2 -0
  409. package/dist/terminal/tree/tree.d.ts +3 -0
  410. package/dist/terminal/tree/tree.js +104 -0
  411. package/guidance/maia-cli/SKILL.md +58 -0
  412. package/guidance/maia-orchestration/SKILL.md +54 -0
  413. package/package.json +76 -0
package/README.md ADDED
@@ -0,0 +1,287 @@
1
+ # `maia` CLI (`@maiaos/cli`)
2
+
3
+ [![npm canary](https://img.shields.io/npm/v/@maiaos/cli/canary?label=npm%20canary)](https://www.npmjs.com/package/@maiaos/cli)
4
+
5
+ The `maia` command-line tool and MCP server for Maia OS: start, drive, observe
6
+ and stop swarms of AI coding agents (Claude Code and Codex workers) from a
7
+ terminal, a script, or another agent such as Claude Code.
8
+
9
+ The CLI is the reference Maia client and the first complete one. Every
10
+ Node-facing command goes through [`@maiaos/sdk`](../../packages/sdk/README.md)
11
+ to Maia Node; `--json` prints one bounded JSON result built for LLMs and
12
+ scripts. `maia mcp` serves the same operations as MCP tools, and `maia agent`
13
+ runs Maia's own coding agent.
14
+
15
+ ## Install
16
+
17
+ From a source checkout (see the [quick start](../../README.md#quick-start)):
18
+
19
+ ```sh
20
+ pnpm dev:cli # installs ~/.local/bin/maia for this checkout
21
+ pnpm maia help # or run this checkout's CLI without installing
22
+ ```
23
+
24
+ Each call runs the checkout around your working directory, so a dev worktree
25
+ runs its own build against its own Node. Pre-release builds:
26
+ `@maiaos/cli@nightly` and `@maiaos/cli@canary`; no stable release exists.
27
+
28
+ ## Example
29
+
30
+ ```sh
31
+ maia status
32
+ maia --json project list
33
+ maia --json session create --workspace <workspace-id> --executor codex-cli --command-id create-1
34
+ maia --json session start <session-id> --expected-revision 1 --command-id start-1 --wait
35
+ printf '%s' "Explain the build" |
36
+ maia --json session turn send --session <session-id> --prompt-stdin --expected-revision <revision> --command-id send-1
37
+ maia --json session turn wait <turn-id> --timeout 10m
38
+ maia --json session turn show <turn-id> --include-content
39
+ ```
40
+
41
+ `session create --message <text>` creates, starts and sends the first turn in
42
+ one command, and `maia doctor` checks the installation, the Node and the
43
+ accounts, naming the next command for each failure.
44
+
45
+ A coding Session writes in a worktree of its own from a base ref; review and
46
+ retire it with `diff` and `archive`
47
+ ([coding Sessions](../../docs/maia-swarm/external-executors.md#coding-sessions)):
48
+
49
+ ```sh
50
+ maia --json session create --workspace <workspace-id> --executor claude-code --base main --command-id code-1
51
+ maia session diff <session-id> --stat
52
+ maia --json session archive <session-id> --expected-revision <revision> --command-id archive-1
53
+ ```
54
+
55
+ ## Commands
56
+
57
+ `maia help` lists the root commands by section, and `-h` or `--help` works on
58
+ every command (`maia session start --help`). `maia help --json` describes
59
+ every command, with its availability (implemented or source candidate),
60
+ example and operation, plus the [agent contract](../../docs/reference/cli.md#agent-contract);
61
+ `maia <command> --help --json` adds typed arguments. Each command is authored
62
+ once, as a leaf of a command-tree fragment in its feature's `tree/` scope;
63
+ `src/command-tree/` holds the grammar, help and suggestions.
64
+
65
+ Paths are scope-first: a noun, then a verb (`session turn send`,
66
+ `connection capacity set`). The ID a command is about is positional; the ID of
67
+ a parent or related resource is a flag (`--session`, `--workspace`, `--run`).
68
+ An unknown or retired path prints `Did you mean 'maia ...'?` and runs nothing.
69
+ Any resource argument takes an ID, an ID prefix or a unique name or Session
70
+ title; the CLI asks the Node to resolve it and sends the exact ID. A missing
71
+ required `--project` or `--workspace` comes from the current folder, then the
72
+ selected Workspace ([references and defaults](../../docs/reference/cli.md#references-and-defaults)).
73
+ List commands print plain header tables.
74
+
75
+ | Family | What it does |
76
+ | ------------------------------------------ | ------------------------------------------------------------------------------------------------- |
77
+ | `status`, `node status`, `node monitor` | Node readiness and health (`status` is a shortcut); a one-time loopback URL for the admin monitor |
78
+ | `setup`, `login`, `connection` | Use installed vendor CLIs, sign in worker accounts and model providers, usage, capacity |
79
+ | `integration`, `provider` | Approve vendor executables; model-provider pools |
80
+ | `project`, `workspace`, `container` | Register repositories, Project guards, Workspaces and containers |
81
+ | `session` | Create, rename, start, observe, stop, resume, diff and archive workers; adopt, message, approve |
82
+ | `session turn` | Send, show, wait for and interrupt turns |
83
+ | `session approval`, `session interaction` | What workers wait on a person for; record-only questions to a person |
84
+ | `receipt` | Look up the outcome of any mutation by command ID |
85
+ | `port` | Advisory loopback port leases for Sessions sharing one machine |
86
+ | `hold` | Emergency holds on exact Projects and accounts; release them |
87
+ | `run`, `terminal`, `context` | Runs and the Run ledger, terminals, context |
88
+ | `execution` | Execution environments, worktrees, placements and relocation |
89
+ | `import` | Find Claude Code and Codex sessions to adopt |
90
+ | `presentation` | Read-only view specifications |
91
+ | `reference` | The exact ID of a name, ID prefix or title, or the current folder's Project or Workspace |
92
+ | `agent` | Maia's interactive coding agent on the official Pi SDK |
93
+ | `mcp` | Coordinator or worker MCP server over stdio |
94
+ | `node install`, `node list`, `node remove` | Remote Nodes over SSH; `--node <name>` routes any command to one |
95
+ | `doctor`, `version`, `completion` | Installation, Node and account check; version; shell completion (`bash`, `zsh`, `fish`) |
96
+
97
+ Global options may go anywhere before `--`:
98
+ `maia [--json] [--profile <name>] [--node <name>] [--no-input] <command>`;
99
+ everything after `--` belongs to the command, `--json` included. `--profile`
100
+ selects a local Node runtime profile, not a configuration profile.
101
+ `MAIA_PROFILE`, `MAIA_NODE` and `MAIA_NO_INPUT` stand in for `--profile`,
102
+ `--node` and `--no-input` on the commands that take them; a flag wins.
103
+ `--timeout` and `--stall-after` take durations such as `30s`, `10m` or `1h`;
104
+ lists show 20 items per page unless their usage shows another range. `maia version --json` reports the
105
+ version, the protocol and, in a build made with `MAIA_CLI_BUILD_COMMIT`, the
106
+ commit. `-v` is not an option; use `--version` or `maia version`.
107
+ `maia completion <bash|zsh|fish>` prints a completion script generated from
108
+ the command tree.
109
+
110
+ ## Output and exit codes
111
+
112
+ A JSON result is `{ "ok": true, "result": { "command", "result" } }` on stdout
113
+ or `{ "ok": false, "error": { "code", "message", "retryable" } }` on stderr;
114
+ a usage error adds the command's `usage` lines and a `hint`.
115
+
116
+ | Exit | Meaning |
117
+ | ---- | -------------------------------------------------------------------- |
118
+ | 0 | Done |
119
+ | 64 | Invalid usage |
120
+ | 66 | Unknown ID |
121
+ | 69 | Node unavailable |
122
+ | 70 | Other failure, a waited turn that failed, or a failed `doctor` check |
123
+ | 74 | Deadline reached (for example `session turn wait`) |
124
+ | 75 | Retry later: revision changed, full, limited, held |
125
+ | 76 | Outcome unknown: check `maia receipt show` |
126
+ | 77 | Not permitted |
127
+
128
+ Mutations take the current revision and a command ID you choose. Retry with
129
+ the same command ID; the Node replays the first result instead of acting twice.
130
+ A person-facing prompt appears only at a terminal, without `--json` and
131
+ `--no-input`; otherwise the command exits 64 and names its flags.
132
+
133
+ A consequential mutation that needs a preview is two-phase. `--dry-run`
134
+ previews and `--confirm-stdin` confirms a preview piped back. At a terminal a
135
+ command that takes its request as flags (`session adopt`, `project guard set`,
136
+ `setup`, `node install`, `node remove`) previews and asks y/N; one that reads
137
+ its request from `--input-stdin` never prompts, so it needs `--dry-run` or
138
+ `--confirm-stdin`:
139
+
140
+ ```sh
141
+ maia --json hold place --input-stdin --dry-run < in.json | maia hold place --confirm-stdin
142
+ ```
143
+
144
+ ## Sign-in
145
+
146
+ ```sh
147
+ maia connection detect # the installed claude and codex as the Node sees them
148
+ maia setup [--max-sessions 4] # use them as they are: system-default accounts
149
+ maia login # list worker accounts and model providers
150
+ maia login claude # add or re-sign a Claude Code account
151
+ maia login codex [--name codex-2] [--device-code]
152
+ maia login vercel-ai-gateway # a model provider from Pi's catalog
153
+ maia connection usage show codex-1 [--refresh]
154
+ printf %s "$AI_GATEWAY_API_KEY" | maia login gateway --name vercel \
155
+ --base-url https://ai-gateway.vercel.sh --api-key-stdin
156
+ maia connection models list --connection vercel
157
+ maia session create --workspace <workspace-id> --connection vercel \
158
+ --executor claude-code --model anthropic/claude-sonnet-4.5
159
+ ```
160
+
161
+ `maia login claude` and `maia login codex` run the vendor's own sign-in for a
162
+ Maia-managed account root; Maia never reads or stores that credential. Model
163
+ providers store one credential per provider in Maia's `auth.json`. On a server,
164
+ Codex signs in with a device code and Claude Code with a link and a pasted
165
+ code. A person approves vendor executables with `maia integration plan
166
+ <codex|claude-code>` and `maia integration apply <codex|claude-code> --plan
167
+ <plan-id>`. `maia connection capacity set` changes an account's session cap. A gateway Connection lets
168
+ Claude Code and Codex Sessions use an AI gateway's models with its API key,
169
+ which the CLI reads from stdin and never prints; a subscription proxy can
170
+ breach provider terms, so prefer an API-key gateway.
171
+
172
+ ## Coordinator MCP server
173
+
174
+ `maia mcp` serves 43 coordinator tools over stdio (MCP protocol 2025-06-18),
175
+ such as `session_create`, `turn_send`, `turn_wait`, `port_lease_acquire`,
176
+ `reference_resolve` and `receipt_get`. Their input schemas are generated from `@maiaos/protocol`, so
177
+ they never drift from the JSON commands. Accounts, integrations, confirmations
178
+ and answers are not exposed; the only human-only operation exposed is
179
+ `turn.send`, which the coordinator sends as the operator's client. The
180
+ [`maia` plugin](../../plugins/maia) registers this server and ships the
181
+ `maia-orchestration` Skill for Claude Code and Codex
182
+ ([setup](../../README.md#4-drive-maia-from-claude-code-or-codex)). An invalid
183
+ argument names the failing field in the error message.
184
+
185
+ ## Worker Sessions, roles and guards (source candidate)
186
+
187
+ A Codex or Claude Code Session that Maia launches gets its own credential in
188
+ `MAIA_SESSION_CREDENTIAL` and the Node's loopback origin in `MAIA_NODE_ORIGIN`,
189
+ never the operator's bearer. With that credential, `maia` and `maia mcp` act
190
+ as the Session within its role: a `worker` reads its context, Node status and
191
+ its Project's Session list and manages its own port leases; an `orchestrator` may also read its Project's
192
+ guards and create child Sessions. Anything else fails with `role_denied`
193
+ (exit 77). Without a valid `MAIA_NODE_ORIGIN` the command fails closed; it
194
+ never falls back to the operator's profile. With a Session credential,
195
+ `maia session list --all` still lists only that Session's Project; naming a
196
+ different Project fails with `role_denied`. Human and external-coordinator
197
+ lists remain unchanged.
198
+
199
+ Coding workers receive a launch-configured `maia_worker` MCP server running
200
+ `maia mcp --worker`. The vendor starts it outside its tool sandbox; the
201
+ sandbox keeps its existing filesystem and network limits. `--worker` requires
202
+ the Session environment even when both variables are missing. Plain `maia mcp`
203
+ also selects worker tools when either variable is present. Only Project-scoped `session_list`, `context_show`,
204
+ `node_status` and the four `port_lease_*` tools are exposed. Node authentication
205
+ checks expiry and revocation on every call.
206
+
207
+ ```sh
208
+ maia session create --workspace <workspace-id> --role orchestrator
209
+ maia project guard show <project-id>
210
+ maia --json project guard set <project-id> --expected-revision 0 \
211
+ --max-depth 2 --max-live-children 4 --max-messages-per-minute 60 \
212
+ --max-leases-per-session 8 --dry-run |
213
+ maia project guard set --confirm-stdin
214
+ ```
215
+
216
+ A person previews a Project's guards and confirms the preview within 30
217
+ seconds (at a terminal, `project guard set` previews and asks y/N); human
218
+ preview text never shows the proof. The Node enforces the
219
+ guards when a Session creates a child, sends a message or leases a port. A
220
+ full guard exits 75; the depth guard exits 70 until a person raises it.
221
+
222
+ ## Emergency holds (source candidate)
223
+
224
+ ```sh
225
+ # place.json: {commandId, reason, running, targets}
226
+ maia --json hold place --input-stdin --dry-run < place.json | maia hold place --confirm-stdin
227
+ maia hold list --state active
228
+ # release.json: {commandId, holdId, expectedRevision}
229
+ maia --json hold release --input-stdin --dry-run < release.json | maia hold release --confirm-stdin
230
+ ```
231
+
232
+ A hold names exact Projects or accounts, for example
233
+ `"targets": [{ "kind": "project", "id": "project_..." }]`; there is no `all`.
234
+ `"running": "keep"` rejects new work; `"running": "stop"` also stops the
235
+ Sessions the preview lists. Work refused by a hold exits 75 and names the
236
+ hold. There is no automatic confirmation, and no coordinator tool can place
237
+ or release a hold.
238
+
239
+ ## External questions and recorded answers (source candidate)
240
+
241
+ ```sh
242
+ maia --json session interaction create --input-stdin
243
+ maia --json session interaction list --session <session-id> --project <project-id> --status pending --limit 8
244
+ maia --json session interaction respond --input-stdin
245
+ ```
246
+
247
+ A question or selection is attached to an idle Session and answered by a
248
+ person. Answers are recorded data, never approval to act. Inputs are strict
249
+ JSON on stdin; reuse the same command ID after an uncertain result and
250
+ reconcile with `maia receipt show`. See the
251
+ [interaction contract](../../packages/protocol/src/interaction/README.md).
252
+
253
+ ## Status
254
+
255
+ Source-implemented candidate; many families are release-disabled, as
256
+ `maia help --json` reports. Planned: `maia session attach` with live streaming
257
+ (S12), `maia lock` (S16), `maia node install` for fleets (S14) and
258
+ `maia update` (RL4). A team Workspace first-owner bootstrap is
259
+ designed, not implemented; see
260
+ [team Workspaces and Control Nodes](../../docs/team-workspaces-and-control-nodes.md).
261
+
262
+ ## Development
263
+
264
+ ```sh
265
+ pnpm --filter @maiaos/cli build
266
+ pnpm --filter @maiaos/cli lint
267
+ pnpm --filter @maiaos/cli typecheck
268
+ pnpm --filter @maiaos/cli test
269
+ ```
270
+
271
+ The release entry is a standalone, tree-shaken executable with a 355 KiB hard
272
+ ceiling; `src/bin/maia.test.ts` locks the packed contents and size. The
273
+ package's library entry exports `makeCli` and `runCli`, which return an Effect
274
+ of the exit code ([D-068](../../docs/decisions.md#d-068)); the `maia` binary
275
+ runs that Effect on one runtime per process.
276
+
277
+ ## Documentation
278
+
279
+ - [CLI reference](../../docs/reference/cli.md): the complete target grammar and
280
+ JSON contracts
281
+ - [Normative contracts](../../docs/reference/contracts.md)
282
+ - [`maia agent`](../../packages/agent/README.md) and
283
+ [Maia Node](../../services/node/README.md)
284
+
285
+ ## License
286
+
287
+ No license has been published yet. All rights reserved.
@@ -0,0 +1,59 @@
1
+ Maia CLI third-party notices
2
+
3
+ Generated from the exact esbuild input graph. Do not edit by hand.
4
+
5
+ ================================================================================
6
+ @effect/platform-node-shared 4.0.0
7
+ Declared license: MIT
8
+ Bundled source: node_modules/.pnpm/@effect+platform-node-shared@4.0.0_effect@4.0.0/node_modules/@effect/platform-node-shared
9
+
10
+ --- node_modules/.pnpm/@effect+platform-node-shared@4.0.0_effect@4.0.0/node_modules/@effect/platform-node-shared/LICENSE ---
11
+ MIT License
12
+
13
+ Copyright (c) 2023 Effectful Technologies Inc
14
+
15
+ Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ of this software and associated documentation files (the "Software"), to deal
17
+ in the Software without restriction, including without limitation the rights
18
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ copies of the Software, and to permit persons to whom the Software is
20
+ furnished to do so, subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be included in all
23
+ copies or substantial portions of the Software.
24
+
25
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ SOFTWARE.
32
+
33
+ ================================================================================
34
+ effect 4.0.0
35
+ Declared license: MIT
36
+ Bundled source: node_modules/.pnpm/effect@4.0.0/node_modules/effect
37
+
38
+ --- node_modules/.pnpm/effect@4.0.0/node_modules/effect/LICENSE ---
39
+ MIT License
40
+
41
+ Copyright (c) 2023 Effectful Technologies Inc
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy
44
+ of this software and associated documentation files (the "Software"), to deal
45
+ in the Software without restriction, including without limitation the rights
46
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
47
+ copies of the Software, and to permit persons to whom the Software is
48
+ furnished to do so, subject to the following conditions:
49
+
50
+ The above copyright notice and this permission notice shall be included in all
51
+ copies or substantial portions of the Software.
52
+
53
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
54
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
55
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
56
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
57
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
58
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
59
+ SOFTWARE.
@@ -0,0 +1,145 @@
1
+ {
2
+ "$schema": "https://cyclonedx.org/schema/bom-1.6.schema.json",
3
+ "bomFormat": "CycloneDX",
4
+ "components": [
5
+ {
6
+ "bom-ref": "@effect/platform-node-shared@4.0.0",
7
+ "licenses": [
8
+ {
9
+ "license": {
10
+ "name": "MIT"
11
+ }
12
+ }
13
+ ],
14
+ "name": "@effect/platform-node-shared",
15
+ "properties": [
16
+ {
17
+ "name": "maia:source-kind",
18
+ "value": "third-party"
19
+ },
20
+ {
21
+ "name": "maia:source-path",
22
+ "value": "node_modules/.pnpm/@effect+platform-node-shared@4.0.0_effect@4.0.0/node_modules/@effect/platform-node-shared"
23
+ }
24
+ ],
25
+ "purl": "pkg:npm/%40effect/platform-node-shared@4.0.0",
26
+ "scope": "required",
27
+ "type": "library",
28
+ "version": "4.0.0"
29
+ },
30
+ {
31
+ "bom-ref": "@maiaos/protocol@0.1.0-canary.2",
32
+ "name": "@maiaos/protocol",
33
+ "properties": [
34
+ {
35
+ "name": "maia:source-kind",
36
+ "value": "workspace"
37
+ },
38
+ {
39
+ "name": "maia:source-path",
40
+ "value": "packages/protocol"
41
+ }
42
+ ],
43
+ "purl": "pkg:npm/%40maiaos/protocol@0.1.0-canary.2",
44
+ "scope": "required",
45
+ "type": "library",
46
+ "version": "0.1.0-canary.2"
47
+ },
48
+ {
49
+ "bom-ref": "@maiaos/sdk@0.1.0-canary.2",
50
+ "name": "@maiaos/sdk",
51
+ "properties": [
52
+ {
53
+ "name": "maia:source-kind",
54
+ "value": "workspace"
55
+ },
56
+ {
57
+ "name": "maia:source-path",
58
+ "value": "packages/sdk"
59
+ }
60
+ ],
61
+ "purl": "pkg:npm/%40maiaos/sdk@0.1.0-canary.2",
62
+ "scope": "required",
63
+ "type": "library",
64
+ "version": "0.1.0-canary.2"
65
+ },
66
+ {
67
+ "bom-ref": "effect@4.0.0",
68
+ "licenses": [
69
+ {
70
+ "license": {
71
+ "name": "MIT"
72
+ }
73
+ }
74
+ ],
75
+ "name": "effect",
76
+ "properties": [
77
+ {
78
+ "name": "maia:source-kind",
79
+ "value": "third-party"
80
+ },
81
+ {
82
+ "name": "maia:source-path",
83
+ "value": "node_modules/.pnpm/effect@4.0.0/node_modules/effect"
84
+ }
85
+ ],
86
+ "purl": "pkg:npm/effect@4.0.0",
87
+ "scope": "required",
88
+ "type": "library",
89
+ "version": "4.0.0"
90
+ }
91
+ ],
92
+ "dependencies": [
93
+ {
94
+ "dependsOn": [
95
+ "@effect/platform-node-shared@4.0.0",
96
+ "@maiaos/protocol@0.1.0-canary.2",
97
+ "@maiaos/sdk@0.1.0-canary.2",
98
+ "effect@4.0.0"
99
+ ],
100
+ "ref": "@maiaos/cli@0.1.0-canary.2"
101
+ },
102
+ {
103
+ "dependsOn": [],
104
+ "ref": "@effect/platform-node-shared@4.0.0"
105
+ },
106
+ {
107
+ "dependsOn": [],
108
+ "ref": "@maiaos/protocol@0.1.0-canary.2"
109
+ },
110
+ {
111
+ "dependsOn": [],
112
+ "ref": "@maiaos/sdk@0.1.0-canary.2"
113
+ },
114
+ {
115
+ "dependsOn": [],
116
+ "ref": "effect@4.0.0"
117
+ }
118
+ ],
119
+ "metadata": {
120
+ "component": {
121
+ "bom-ref": "@maiaos/cli@0.1.0-canary.2",
122
+ "hashes": [
123
+ {
124
+ "alg": "SHA-256",
125
+ "content": "8e39714f458fb216a194c19e86a491c4ea7cda05a1c257b6d973bced5c93e818"
126
+ }
127
+ ],
128
+ "name": "@maiaos/cli",
129
+ "type": "application",
130
+ "version": "0.1.0-canary.2"
131
+ },
132
+ "properties": [
133
+ {
134
+ "name": "maia:artifact",
135
+ "value": "dist/bin/maia.mjs"
136
+ },
137
+ {
138
+ "name": "maia:generator",
139
+ "value": "apps/cli/scripts/build-executable.mjs"
140
+ }
141
+ ]
142
+ },
143
+ "specVersion": "1.6",
144
+ "version": 1
145
+ }