@agentuity/cli 1.0.1 → 1.0.3

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 (331) hide show
  1. package/AGENTS.md +40 -24
  2. package/bin/cli.ts +47 -22
  3. package/dist/agent-detection.d.ts +23 -38
  4. package/dist/agent-detection.d.ts.map +1 -1
  5. package/dist/agent-detection.js +412 -153
  6. package/dist/agent-detection.js.map +1 -1
  7. package/dist/ai-help.d.ts +23 -0
  8. package/dist/ai-help.d.ts.map +1 -0
  9. package/dist/ai-help.js +328 -0
  10. package/dist/ai-help.js.map +1 -0
  11. package/dist/api.js +1 -1
  12. package/dist/api.js.map +1 -1
  13. package/dist/auth.d.ts +10 -1
  14. package/dist/auth.d.ts.map +1 -1
  15. package/dist/auth.js +176 -16
  16. package/dist/auth.js.map +1 -1
  17. package/dist/banner.d.ts.map +1 -1
  18. package/dist/banner.js +5 -0
  19. package/dist/banner.js.map +1 -1
  20. package/dist/cache/agent-intro.d.ts +13 -0
  21. package/dist/cache/agent-intro.d.ts.map +1 -0
  22. package/dist/cache/agent-intro.js +54 -0
  23. package/dist/cache/agent-intro.js.map +1 -0
  24. package/dist/cache/index.d.ts +1 -0
  25. package/dist/cache/index.d.ts.map +1 -1
  26. package/dist/cache/index.js +1 -0
  27. package/dist/cache/index.js.map +1 -1
  28. package/dist/cache/resource-region.d.ts +3 -2
  29. package/dist/cache/resource-region.d.ts.map +1 -1
  30. package/dist/cache/resource-region.js +13 -4
  31. package/dist/cache/resource-region.js.map +1 -1
  32. package/dist/catalyst.d.ts +7 -0
  33. package/dist/catalyst.d.ts.map +1 -0
  34. package/dist/catalyst.js +15 -0
  35. package/dist/catalyst.js.map +1 -0
  36. package/dist/cli.d.ts +12 -1
  37. package/dist/cli.d.ts.map +1 -1
  38. package/dist/cli.js +290 -67
  39. package/dist/cli.js.map +1 -1
  40. package/dist/cmd/ai/detect.d.ts +3 -0
  41. package/dist/cmd/ai/detect.d.ts.map +1 -0
  42. package/dist/cmd/ai/detect.js +49 -0
  43. package/dist/cmd/ai/detect.js.map +1 -0
  44. package/dist/cmd/ai/index.d.ts.map +1 -1
  45. package/dist/cmd/ai/index.js +18 -1
  46. package/dist/cmd/ai/index.js.map +1 -1
  47. package/dist/cmd/ai/intro.d.ts +7 -0
  48. package/dist/cmd/ai/intro.d.ts.map +1 -0
  49. package/dist/cmd/ai/intro.js +141 -0
  50. package/dist/cmd/ai/intro.js.map +1 -0
  51. package/dist/cmd/ai/opencode/run.d.ts.map +1 -1
  52. package/dist/cmd/ai/opencode/run.js +5 -0
  53. package/dist/cmd/ai/opencode/run.js.map +1 -1
  54. package/dist/cmd/build/ast.d.ts.map +1 -1
  55. package/dist/cmd/build/ast.js +79 -0
  56. package/dist/cmd/build/ast.js.map +1 -1
  57. package/dist/cmd/build/vite/bun-dev-server.d.ts.map +1 -1
  58. package/dist/cmd/build/vite/bun-dev-server.js +2 -0
  59. package/dist/cmd/build/vite/bun-dev-server.js.map +1 -1
  60. package/dist/cmd/build/vite/docs-generator.d.ts.map +1 -1
  61. package/dist/cmd/build/vite/docs-generator.js +15 -1
  62. package/dist/cmd/build/vite/docs-generator.js.map +1 -1
  63. package/dist/cmd/build/vite/env-types-generator.d.ts +26 -0
  64. package/dist/cmd/build/vite/env-types-generator.d.ts.map +1 -0
  65. package/dist/cmd/build/vite/env-types-generator.js +110 -0
  66. package/dist/cmd/build/vite/env-types-generator.js.map +1 -0
  67. package/dist/cmd/build/vite/index.d.ts +2 -0
  68. package/dist/cmd/build/vite/index.d.ts.map +1 -1
  69. package/dist/cmd/build/vite/index.js +12 -1
  70. package/dist/cmd/build/vite/index.js.map +1 -1
  71. package/dist/cmd/build/vite/public-asset-path-plugin.d.ts.map +1 -1
  72. package/dist/cmd/build/vite/public-asset-path-plugin.js.map +1 -1
  73. package/dist/cmd/build/vite/vite-builder.d.ts +2 -0
  74. package/dist/cmd/build/vite/vite-builder.d.ts.map +1 -1
  75. package/dist/cmd/build/vite/vite-builder.js +10 -1
  76. package/dist/cmd/build/vite/vite-builder.js.map +1 -1
  77. package/dist/cmd/cloud/db/create.js.map +1 -1
  78. package/dist/cmd/cloud/db/delete.js.map +1 -1
  79. package/dist/cmd/cloud/db/get.d.ts.map +1 -1
  80. package/dist/cmd/cloud/db/get.js +27 -12
  81. package/dist/cmd/cloud/db/get.js.map +1 -1
  82. package/dist/cmd/cloud/deploy-fork.d.ts.map +1 -1
  83. package/dist/cmd/cloud/deploy-fork.js +2 -0
  84. package/dist/cmd/cloud/deploy-fork.js.map +1 -1
  85. package/dist/cmd/cloud/deploy.d.ts.map +1 -1
  86. package/dist/cmd/cloud/deploy.js +17 -0
  87. package/dist/cmd/cloud/deploy.js.map +1 -1
  88. package/dist/cmd/cloud/env/import.js.map +1 -1
  89. package/dist/cmd/cloud/env/list.js.map +1 -1
  90. package/dist/cmd/cloud/env/push.js.map +1 -1
  91. package/dist/cmd/cloud/keyvalue/util.d.ts.map +1 -1
  92. package/dist/cmd/cloud/keyvalue/util.js +3 -3
  93. package/dist/cmd/cloud/keyvalue/util.js.map +1 -1
  94. package/dist/cmd/cloud/machine/list.js +3 -3
  95. package/dist/cmd/cloud/machine/list.js.map +1 -1
  96. package/dist/cmd/cloud/region/index.js.map +1 -1
  97. package/dist/cmd/cloud/region-lookup.d.ts +7 -4
  98. package/dist/cmd/cloud/region-lookup.d.ts.map +1 -1
  99. package/dist/cmd/cloud/region-lookup.js +59 -14
  100. package/dist/cmd/cloud/region-lookup.js.map +1 -1
  101. package/dist/cmd/cloud/sandbox/cp.d.ts.map +1 -1
  102. package/dist/cmd/cloud/sandbox/cp.js +7 -5
  103. package/dist/cmd/cloud/sandbox/cp.js.map +1 -1
  104. package/dist/cmd/cloud/sandbox/create.js +2 -2
  105. package/dist/cmd/cloud/sandbox/create.js.map +1 -1
  106. package/dist/cmd/cloud/sandbox/delete.d.ts.map +1 -1
  107. package/dist/cmd/cloud/sandbox/delete.js +8 -7
  108. package/dist/cmd/cloud/sandbox/delete.js.map +1 -1
  109. package/dist/cmd/cloud/sandbox/download.d.ts.map +1 -1
  110. package/dist/cmd/cloud/sandbox/download.js +7 -5
  111. package/dist/cmd/cloud/sandbox/download.js.map +1 -1
  112. package/dist/cmd/cloud/sandbox/env.d.ts.map +1 -1
  113. package/dist/cmd/cloud/sandbox/env.js +7 -5
  114. package/dist/cmd/cloud/sandbox/env.js.map +1 -1
  115. package/dist/cmd/cloud/sandbox/exec.d.ts.map +1 -1
  116. package/dist/cmd/cloud/sandbox/exec.js +7 -5
  117. package/dist/cmd/cloud/sandbox/exec.js.map +1 -1
  118. package/dist/cmd/cloud/sandbox/get.d.ts.map +1 -1
  119. package/dist/cmd/cloud/sandbox/get.js +12 -7
  120. package/dist/cmd/cloud/sandbox/get.js.map +1 -1
  121. package/dist/cmd/cloud/sandbox/list.d.ts.map +1 -1
  122. package/dist/cmd/cloud/sandbox/list.js +40 -63
  123. package/dist/cmd/cloud/sandbox/list.js.map +1 -1
  124. package/dist/cmd/cloud/sandbox/ls.d.ts.map +1 -1
  125. package/dist/cmd/cloud/sandbox/ls.js +7 -5
  126. package/dist/cmd/cloud/sandbox/ls.js.map +1 -1
  127. package/dist/cmd/cloud/sandbox/mkdir.d.ts.map +1 -1
  128. package/dist/cmd/cloud/sandbox/mkdir.js +7 -5
  129. package/dist/cmd/cloud/sandbox/mkdir.js.map +1 -1
  130. package/dist/cmd/cloud/sandbox/rm.d.ts.map +1 -1
  131. package/dist/cmd/cloud/sandbox/rm.js +7 -5
  132. package/dist/cmd/cloud/sandbox/rm.js.map +1 -1
  133. package/dist/cmd/cloud/sandbox/rmdir.d.ts.map +1 -1
  134. package/dist/cmd/cloud/sandbox/rmdir.js +7 -5
  135. package/dist/cmd/cloud/sandbox/rmdir.js.map +1 -1
  136. package/dist/cmd/cloud/sandbox/run.js +1 -1
  137. package/dist/cmd/cloud/sandbox/run.js.map +1 -1
  138. package/dist/cmd/cloud/sandbox/snapshot/build.js.map +1 -1
  139. package/dist/cmd/cloud/sandbox/snapshot/get.js.map +1 -1
  140. package/dist/cmd/cloud/sandbox/upload.d.ts.map +1 -1
  141. package/dist/cmd/cloud/sandbox/upload.js +7 -5
  142. package/dist/cmd/cloud/sandbox/upload.js.map +1 -1
  143. package/dist/cmd/cloud/sandbox/util.d.ts +2 -2
  144. package/dist/cmd/cloud/sandbox/util.d.ts.map +1 -1
  145. package/dist/cmd/cloud/sandbox/util.js +14 -13
  146. package/dist/cmd/cloud/sandbox/util.js.map +1 -1
  147. package/dist/cmd/cloud/ssh.d.ts.map +1 -1
  148. package/dist/cmd/cloud/ssh.js +3 -3
  149. package/dist/cmd/cloud/ssh.js.map +1 -1
  150. package/dist/cmd/cloud/storage/create.js.map +1 -1
  151. package/dist/cmd/cloud/storage/delete.js.map +1 -1
  152. package/dist/cmd/cloud/storage/get.d.ts.map +1 -1
  153. package/dist/cmd/cloud/storage/get.js +5 -11
  154. package/dist/cmd/cloud/storage/get.js.map +1 -1
  155. package/dist/cmd/cloud/storage/list.d.ts.map +1 -1
  156. package/dist/cmd/cloud/storage/list.js +6 -6
  157. package/dist/cmd/cloud/storage/list.js.map +1 -1
  158. package/dist/cmd/cloud/stream/create.d.ts.map +1 -1
  159. package/dist/cmd/cloud/stream/create.js +7 -4
  160. package/dist/cmd/cloud/stream/create.js.map +1 -1
  161. package/dist/cmd/cloud/stream/delete.d.ts.map +1 -1
  162. package/dist/cmd/cloud/stream/delete.js +25 -4
  163. package/dist/cmd/cloud/stream/delete.js.map +1 -1
  164. package/dist/cmd/cloud/stream/get.d.ts.map +1 -1
  165. package/dist/cmd/cloud/stream/get.js +91 -62
  166. package/dist/cmd/cloud/stream/get.js.map +1 -1
  167. package/dist/cmd/cloud/stream/list.d.ts.map +1 -1
  168. package/dist/cmd/cloud/stream/list.js +66 -38
  169. package/dist/cmd/cloud/stream/list.js.map +1 -1
  170. package/dist/cmd/cloud/stream/util.d.ts +20 -0
  171. package/dist/cmd/cloud/stream/util.d.ts.map +1 -1
  172. package/dist/cmd/cloud/stream/util.js +27 -3
  173. package/dist/cmd/cloud/stream/util.js.map +1 -1
  174. package/dist/cmd/cloud/vector/util.d.ts.map +1 -1
  175. package/dist/cmd/cloud/vector/util.js +3 -3
  176. package/dist/cmd/cloud/vector/util.js.map +1 -1
  177. package/dist/cmd/dev/index.js.map +1 -1
  178. package/dist/cmd/git/account/add.js.map +1 -1
  179. package/dist/cmd/git/list.js.map +1 -1
  180. package/dist/cmd/project/add/database.d.ts +2 -0
  181. package/dist/cmd/project/add/database.d.ts.map +1 -0
  182. package/dist/cmd/project/add/database.js +123 -0
  183. package/dist/cmd/project/add/database.js.map +1 -0
  184. package/dist/cmd/project/add/domain.d.ts +2 -0
  185. package/dist/cmd/project/add/domain.d.ts.map +1 -0
  186. package/dist/cmd/project/add/domain.js +152 -0
  187. package/dist/cmd/project/add/domain.js.map +1 -0
  188. package/dist/cmd/project/add/index.d.ts +2 -0
  189. package/dist/cmd/project/add/index.d.ts.map +1 -0
  190. package/dist/cmd/project/add/index.js +35 -0
  191. package/dist/cmd/project/add/index.js.map +1 -0
  192. package/dist/cmd/project/add/storage.d.ts +2 -0
  193. package/dist/cmd/project/add/storage.d.ts.map +1 -0
  194. package/dist/cmd/project/add/storage.js +123 -0
  195. package/dist/cmd/project/add/storage.js.map +1 -0
  196. package/dist/cmd/project/auth/init.js.map +1 -1
  197. package/dist/cmd/project/index.d.ts.map +1 -1
  198. package/dist/cmd/project/index.js +7 -0
  199. package/dist/cmd/project/index.js.map +1 -1
  200. package/dist/cmd/project/reconcile.d.ts.map +1 -1
  201. package/dist/cmd/project/reconcile.js +32 -0
  202. package/dist/cmd/project/reconcile.js.map +1 -1
  203. package/dist/cmd/support/report.js.map +1 -1
  204. package/dist/cmd/support/system.js +2 -2
  205. package/dist/cmd/support/system.js.map +1 -1
  206. package/dist/config.d.ts +6 -3
  207. package/dist/config.d.ts.map +1 -1
  208. package/dist/config.js +31 -7
  209. package/dist/config.js.map +1 -1
  210. package/dist/errors.d.ts +2 -1
  211. package/dist/errors.d.ts.map +1 -1
  212. package/dist/errors.js +5 -0
  213. package/dist/errors.js.map +1 -1
  214. package/dist/index.d.ts +4 -1
  215. package/dist/index.d.ts.map +1 -1
  216. package/dist/index.js +3 -0
  217. package/dist/index.js.map +1 -1
  218. package/dist/repl.js +2 -1
  219. package/dist/repl.js.map +1 -1
  220. package/dist/tui/box.d.ts +3 -1
  221. package/dist/tui/box.d.ts.map +1 -1
  222. package/dist/tui/box.js +22 -7
  223. package/dist/tui/box.js.map +1 -1
  224. package/dist/tui/colors.d.ts +0 -3
  225. package/dist/tui/colors.d.ts.map +1 -1
  226. package/dist/tui/colors.js +76 -23
  227. package/dist/tui/colors.js.map +1 -1
  228. package/dist/tui/prompt.d.ts +2 -0
  229. package/dist/tui/prompt.d.ts.map +1 -1
  230. package/dist/tui/prompt.js +44 -3
  231. package/dist/tui/prompt.js.map +1 -1
  232. package/dist/tui/symbols.d.ts +0 -4
  233. package/dist/tui/symbols.d.ts.map +1 -1
  234. package/dist/tui/symbols.js +5 -0
  235. package/dist/tui/symbols.js.map +1 -1
  236. package/dist/tui.d.ts +8 -0
  237. package/dist/tui.d.ts.map +1 -1
  238. package/dist/tui.js +54 -9
  239. package/dist/tui.js.map +1 -1
  240. package/dist/types.d.ts +37 -2
  241. package/dist/types.d.ts.map +1 -1
  242. package/dist/types.js +1 -0
  243. package/dist/types.js.map +1 -1
  244. package/dist/version-check.d.ts.map +1 -1
  245. package/dist/version-check.js +5 -0
  246. package/dist/version-check.js.map +1 -1
  247. package/package.json +6 -6
  248. package/src/agent-detection.ts +457 -160
  249. package/src/ai-help.ts +393 -0
  250. package/src/api.ts +1 -1
  251. package/src/auth.ts +226 -17
  252. package/src/banner.ts +5 -0
  253. package/src/cache/agent-intro.ts +62 -0
  254. package/src/cache/index.ts +2 -0
  255. package/src/cache/resource-region.ts +28 -7
  256. package/src/catalyst.ts +16 -0
  257. package/src/cli.ts +375 -93
  258. package/src/cmd/ai/detect.ts +54 -0
  259. package/src/cmd/ai/index.ts +18 -1
  260. package/src/cmd/ai/intro.ts +154 -0
  261. package/src/cmd/ai/opencode/run.ts +5 -0
  262. package/src/cmd/build/ast.ts +97 -0
  263. package/src/cmd/build/vite/bun-dev-server.ts +2 -0
  264. package/src/cmd/build/vite/docs-generator.ts +15 -1
  265. package/src/cmd/build/vite/env-types-generator.ts +145 -0
  266. package/src/cmd/build/vite/index.ts +15 -0
  267. package/src/cmd/build/vite/public-asset-path-plugin.ts +8 -2
  268. package/src/cmd/build/vite/vite-builder.ts +31 -11
  269. package/src/cmd/cloud/db/create.ts +16 -16
  270. package/src/cmd/cloud/db/delete.ts +19 -19
  271. package/src/cmd/cloud/db/get.ts +32 -17
  272. package/src/cmd/cloud/deploy-fork.ts +2 -0
  273. package/src/cmd/cloud/deploy.ts +17 -0
  274. package/src/cmd/cloud/env/import.ts +6 -6
  275. package/src/cmd/cloud/env/list.ts +11 -11
  276. package/src/cmd/cloud/env/push.ts +6 -6
  277. package/src/cmd/cloud/keyvalue/util.ts +3 -3
  278. package/src/cmd/cloud/machine/list.ts +3 -3
  279. package/src/cmd/cloud/region/index.ts +3 -3
  280. package/src/cmd/cloud/region-lookup.ts +82 -22
  281. package/src/cmd/cloud/sandbox/cp.ts +9 -4
  282. package/src/cmd/cloud/sandbox/create.ts +2 -2
  283. package/src/cmd/cloud/sandbox/delete.ts +10 -7
  284. package/src/cmd/cloud/sandbox/download.ts +8 -5
  285. package/src/cmd/cloud/sandbox/env.ts +8 -5
  286. package/src/cmd/cloud/sandbox/exec.ts +10 -5
  287. package/src/cmd/cloud/sandbox/get.ts +13 -7
  288. package/src/cmd/cloud/sandbox/list.ts +47 -73
  289. package/src/cmd/cloud/sandbox/ls.ts +9 -5
  290. package/src/cmd/cloud/sandbox/mkdir.ts +9 -5
  291. package/src/cmd/cloud/sandbox/rm.ts +9 -5
  292. package/src/cmd/cloud/sandbox/rmdir.ts +9 -5
  293. package/src/cmd/cloud/sandbox/run.ts +1 -1
  294. package/src/cmd/cloud/sandbox/snapshot/build.ts +31 -31
  295. package/src/cmd/cloud/sandbox/snapshot/get.ts +17 -17
  296. package/src/cmd/cloud/sandbox/upload.ts +8 -5
  297. package/src/cmd/cloud/sandbox/util.ts +15 -14
  298. package/src/cmd/cloud/ssh.ts +2 -4
  299. package/src/cmd/cloud/storage/create.ts +16 -16
  300. package/src/cmd/cloud/storage/delete.ts +19 -19
  301. package/src/cmd/cloud/storage/get.ts +5 -16
  302. package/src/cmd/cloud/storage/list.ts +12 -6
  303. package/src/cmd/cloud/stream/create.ts +8 -4
  304. package/src/cmd/cloud/stream/delete.ts +28 -4
  305. package/src/cmd/cloud/stream/get.ts +102 -64
  306. package/src/cmd/cloud/stream/list.ts +76 -44
  307. package/src/cmd/cloud/stream/util.ts +39 -3
  308. package/src/cmd/cloud/vector/util.ts +3 -3
  309. package/src/cmd/dev/index.ts +4 -4
  310. package/src/cmd/git/account/add.ts +5 -5
  311. package/src/cmd/git/list.ts +7 -7
  312. package/src/cmd/project/add/database.ts +145 -0
  313. package/src/cmd/project/add/domain.ts +181 -0
  314. package/src/cmd/project/add/index.ts +35 -0
  315. package/src/cmd/project/add/storage.ts +147 -0
  316. package/src/cmd/project/auth/init.ts +6 -6
  317. package/src/cmd/project/index.ts +7 -0
  318. package/src/cmd/project/reconcile.ts +40 -0
  319. package/src/cmd/support/report.ts +5 -5
  320. package/src/cmd/support/system.ts +2 -2
  321. package/src/config.ts +40 -12
  322. package/src/errors.ts +7 -0
  323. package/src/index.ts +11 -0
  324. package/src/repl.ts +4 -1
  325. package/src/tui/box.ts +24 -9
  326. package/src/tui/colors.ts +83 -26
  327. package/src/tui/prompt.ts +55 -3
  328. package/src/tui/symbols.ts +6 -0
  329. package/src/tui.ts +55 -9
  330. package/src/types.ts +46 -2
  331. package/src/version-check.ts +6 -0
package/src/ai-help.ts ADDED
@@ -0,0 +1,393 @@
1
+ /**
2
+ * AI Help Generator - dashdash specification implementation
3
+ *
4
+ * Generates AI-optimized help output in dashdash format (https://github.com/visionik/dashdash)
5
+ * for improved discoverability and usability by AI agents.
6
+ */
7
+
8
+ import type { CLISchema, SchemaCommand } from './schema-generator';
9
+
10
+ export interface DashdashConfig {
11
+ name: string;
12
+ description: string;
13
+ accessLevel: 'read' | 'browse' | 'interact' | 'full';
14
+ webUrl: string;
15
+ apiUrl: string;
16
+ docsUrl: string;
17
+ mcpUrl?: string;
18
+ homepage: string;
19
+ repository: string;
20
+ }
21
+
22
+ const DEFAULT_CONFIG: DashdashConfig = {
23
+ name: 'agentuity',
24
+ description: `CLI for building, deploying, and managing AI agents on the Agentuity platform.
25
+ Use when user asks to create agents, deploy projects, or interact with Agentuity cloud services.`,
26
+ accessLevel: 'interact',
27
+ webUrl: 'https://app.agentuity.com',
28
+ apiUrl: 'https://api.agentuity.com',
29
+ docsUrl: 'https://agentuity.dev',
30
+ homepage: 'https://agentuity.com',
31
+ repository: 'https://github.com/agentuity/sdk',
32
+ };
33
+
34
+ /**
35
+ * Generate dashdash-compliant AI help output
36
+ */
37
+ export function generateAIHelp(schema: CLISchema, config: DashdashConfig = DEFAULT_CONFIG): string {
38
+ const frontMatter = buildFrontMatter(schema, config);
39
+ const content = buildContent(schema, config);
40
+
41
+ return `${frontMatter}\n${content}`;
42
+ }
43
+
44
+ /**
45
+ * Build YAML front matter per dashdash spec
46
+ */
47
+ function buildFrontMatter(schema: CLISchema, config: DashdashConfig): string {
48
+ const lines = [
49
+ '---',
50
+ `name: ${config.name}`,
51
+ 'description: >',
52
+ ...config.description.split('\n').map((line) => ` ${line.trim()}`),
53
+ '',
54
+ 'spec-url: https://github.com/visionik/dashdash',
55
+ 'spec-version: 0.2.0',
56
+ '',
57
+ 'subcommand-help: true',
58
+ `access-level: ${config.accessLevel}`,
59
+ '',
60
+ `web-url: ${config.webUrl}`,
61
+ `api-url: ${config.apiUrl}`,
62
+ `mcp-url: ${config.mcpUrl ?? 'none'}`,
63
+ '',
64
+ 'install:',
65
+ ' npm: "@agentuity/cli"',
66
+ ' bun: "@agentuity/cli"',
67
+ '',
68
+ 'requires:',
69
+ ' auth:',
70
+ ' - api-key',
71
+ ' env:',
72
+ ' - AGENTUITY_API_KEY',
73
+ '',
74
+ 'invocation:',
75
+ ' model-invocable: true',
76
+ ' user-invocable: true',
77
+ '',
78
+ `homepage: ${config.homepage}`,
79
+ `repository: ${config.repository}`,
80
+ `content-version: ${schema.version}`,
81
+ '---',
82
+ ];
83
+
84
+ return lines.join('\n');
85
+ }
86
+
87
+ /**
88
+ * Build markdown content
89
+ */
90
+ function buildContent(schema: CLISchema, config: DashdashConfig): string {
91
+ const sections = [
92
+ buildHeader(config),
93
+ buildWhenToUse(),
94
+ buildQuickReference(schema),
95
+ buildCommandReference(schema),
96
+ buildGlobalOptions(schema),
97
+ buildAuthentication(),
98
+ buildExitCodes(schema),
99
+ buildAlternativeAccess(config),
100
+ ];
101
+
102
+ return sections.join('\n\n');
103
+ }
104
+
105
+ function buildHeader(config: DashdashConfig): string {
106
+ return `# ${config.name}
107
+
108
+ > ${config.description.split('\n')[0]?.trim()}`;
109
+ }
110
+
111
+ function buildWhenToUse(): string {
112
+ return `## When to Use
113
+
114
+ Use this CLI when the user asks to:
115
+ - Create, build, or deploy AI agents
116
+ - Manage Agentuity projects and organizations
117
+ - Access cloud services (KV, Vector, Postgres, Storage, Sandboxes)
118
+ - Debug or troubleshoot agent deployments
119
+ - Run agents locally in development mode
120
+ - Manage environment variables and secrets
121
+ - View deployment logs or rollback deployments
122
+
123
+ Do NOT use this CLI for:
124
+ - Non-Agentuity projects or general Node.js/Bun development
125
+ - General file operations (use filesystem tools instead)
126
+ - Non-AI/agent related tasks
127
+ - Direct database queries (use the SDK or cloud console)`;
128
+ }
129
+
130
+ /**
131
+ * Build Quick Reference with 15-20 most common operations
132
+ */
133
+ function buildQuickReference(schema: CLISchema): string {
134
+ const quickCommands = collectQuickReferenceCommands(schema);
135
+
136
+ const lines = ['## Quick Reference', ''];
137
+
138
+ for (const cmd of quickCommands) {
139
+ lines.push(`- **${cmd.label}:** \`${cmd.command}\``);
140
+ }
141
+
142
+ return lines.join('\n');
143
+ }
144
+
145
+ interface QuickCommand {
146
+ label: string;
147
+ command: string;
148
+ priority: number;
149
+ }
150
+
151
+ /**
152
+ * Collect the most important commands for quick reference
153
+ */
154
+ function collectQuickReferenceCommands(schema: CLISchema): QuickCommand[] {
155
+ const commands: QuickCommand[] = [];
156
+
157
+ // Define priority commands explicitly for better curation
158
+ const priorityCommands: Array<{ path: string; label: string; priority: number }> = [
159
+ { path: 'login', label: 'Login', priority: 1 },
160
+ { path: 'project create', label: 'Create project', priority: 2 },
161
+ { path: 'dev', label: 'Run locally', priority: 3 },
162
+ { path: 'deploy', label: 'Deploy', priority: 4 },
163
+ { path: 'cloud logs', label: 'View logs', priority: 5 },
164
+ { path: 'cloud sandbox list', label: 'List sandboxes', priority: 6 },
165
+ { path: 'cloud sandbox create', label: 'Create sandbox', priority: 7 },
166
+ { path: 'cloud sandbox exec', label: 'Execute in sandbox', priority: 8 },
167
+ { path: 'cloud kv get', label: 'KV get', priority: 9 },
168
+ { path: 'cloud kv set', label: 'KV set', priority: 10 },
169
+ { path: 'cloud vector search', label: 'Vector search', priority: 11 },
170
+ { path: 'cloud db list', label: 'List databases', priority: 12 },
171
+ { path: 'cloud db exec', label: 'Execute SQL', priority: 13 },
172
+ { path: 'env list', label: 'List env vars', priority: 14 },
173
+ { path: 'env set', label: 'Set env var', priority: 15 },
174
+ { path: 'cloud deployment list', label: 'List deployments', priority: 16 },
175
+ { path: 'cloud deployment rollback', label: 'Rollback deployment', priority: 17 },
176
+ { path: 'project list', label: 'List projects', priority: 18 },
177
+ { path: 'auth whoami', label: 'Show current user', priority: 19 },
178
+ { path: 'version', label: 'Show version', priority: 20 },
179
+ ];
180
+
181
+ // Build command signatures from schema
182
+ const commandMap = buildCommandMap(schema.commands);
183
+
184
+ for (const pc of priorityCommands) {
185
+ const schemaCmd = commandMap.get(pc.path);
186
+ if (schemaCmd) {
187
+ const signature = buildCommandSignature(pc.path, schemaCmd);
188
+ commands.push({
189
+ label: pc.label,
190
+ command: `agentuity ${signature}`,
191
+ priority: pc.priority,
192
+ });
193
+ } else {
194
+ // Fallback for commands that might not be in schema yet
195
+ commands.push({
196
+ label: pc.label,
197
+ command: `agentuity ${pc.path}`,
198
+ priority: pc.priority,
199
+ });
200
+ }
201
+ }
202
+
203
+ return commands.sort((a, b) => a.priority - b.priority);
204
+ }
205
+
206
+ /**
207
+ * Build a map of command paths to their schema definitions
208
+ */
209
+ function buildCommandMap(
210
+ commands: SchemaCommand[],
211
+ prefix: string = ''
212
+ ): Map<string, SchemaCommand> {
213
+ const map = new Map<string, SchemaCommand>();
214
+
215
+ for (const cmd of commands) {
216
+ const path = prefix ? `${prefix} ${cmd.name}` : cmd.name;
217
+ map.set(path, cmd);
218
+
219
+ if (cmd.subcommands) {
220
+ const subMap = buildCommandMap(cmd.subcommands, path);
221
+ for (const [subPath, subCmd] of subMap) {
222
+ map.set(subPath, subCmd);
223
+ }
224
+ }
225
+ }
226
+
227
+ return map;
228
+ }
229
+
230
+ /**
231
+ * Build a command signature with arguments
232
+ */
233
+ function buildCommandSignature(path: string, cmd: SchemaCommand): string {
234
+ let signature = path;
235
+
236
+ if (cmd.arguments) {
237
+ for (const arg of cmd.arguments) {
238
+ if (arg.variadic) {
239
+ signature += arg.required ? ` <${arg.name}...>` : ` [${arg.name}...]`;
240
+ } else {
241
+ signature += arg.required ? ` <${arg.name}>` : ` [${arg.name}]`;
242
+ }
243
+ }
244
+ }
245
+
246
+ return signature;
247
+ }
248
+
249
+ /**
250
+ * Build full command reference
251
+ */
252
+ function buildCommandReference(schema: CLISchema): string {
253
+ const lines = ['## Command Reference', ''];
254
+
255
+ for (const cmd of schema.commands) {
256
+ lines.push(...buildCommandSection(cmd, 'agentuity'));
257
+ }
258
+
259
+ return lines.join('\n');
260
+ }
261
+
262
+ /**
263
+ * Build a command section recursively
264
+ */
265
+ function buildCommandSection(cmd: SchemaCommand, prefix: string, depth: number = 3): string[] {
266
+ const lines: string[] = [];
267
+ const fullPath = `${prefix} ${cmd.name}`;
268
+ const heading = '#'.repeat(Math.min(depth, 6));
269
+
270
+ // Skip hidden/internal commands
271
+ if (cmd.tags?.includes('hidden') || cmd.skipSkill) {
272
+ return lines;
273
+ }
274
+
275
+ lines.push(`${heading} ${fullPath}`);
276
+ lines.push('');
277
+ lines.push(cmd.description);
278
+ lines.push('');
279
+
280
+ // Arguments
281
+ if (cmd.arguments && cmd.arguments.length > 0) {
282
+ lines.push('**Arguments:**');
283
+ for (const arg of cmd.arguments) {
284
+ const req = arg.required ? '(required)' : '(optional)';
285
+ lines.push(`- \`${arg.name}\` ${req}${arg.description ? ` - ${arg.description}` : ''}`);
286
+ }
287
+ lines.push('');
288
+ }
289
+
290
+ // Options
291
+ if (cmd.options && cmd.options.length > 0) {
292
+ lines.push('**Options:**');
293
+ for (const opt of cmd.options) {
294
+ const flag = `--${camelToKebab(opt.name)}`;
295
+ const defaultVal =
296
+ opt.default !== undefined ? ` (default: ${JSON.stringify(opt.default)})` : '';
297
+ lines.push(`- \`${flag}\`${defaultVal}${opt.description ? ` - ${opt.description}` : ''}`);
298
+ }
299
+ lines.push('');
300
+ }
301
+
302
+ // Requirements
303
+ const reqs: string[] = [];
304
+ if (cmd.requires?.auth) reqs.push('authentication');
305
+ if (cmd.requires?.project) reqs.push('project');
306
+ if (cmd.requires?.org) reqs.push('organization');
307
+ if (cmd.requires?.region) reqs.push('region');
308
+
309
+ if (reqs.length > 0) {
310
+ lines.push(`**Requires:** ${reqs.join(', ')}`);
311
+ lines.push('');
312
+ }
313
+
314
+ // Examples
315
+ if (cmd.examples && cmd.examples.length > 0) {
316
+ lines.push('**Examples:**');
317
+ lines.push('```bash');
318
+ for (const ex of cmd.examples.slice(0, 3)) {
319
+ lines.push(`# ${ex.description}`);
320
+ lines.push(ex.command);
321
+ }
322
+ lines.push('```');
323
+ lines.push('');
324
+ }
325
+
326
+ // Subcommands
327
+ if (cmd.subcommands && cmd.subcommands.length > 0) {
328
+ for (const sub of cmd.subcommands) {
329
+ lines.push(...buildCommandSection(sub, fullPath, depth + 1));
330
+ }
331
+ }
332
+
333
+ return lines;
334
+ }
335
+
336
+ /**
337
+ * Build global options section
338
+ */
339
+ function buildGlobalOptions(schema: CLISchema): string {
340
+ const lines = ['## Global Options', '', 'These options can be used with any command:', ''];
341
+
342
+ for (const opt of schema.globalOptions) {
343
+ const flag = `--${camelToKebab(opt.name)}`;
344
+ const defaultVal =
345
+ opt.default !== undefined ? ` (default: ${JSON.stringify(opt.default)})` : '';
346
+ lines.push(`- \`${flag}\`${defaultVal}${opt.description ? ` - ${opt.description}` : ''}`);
347
+ }
348
+
349
+ return lines.join('\n');
350
+ }
351
+
352
+ function buildAuthentication(): string {
353
+ return `## Authentication
354
+
355
+ Most commands require authentication. Set the \`AGENTUITY_API_KEY\` environment variable or run:
356
+
357
+ \`\`\`bash
358
+ agentuity login
359
+ \`\`\`
360
+
361
+ To check your current authentication status:
362
+
363
+ \`\`\`bash
364
+ agentuity auth whoami
365
+ \`\`\``;
366
+ }
367
+
368
+ function buildExitCodes(schema: CLISchema): string {
369
+ const lines = ['## Exit Codes', ''];
370
+
371
+ for (const [code, description] of Object.entries(schema.exitCodes)) {
372
+ lines.push(`- \`${code}\` - ${description}`);
373
+ }
374
+
375
+ return lines.join('\n');
376
+ }
377
+
378
+ function buildAlternativeAccess(config: DashdashConfig): string {
379
+ return `## Alternative Access Methods
380
+
381
+ - **Web Console:** ${config.webUrl}
382
+ - **API Documentation:** ${config.docsUrl}`;
383
+ }
384
+
385
+ /**
386
+ * Convert camelCase to kebab-case
387
+ */
388
+ function camelToKebab(str: string): string {
389
+ return str
390
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
391
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
392
+ .toLowerCase();
393
+ }
package/src/api.ts CHANGED
@@ -101,5 +101,5 @@ export function getGravityDevModeURL(region: string, config?: Config | null): st
101
101
  if (config?.name === 'local') {
102
102
  return 'grpc://gravity.agentuity.io:8443';
103
103
  }
104
- return `grpc://gravity-${region}.agentuity.cloud`;
104
+ return 'grpc://devmode-us.agentuity.com';
105
105
  }
package/src/auth.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import enquirer from 'enquirer';
2
2
  import { getDefaultConfigPath, getAuth, saveConfig, loadConfig, saveOrgId } from './config';
3
+ import { getResourceInfo, type ResourceType } from './cache';
3
4
  import { getCommand } from './command-prefix';
4
- import type { CommandContext, AuthData } from './types';
5
+ import type { CommandContext, AuthData, Config } from './types';
5
6
  import * as tui from './tui';
6
7
  import { defaultProfileName } from './config';
7
8
  import { listOrganizations } from '@agentuity/server';
@@ -11,6 +12,119 @@ export function isTTY(): boolean {
11
12
  return process.stdin.isTTY === true && process.stdout.isTTY === true;
12
13
  }
13
14
 
15
+ const ORG_ID_ENV_VAR = 'AGENTUITY_CLOUD_ORG_ID';
16
+ const NON_INTERACTIVE_ORG_ERROR =
17
+ 'Cannot select organization in non-interactive mode. ' +
18
+ `Use --org-id, set ${ORG_ID_ENV_VAR}, or run interactively.`;
19
+
20
+ const RESOURCE_PREFIXES: Array<{ prefix: string; type: ResourceType }> = [
21
+ { prefix: 'sbx_', type: 'sandbox' },
22
+ { prefix: 'proj_', type: 'project' },
23
+ { prefix: 'db_', type: 'db' },
24
+ { prefix: 'deploy_', type: 'deployment' },
25
+ { prefix: 'machine_', type: 'machine' },
26
+ { prefix: 'que_', type: 'queue' },
27
+ { prefix: 'vec_', type: 'vector' },
28
+ { prefix: 'kv_', type: 'kv' },
29
+ { prefix: 'stream_', type: 'stream' },
30
+ ];
31
+
32
+ function getResourceTypeFromId(id: string): ResourceType | undefined {
33
+ for (const entry of RESOURCE_PREFIXES) {
34
+ if (id.startsWith(entry.prefix)) {
35
+ return entry.type;
36
+ }
37
+ }
38
+ return undefined;
39
+ }
40
+
41
+ function collectPrefixedIds(values?: Record<string, unknown> | unknown[]): string[] {
42
+ if (!values) {
43
+ return [];
44
+ }
45
+ const ids = new Set<string>();
46
+ const addValue = (value: unknown) => {
47
+ if (typeof value === 'string') {
48
+ const resourceType = getResourceTypeFromId(value);
49
+ if (resourceType) {
50
+ ids.add(value);
51
+ }
52
+ return;
53
+ }
54
+ if (Array.isArray(value)) {
55
+ for (const entry of value) {
56
+ if (typeof entry === 'string') {
57
+ const resourceType = getResourceTypeFromId(entry);
58
+ if (resourceType) {
59
+ ids.add(entry);
60
+ }
61
+ }
62
+ }
63
+ }
64
+ };
65
+
66
+ for (const value of Object.values(values)) {
67
+ addValue(value);
68
+ }
69
+
70
+ return Array.from(ids);
71
+ }
72
+
73
+ export function hasPrefixedResourceId(
74
+ args?: Record<string, unknown> | unknown[],
75
+ opts?: Record<string, unknown> | unknown[]
76
+ ): boolean {
77
+ return collectPrefixedIds(args).length > 0 || collectPrefixedIds(opts).length > 0;
78
+ }
79
+
80
+ async function resolveCachedOrgId(ctx: {
81
+ config: Config | null;
82
+ args?: Record<string, unknown> | unknown[];
83
+ opts?: Record<string, unknown> | unknown[];
84
+ }): Promise<string | undefined> {
85
+ const profileName = ctx.config?.name ?? defaultProfileName;
86
+ const candidateIds = [...collectPrefixedIds(ctx.args), ...collectPrefixedIds(ctx.opts)];
87
+
88
+ for (const candidateId of candidateIds) {
89
+ const resourceType = getResourceTypeFromId(candidateId);
90
+ if (!resourceType) {
91
+ continue;
92
+ }
93
+ const cachedInfo = await getResourceInfo(resourceType, profileName, candidateId);
94
+ if (cachedInfo?.orgId) {
95
+ return cachedInfo.orgId;
96
+ }
97
+ }
98
+
99
+ return undefined;
100
+ }
101
+
102
+ export async function resolveOrgIdWithoutPrompt(ctx: {
103
+ options: { orgId?: string };
104
+ config: Config | null;
105
+ args?: Record<string, unknown> | unknown[];
106
+ opts?: Record<string, unknown> | unknown[];
107
+ }): Promise<string | undefined> {
108
+ const { options, config, args, opts } = ctx;
109
+ const envOrgId = process.env[ORG_ID_ENV_VAR];
110
+ const flagOrgId = options.orgId && options.orgId !== envOrgId ? options.orgId : undefined;
111
+
112
+ if (flagOrgId) {
113
+ return flagOrgId;
114
+ }
115
+
116
+ if (envOrgId) {
117
+ return envOrgId;
118
+ }
119
+
120
+ const preferredOrgId = config?.preferences?.orgId;
121
+ if (preferredOrgId) {
122
+ return preferredOrgId;
123
+ }
124
+
125
+ return resolveCachedOrgId({ config, args, opts });
126
+ }
127
+
14
128
  export async function hasLoggedInBefore(): Promise<boolean> {
15
129
  const configPath = getDefaultConfigPath();
16
130
  return await Bun.file(configPath).exists();
@@ -231,11 +345,37 @@ export async function requireOrg(
231
345
  ctx: CommandContext & { apiClient: APIClientType },
232
346
  autoSelect?: boolean
233
347
  ): Promise<string> {
234
- const { options, config, apiClient } = ctx;
348
+ const { options, config, apiClient, args, opts } = ctx as CommandContext & {
349
+ apiClient: APIClientType;
350
+ args?: Record<string, unknown>;
351
+ opts?: Record<string, unknown>;
352
+ };
353
+ const interactive = isTTY();
354
+ const envOrgId = process.env[ORG_ID_ENV_VAR];
355
+ const flagOrgId = options.orgId && options.orgId !== envOrgId ? options.orgId : undefined;
356
+
357
+ // 1. --org-id flag
358
+ if (flagOrgId) {
359
+ return flagOrgId;
360
+ }
361
+
362
+ // 2. Environment variable
363
+ if (envOrgId) {
364
+ return envOrgId;
365
+ }
366
+
367
+ // 3. Config preference (TTY: prompt with pre-selected, non-TTY: use directly)
368
+ const preferredOrgId = config?.preferences?.orgId;
369
+ if (preferredOrgId && (!interactive || autoSelect)) {
370
+ return preferredOrgId;
371
+ }
235
372
 
236
- // Check if org is provided via --org-id flag
237
- if (options.orgId) {
238
- return options.orgId;
373
+ // Cache lookup for prefixed resource IDs
374
+ if (!preferredOrgId) {
375
+ const cachedOrgId = await resolveCachedOrgId({ config, args, opts });
376
+ if (cachedOrgId) {
377
+ return cachedOrgId;
378
+ }
239
379
  }
240
380
 
241
381
  // Fetch organizations
@@ -251,13 +391,33 @@ export async function requireOrg(
251
391
  tui.fatal('No organizations found for your account');
252
392
  }
253
393
 
254
- // Use selectOrganization which handles single org and prompting
255
- // Pass the saved preference as initial selection
256
- // Pass autoSelect to skip prompting when --confirm is used
257
- const orgId = await tui.selectOrganization(orgs, config?.preferences?.orgId, autoSelect);
394
+ // 4. Single-org auto-select
395
+ if (orgs.length === 1 && orgs[0]) {
396
+ const orgId = orgs[0].id;
397
+ if (orgId !== preferredOrgId) {
398
+ await saveOrgId(orgId);
399
+ }
400
+ return orgId;
401
+ }
402
+
403
+ // Auto-select mode (--confirm flag or explicit autoSelect)
404
+ if (autoSelect) {
405
+ const orgId = await tui.selectOrganization(orgs, preferredOrgId, true);
406
+ if (orgId !== preferredOrgId) {
407
+ await saveOrgId(orgId);
408
+ }
409
+ return orgId;
410
+ }
411
+
412
+ // 5. Interactive prompt (TTY) / Error (no TTY)
413
+ if (!interactive) {
414
+ return tui.fatal(NON_INTERACTIVE_ORG_ERROR);
415
+ }
416
+
417
+ const orgId = await tui.selectOrganization(orgs, preferredOrgId, false);
258
418
 
259
419
  // Save selected org to config if different
260
- if (orgId !== config?.preferences?.orgId) {
420
+ if (orgId !== preferredOrgId) {
261
421
  await saveOrgId(orgId);
262
422
  }
263
423
 
@@ -268,7 +428,15 @@ export async function optionalOrg(
268
428
  ctx: CommandContext & { apiClient?: APIClientType; auth?: AuthData },
269
429
  autoSelect?: boolean
270
430
  ): Promise<string | undefined> {
271
- const { options, config, apiClient, auth } = ctx;
431
+ const { options, config, apiClient, auth, args, opts } = ctx as CommandContext & {
432
+ apiClient?: APIClientType;
433
+ auth?: AuthData;
434
+ args?: Record<string, unknown>;
435
+ opts?: Record<string, unknown>;
436
+ };
437
+ const interactive = isTTY();
438
+ const envOrgId = process.env[ORG_ID_ENV_VAR];
439
+ const flagOrgId = options.orgId && options.orgId !== envOrgId ? options.orgId : undefined;
272
440
 
273
441
  // If not authenticated or no API client, skip org selection
274
442
  if (!auth || !apiClient) {
@@ -282,9 +450,28 @@ export async function optionalOrg(
282
450
 
283
451
  // Note: --no-register check is handled in cli.ts before calling this function
284
452
 
285
- // Check if org is provided via --org-id flag
286
- if (options.orgId) {
287
- return options.orgId;
453
+ // 1. --org-id flag
454
+ if (flagOrgId) {
455
+ return flagOrgId;
456
+ }
457
+
458
+ // 2. Environment variable
459
+ if (envOrgId) {
460
+ return envOrgId;
461
+ }
462
+
463
+ // 3. Config preference (TTY: prompt with pre-selected, non-TTY: use directly)
464
+ const preferredOrgId = config?.preferences?.orgId;
465
+ if (preferredOrgId && (!interactive || autoSelect)) {
466
+ return preferredOrgId;
467
+ }
468
+
469
+ // Cache lookup for prefixed resource IDs
470
+ if (!preferredOrgId) {
471
+ const cachedOrgId = await resolveCachedOrgId({ config, args, opts });
472
+ if (cachedOrgId) {
473
+ return cachedOrgId;
474
+ }
288
475
  }
289
476
 
290
477
  // Fetch organizations
@@ -300,12 +487,34 @@ export async function optionalOrg(
300
487
  return undefined;
301
488
  }
302
489
 
490
+ // 4. Single-org auto-select
491
+ if (orgs.length === 1 && orgs[0]) {
492
+ const orgId = orgs[0].id;
493
+ if (orgId !== preferredOrgId) {
494
+ await saveOrgId(orgId);
495
+ }
496
+ return orgId;
497
+ }
498
+
499
+ // Auto-select mode (--confirm flag or explicit autoSelect)
500
+ if (autoSelect) {
501
+ const orgId = await tui.selectOrganization(orgs, preferredOrgId, true);
502
+ if (orgId !== preferredOrgId) {
503
+ await saveOrgId(orgId);
504
+ }
505
+ return orgId;
506
+ }
507
+
508
+ // 5. Interactive prompt (TTY) / Error (no TTY)
509
+ if (!interactive) {
510
+ return tui.fatal(NON_INTERACTIVE_ORG_ERROR);
511
+ }
512
+
303
513
  // Prompt for org selection (use saved preference as initial/default)
304
- // Pass autoSelect to skip prompting when --confirm is used
305
- const orgId = await tui.selectOrganization(orgs, config?.preferences?.orgId, autoSelect);
514
+ const orgId = await tui.selectOrganization(orgs, preferredOrgId, false);
306
515
 
307
516
  // Save selected org to config if different
308
- if (orgId !== config?.preferences?.orgId) {
517
+ if (orgId !== preferredOrgId) {
309
518
  await saveOrgId(orgId);
310
519
  }
311
520
 
package/src/banner.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  getDisplayWidth,
8
8
  stripAnsi,
9
9
  } from './tui';
10
+ import { getExecutingAgent } from './agent-detection';
10
11
 
11
12
  export function generateBanner(version?: string, compact?: true): string {
12
13
  const _version = version ?? getVersion();
@@ -83,5 +84,9 @@ export function generateBanner(version?: string, compact?: true): string {
83
84
  }
84
85
 
85
86
  export function showBanner(version?: string, compact?: true): void {
87
+ // Skip banner when running from an AI coding agent
88
+ if (getExecutingAgent()) {
89
+ return;
90
+ }
86
91
  console.log(generateBanner(version, compact));
87
92
  }