centaurus-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 (338) hide show
  1. package/AUTH_FLOW.md +138 -0
  2. package/CONFIG_GUIDE.md +255 -0
  3. package/LICENSE +21 -0
  4. package/README.md +346 -0
  5. package/dist/ai/provider-factory.d.ts +6 -0
  6. package/dist/ai/provider-factory.d.ts.map +1 -0
  7. package/dist/ai/provider-factory.js +27 -0
  8. package/dist/ai/provider-factory.js.map +1 -0
  9. package/dist/ai/providers/base.d.ts +25 -0
  10. package/dist/ai/providers/base.d.ts.map +1 -0
  11. package/dist/ai/providers/base.js +9 -0
  12. package/dist/ai/providers/base.js.map +1 -0
  13. package/dist/ai/providers/gemini.d.ts +34 -0
  14. package/dist/ai/providers/gemini.d.ts.map +1 -0
  15. package/dist/ai/providers/gemini.js +146 -0
  16. package/dist/ai/providers/gemini.js.map +1 -0
  17. package/dist/ai/types.d.ts +20 -0
  18. package/dist/ai/types.d.ts.map +1 -0
  19. package/dist/ai/types.js +2 -0
  20. package/dist/ai/types.js.map +1 -0
  21. package/dist/cli-adapter.d.ts +78 -0
  22. package/dist/cli-adapter.d.ts.map +1 -0
  23. package/dist/cli-adapter.js +605 -0
  24. package/dist/cli-adapter.js.map +1 -0
  25. package/dist/commands/CommandParser.d.ts +27 -0
  26. package/dist/commands/CommandParser.d.ts.map +1 -0
  27. package/dist/commands/CommandParser.js +238 -0
  28. package/dist/commands/CommandParser.js.map +1 -0
  29. package/dist/config/ConfigManager.d.ts +59 -0
  30. package/dist/config/ConfigManager.d.ts.map +1 -0
  31. package/dist/config/ConfigManager.js +332 -0
  32. package/dist/config/ConfigManager.js.map +1 -0
  33. package/dist/config/defaultConfig.d.ts +82 -0
  34. package/dist/config/defaultConfig.d.ts.map +1 -0
  35. package/dist/config/defaultConfig.js +88 -0
  36. package/dist/config/defaultConfig.js.map +1 -0
  37. package/dist/config/manager.d.ts +60 -0
  38. package/dist/config/manager.d.ts.map +1 -0
  39. package/dist/config/manager.js +162 -0
  40. package/dist/config/manager.js.map +1 -0
  41. package/dist/config/types.d.ts +9 -0
  42. package/dist/config/types.d.ts.map +1 -0
  43. package/dist/config/types.js +6 -0
  44. package/dist/config/types.js.map +1 -0
  45. package/dist/index-custom.d.ts +3 -0
  46. package/dist/index-custom.d.ts.map +1 -0
  47. package/dist/index-custom.js +65 -0
  48. package/dist/index-custom.js.map +1 -0
  49. package/dist/index.d.ts +3 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +102 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/prompts/system-prompt.d.ts +47 -0
  54. package/dist/prompts/system-prompt.d.ts.map +1 -0
  55. package/dist/prompts/system-prompt.js +378 -0
  56. package/dist/prompts/system-prompt.js.map +1 -0
  57. package/dist/providers/GoogleProvider.d.ts +26 -0
  58. package/dist/providers/GoogleProvider.d.ts.map +1 -0
  59. package/dist/providers/GoogleProvider.js +313 -0
  60. package/dist/providers/GoogleProvider.js.map +1 -0
  61. package/dist/providers/Provider.d.ts +114 -0
  62. package/dist/providers/Provider.d.ts.map +1 -0
  63. package/dist/providers/Provider.js +44 -0
  64. package/dist/providers/Provider.js.map +1 -0
  65. package/dist/services/api-client.d.ts +282 -0
  66. package/dist/services/api-client.d.ts.map +1 -0
  67. package/dist/services/api-client.js +339 -0
  68. package/dist/services/api-client.js.map +1 -0
  69. package/dist/services/auth-handler.d.ts +30 -0
  70. package/dist/services/auth-handler.d.ts.map +1 -0
  71. package/dist/services/auth-handler.js +210 -0
  72. package/dist/services/auth-handler.js.map +1 -0
  73. package/dist/services/conversation-manager.d.ts +73 -0
  74. package/dist/services/conversation-manager.d.ts.map +1 -0
  75. package/dist/services/conversation-manager.js +128 -0
  76. package/dist/services/conversation-manager.js.map +1 -0
  77. package/dist/tests/automated-verification.d.ts +27 -0
  78. package/dist/tests/automated-verification.d.ts.map +1 -0
  79. package/dist/tests/automated-verification.js +359 -0
  80. package/dist/tests/automated-verification.js.map +1 -0
  81. package/dist/tests/integration-tests.d.ts +50 -0
  82. package/dist/tests/integration-tests.d.ts.map +1 -0
  83. package/dist/tests/integration-tests.js +648 -0
  84. package/dist/tests/integration-tests.js.map +1 -0
  85. package/dist/tools/ToolRegistry.d.ts +44 -0
  86. package/dist/tools/ToolRegistry.d.ts.map +1 -0
  87. package/dist/tools/ToolRegistry.js +494 -0
  88. package/dist/tools/ToolRegistry.js.map +1 -0
  89. package/dist/tools/command.d.ts +4 -0
  90. package/dist/tools/command.d.ts.map +1 -0
  91. package/dist/tools/command.js +117 -0
  92. package/dist/tools/command.js.map +1 -0
  93. package/dist/tools/file-ops-test.d.ts +6 -0
  94. package/dist/tools/file-ops-test.d.ts.map +1 -0
  95. package/dist/tools/file-ops-test.js +197 -0
  96. package/dist/tools/file-ops-test.js.map +1 -0
  97. package/dist/tools/file-ops.d.ts +6 -0
  98. package/dist/tools/file-ops.d.ts.map +1 -0
  99. package/dist/tools/file-ops.js +189 -0
  100. package/dist/tools/file-ops.js.map +1 -0
  101. package/dist/tools/plan-mode.d.ts +53 -0
  102. package/dist/tools/plan-mode.d.ts.map +1 -0
  103. package/dist/tools/plan-mode.js +202 -0
  104. package/dist/tools/plan-mode.js.map +1 -0
  105. package/dist/tools/registry.d.ts +30 -0
  106. package/dist/tools/registry.d.ts.map +1 -0
  107. package/dist/tools/registry.js +67 -0
  108. package/dist/tools/registry.js.map +1 -0
  109. package/dist/tools/types.d.ts +34 -0
  110. package/dist/tools/types.d.ts.map +1 -0
  111. package/dist/tools/types.js +2 -0
  112. package/dist/tools/types.js.map +1 -0
  113. package/dist/tools/web-search.d.ts +24 -0
  114. package/dist/tools/web-search.d.ts.map +1 -0
  115. package/dist/tools/web-search.js +194 -0
  116. package/dist/tools/web-search.js.map +1 -0
  117. package/dist/types/index.d.ts +32 -0
  118. package/dist/types/index.d.ts.map +1 -0
  119. package/dist/types/index.js +2 -0
  120. package/dist/types/index.js.map +1 -0
  121. package/dist/ui/DisplayHistory.d.ts +53 -0
  122. package/dist/ui/DisplayHistory.d.ts.map +1 -0
  123. package/dist/ui/DisplayHistory.js +82 -0
  124. package/dist/ui/DisplayHistory.js.map +1 -0
  125. package/dist/ui/clack-ui.d.ts +83 -0
  126. package/dist/ui/clack-ui.d.ts.map +1 -0
  127. package/dist/ui/clack-ui.js +304 -0
  128. package/dist/ui/clack-ui.js.map +1 -0
  129. package/dist/ui/components/App.d.ts +47 -0
  130. package/dist/ui/components/App.d.ts.map +1 -0
  131. package/dist/ui/components/App.js +389 -0
  132. package/dist/ui/components/App.js.map +1 -0
  133. package/dist/ui/components/AuthScreen.d.ts +8 -0
  134. package/dist/ui/components/AuthScreen.d.ts.map +1 -0
  135. package/dist/ui/components/AuthScreen.js +37 -0
  136. package/dist/ui/components/AuthScreen.js.map +1 -0
  137. package/dist/ui/components/AuthWelcomeScreen.d.ts +8 -0
  138. package/dist/ui/components/AuthWelcomeScreen.d.ts.map +1 -0
  139. package/dist/ui/components/AuthWelcomeScreen.js +34 -0
  140. package/dist/ui/components/AuthWelcomeScreen.js.map +1 -0
  141. package/dist/ui/components/CodeBlock.d.ts +9 -0
  142. package/dist/ui/components/CodeBlock.d.ts.map +1 -0
  143. package/dist/ui/components/CodeBlock.js +22 -0
  144. package/dist/ui/components/CodeBlock.js.map +1 -0
  145. package/dist/ui/components/ConfigViewer.d.ts +11 -0
  146. package/dist/ui/components/ConfigViewer.d.ts.map +1 -0
  147. package/dist/ui/components/ConfigViewer.js +27 -0
  148. package/dist/ui/components/ConfigViewer.js.map +1 -0
  149. package/dist/ui/components/ConfirmPrompt.d.ts +11 -0
  150. package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -0
  151. package/dist/ui/components/ConfirmPrompt.js +55 -0
  152. package/dist/ui/components/ConfirmPrompt.js.map +1 -0
  153. package/dist/ui/components/DiffViewer.d.ts +8 -0
  154. package/dist/ui/components/DiffViewer.d.ts.map +1 -0
  155. package/dist/ui/components/DiffViewer.js +63 -0
  156. package/dist/ui/components/DiffViewer.js.map +1 -0
  157. package/dist/ui/components/DisplayItemRenderer.d.ts +18 -0
  158. package/dist/ui/components/DisplayItemRenderer.d.ts.map +1 -0
  159. package/dist/ui/components/DisplayItemRenderer.js +53 -0
  160. package/dist/ui/components/DisplayItemRenderer.js.map +1 -0
  161. package/dist/ui/components/DynamicMessage.d.ts +13 -0
  162. package/dist/ui/components/DynamicMessage.d.ts.map +1 -0
  163. package/dist/ui/components/DynamicMessage.js +27 -0
  164. package/dist/ui/components/DynamicMessage.js.map +1 -0
  165. package/dist/ui/components/ErrorBoundary.d.ts +16 -0
  166. package/dist/ui/components/ErrorBoundary.d.ts.map +1 -0
  167. package/dist/ui/components/ErrorBoundary.js +25 -0
  168. package/dist/ui/components/ErrorBoundary.js.map +1 -0
  169. package/dist/ui/components/FileOperation.d.ts +10 -0
  170. package/dist/ui/components/FileOperation.d.ts.map +1 -0
  171. package/dist/ui/components/FileOperation.js +31 -0
  172. package/dist/ui/components/FileOperation.js.map +1 -0
  173. package/dist/ui/components/InputBox.d.ts +12 -0
  174. package/dist/ui/components/InputBox.d.ts.map +1 -0
  175. package/dist/ui/components/InputBox.js +50 -0
  176. package/dist/ui/components/InputBox.js.map +1 -0
  177. package/dist/ui/components/KeyboardHelp.d.ts +7 -0
  178. package/dist/ui/components/KeyboardHelp.d.ts.map +1 -0
  179. package/dist/ui/components/KeyboardHelp.js +25 -0
  180. package/dist/ui/components/KeyboardHelp.js.map +1 -0
  181. package/dist/ui/components/LoadingIndicator.d.ts +3 -0
  182. package/dist/ui/components/LoadingIndicator.d.ts.map +1 -0
  183. package/dist/ui/components/LoadingIndicator.js +25 -0
  184. package/dist/ui/components/LoadingIndicator.js.map +1 -0
  185. package/dist/ui/components/MarkdownRenderer.d.ts +8 -0
  186. package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
  187. package/dist/ui/components/MarkdownRenderer.js +96 -0
  188. package/dist/ui/components/MarkdownRenderer.js.map +1 -0
  189. package/dist/ui/components/MessageBox.d.ts +10 -0
  190. package/dist/ui/components/MessageBox.d.ts.map +1 -0
  191. package/dist/ui/components/MessageBox.js +50 -0
  192. package/dist/ui/components/MessageBox.js.map +1 -0
  193. package/dist/ui/components/MessageDisplay.d.ts +8 -0
  194. package/dist/ui/components/MessageDisplay.d.ts.map +1 -0
  195. package/dist/ui/components/MessageDisplay.js +43 -0
  196. package/dist/ui/components/MessageDisplay.js.map +1 -0
  197. package/dist/ui/components/ScrollableContent.d.ts +7 -0
  198. package/dist/ui/components/ScrollableContent.d.ts.map +1 -0
  199. package/dist/ui/components/ScrollableContent.js +6 -0
  200. package/dist/ui/components/ScrollableContent.js.map +1 -0
  201. package/dist/ui/components/ScrollableMessageList.d.ts +10 -0
  202. package/dist/ui/components/ScrollableMessageList.d.ts.map +1 -0
  203. package/dist/ui/components/ScrollableMessageList.js +133 -0
  204. package/dist/ui/components/ScrollableMessageList.js.map +1 -0
  205. package/dist/ui/components/ScrollableScreen.d.ts +9 -0
  206. package/dist/ui/components/ScrollableScreen.d.ts.map +1 -0
  207. package/dist/ui/components/ScrollableScreen.js +22 -0
  208. package/dist/ui/components/ScrollableScreen.js.map +1 -0
  209. package/dist/ui/components/SelectPrompt.d.ts +12 -0
  210. package/dist/ui/components/SelectPrompt.d.ts.map +1 -0
  211. package/dist/ui/components/SelectPrompt.js +10 -0
  212. package/dist/ui/components/SelectPrompt.js.map +1 -0
  213. package/dist/ui/components/StaticMessageHistory.d.ts +14 -0
  214. package/dist/ui/components/StaticMessageHistory.d.ts.map +1 -0
  215. package/dist/ui/components/StaticMessageHistory.js +19 -0
  216. package/dist/ui/components/StaticMessageHistory.js.map +1 -0
  217. package/dist/ui/components/StatusBar.d.ts +10 -0
  218. package/dist/ui/components/StatusBar.d.ts.map +1 -0
  219. package/dist/ui/components/StatusBar.js +20 -0
  220. package/dist/ui/components/StatusBar.js.map +1 -0
  221. package/dist/ui/components/StreamingMessageDisplay.d.ts +13 -0
  222. package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -0
  223. package/dist/ui/components/StreamingMessageDisplay.js +26 -0
  224. package/dist/ui/components/StreamingMessageDisplay.js.map +1 -0
  225. package/dist/ui/components/ToolExecutionMessage.d.ts +8 -0
  226. package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -0
  227. package/dist/ui/components/ToolExecutionMessage.js +189 -0
  228. package/dist/ui/components/ToolExecutionMessage.js.map +1 -0
  229. package/dist/ui/components/ToolExecutionStatus.d.ts +10 -0
  230. package/dist/ui/components/ToolExecutionStatus.d.ts.map +1 -0
  231. package/dist/ui/components/ToolExecutionStatus.js +65 -0
  232. package/dist/ui/components/ToolExecutionStatus.js.map +1 -0
  233. package/dist/ui/components/ToolResult.d.ts +10 -0
  234. package/dist/ui/components/ToolResult.d.ts.map +1 -0
  235. package/dist/ui/components/ToolResult.js +17 -0
  236. package/dist/ui/components/ToolResult.js.map +1 -0
  237. package/dist/ui/components/WelcomeBanner.d.ts +3 -0
  238. package/dist/ui/components/WelcomeBanner.d.ts.map +1 -0
  239. package/dist/ui/components/WelcomeBanner.js +28 -0
  240. package/dist/ui/components/WelcomeBanner.js.map +1 -0
  241. package/dist/ui/components/code-block.d.ts +10 -0
  242. package/dist/ui/components/code-block.d.ts.map +1 -0
  243. package/dist/ui/components/code-block.js +74 -0
  244. package/dist/ui/components/code-block.js.map +1 -0
  245. package/dist/ui/components/confirm-prompt.d.ts +12 -0
  246. package/dist/ui/components/confirm-prompt.d.ts.map +1 -0
  247. package/dist/ui/components/confirm-prompt.js +104 -0
  248. package/dist/ui/components/confirm-prompt.js.map +1 -0
  249. package/dist/ui/components/diff-viewer.d.ts +9 -0
  250. package/dist/ui/components/diff-viewer.d.ts.map +1 -0
  251. package/dist/ui/components/diff-viewer.js +57 -0
  252. package/dist/ui/components/diff-viewer.js.map +1 -0
  253. package/dist/ui/components/input-box.d.ts +18 -0
  254. package/dist/ui/components/input-box.d.ts.map +1 -0
  255. package/dist/ui/components/input-box.js +157 -0
  256. package/dist/ui/components/input-box.js.map +1 -0
  257. package/dist/ui/components/keyboard-help.d.ts +7 -0
  258. package/dist/ui/components/keyboard-help.d.ts.map +1 -0
  259. package/dist/ui/components/keyboard-help.js +43 -0
  260. package/dist/ui/components/keyboard-help.js.map +1 -0
  261. package/dist/ui/components/loading-indicator.d.ts +3 -0
  262. package/dist/ui/components/loading-indicator.d.ts.map +1 -0
  263. package/dist/ui/components/loading-indicator.js +42 -0
  264. package/dist/ui/components/loading-indicator.js.map +1 -0
  265. package/dist/ui/components/message-display.d.ts +7 -0
  266. package/dist/ui/components/message-display.d.ts.map +1 -0
  267. package/dist/ui/components/message-display.js +104 -0
  268. package/dist/ui/components/message-display.js.map +1 -0
  269. package/dist/ui/components/misc.d.ts +28 -0
  270. package/dist/ui/components/misc.d.ts.map +1 -0
  271. package/dist/ui/components/misc.js +128 -0
  272. package/dist/ui/components/misc.js.map +1 -0
  273. package/dist/ui/components/select-prompt.d.ts +13 -0
  274. package/dist/ui/components/select-prompt.d.ts.map +1 -0
  275. package/dist/ui/components/select-prompt.js +42 -0
  276. package/dist/ui/components/select-prompt.js.map +1 -0
  277. package/dist/ui/components/status-bar.d.ts +11 -0
  278. package/dist/ui/components/status-bar.d.ts.map +1 -0
  279. package/dist/ui/components/status-bar.js +47 -0
  280. package/dist/ui/components/status-bar.js.map +1 -0
  281. package/dist/ui/components/tool-execution.d.ts +3 -0
  282. package/dist/ui/components/tool-execution.d.ts.map +1 -0
  283. package/dist/ui/components/tool-execution.js +374 -0
  284. package/dist/ui/components/tool-execution.js.map +1 -0
  285. package/dist/ui/components/tool-result.d.ts +11 -0
  286. package/dist/ui/components/tool-result.d.ts.map +1 -0
  287. package/dist/ui/components/tool-result.js +58 -0
  288. package/dist/ui/components/tool-result.js.map +1 -0
  289. package/dist/ui/components/welcome-banner.d.ts +3 -0
  290. package/dist/ui/components/welcome-banner.d.ts.map +1 -0
  291. package/dist/ui/components/welcome-banner.js +46 -0
  292. package/dist/ui/components/welcome-banner.js.map +1 -0
  293. package/dist/ui/hooks/useDisplayHistory.d.ts +13 -0
  294. package/dist/ui/hooks/useDisplayHistory.d.ts.map +1 -0
  295. package/dist/ui/hooks/useDisplayHistory.js +45 -0
  296. package/dist/ui/hooks/useDisplayHistory.js.map +1 -0
  297. package/dist/ui/render-engine.d.ts +69 -0
  298. package/dist/ui/render-engine.d.ts.map +1 -0
  299. package/dist/ui/render-engine.js +197 -0
  300. package/dist/ui/render-engine.js.map +1 -0
  301. package/dist/ui/terminal/TerminalRenderer.d.ts +84 -0
  302. package/dist/ui/terminal/TerminalRenderer.d.ts.map +1 -0
  303. package/dist/ui/terminal/TerminalRenderer.js +154 -0
  304. package/dist/ui/terminal/TerminalRenderer.js.map +1 -0
  305. package/dist/ui/terminal/TerminalUI.d.ts +139 -0
  306. package/dist/ui/terminal/TerminalUI.d.ts.map +1 -0
  307. package/dist/ui/terminal/TerminalUI.js +430 -0
  308. package/dist/ui/terminal/TerminalUI.js.map +1 -0
  309. package/dist/ui/terminal/VirtualChatBuffer.d.ts +32 -0
  310. package/dist/ui/terminal/VirtualChatBuffer.d.ts.map +1 -0
  311. package/dist/ui/terminal/VirtualChatBuffer.js +37 -0
  312. package/dist/ui/terminal/VirtualChatBuffer.js.map +1 -0
  313. package/dist/ui/terminal-kit-base.d.ts +117 -0
  314. package/dist/ui/terminal-kit-base.d.ts.map +1 -0
  315. package/dist/ui/terminal-kit-base.js +188 -0
  316. package/dist/ui/terminal-kit-base.js.map +1 -0
  317. package/dist/utils/file.d.ts +21 -0
  318. package/dist/utils/file.d.ts.map +1 -0
  319. package/dist/utils/file.js +68 -0
  320. package/dist/utils/file.js.map +1 -0
  321. package/dist/utils/logger.d.ts +17 -0
  322. package/dist/utils/logger.d.ts.map +1 -0
  323. package/dist/utils/logger.js +57 -0
  324. package/dist/utils/logger.js.map +1 -0
  325. package/dist/utils/markdown-parser.d.ts +56 -0
  326. package/dist/utils/markdown-parser.d.ts.map +1 -0
  327. package/dist/utils/markdown-parser.js +307 -0
  328. package/dist/utils/markdown-parser.js.map +1 -0
  329. package/dist/utils/shell.d.ts +7 -0
  330. package/dist/utils/shell.d.ts.map +1 -0
  331. package/dist/utils/shell.js +62 -0
  332. package/dist/utils/shell.js.map +1 -0
  333. package/dist/utils/state.d.ts +13 -0
  334. package/dist/utils/state.d.ts.map +1 -0
  335. package/dist/utils/state.js +25 -0
  336. package/dist/utils/state.js.map +1 -0
  337. package/package.json +81 -0
  338. package/postinstall.js +46 -0
package/AUTH_FLOW.md ADDED
@@ -0,0 +1,138 @@
1
+ # Authentication Flow
2
+
3
+ ## Overview
4
+
5
+ The Centaurus CLI now features an improved authentication flow with a beautiful UI that guides users through the sign-in process.
6
+
7
+ ## First-Time User Experience
8
+
9
+ When a user starts the CLI for the first time (without an existing session), they will see:
10
+
11
+ ### 1. Welcome Banner
12
+ ```
13
+ ██████╗███████╗███╗ ██╗████████╗ █████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗
14
+ ██╔════╝██╔════╝████╗ ██║╚══██╔══╝██╔══██╗██║ ██║██╔══██╗██║ ██║██╔════╝
15
+ ██║ █████╗ ██╔██╗ ██║ ██║ ███████║██║ ██║██████╔╝██║ ██║███████╗
16
+ ██║ ██╔══╝ ██║╚██╗██║ ██║ ██╔══██║██║ ██║██╔══██╗██║ ██║╚════██║
17
+ ╚██████╗███████╗██║ ╚████║ ██║ ██║ ██║╚██████╔╝██║ ██║╚██████╔╝███████║
18
+ ╚═════╝╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
19
+
20
+ ██████╗██╗ ██╗
21
+ ██╔════╝██║ ██║
22
+ ██║ ██║ ██║
23
+ ██║ ██║ ██║
24
+ ╚██████╗███████╗██║
25
+ ╚═════╝╚══════╝╚═╝
26
+ ```
27
+
28
+ ### 2. Authentication Information
29
+ ```
30
+ 🔐 Authentication Required
31
+
32
+ To use Centaurus CLI, you need to sign in with Google.
33
+
34
+ Cloud Sync Features:
35
+ ✅ Conversation history across devices
36
+ ✅ Settings synchronization
37
+ ✅ Encrypted API key storage
38
+ ✅ Web search capabilities
39
+
40
+ Note: You can still use AI features offline, but web search requires authentication.
41
+ ```
42
+
43
+ ### 3. Interactive Picker
44
+ ```
45
+ ┌─ What would you like to do? ─┐
46
+ │ > 🔑 Sign in with Google │
47
+ │ ❌ Exit │
48
+ └───────────────────────────────┘
49
+ ```
50
+
51
+ Users can navigate with arrow keys and press Enter to select.
52
+
53
+ ## User Choices
54
+
55
+ ### Option 1: Sign in with Google
56
+ 1. User selects "🔑 Sign in with Google"
57
+ 2. Screen clears and shows: "🔐 Opening browser for authentication..."
58
+ 3. Browser opens with Google OAuth flow
59
+ 4. User completes authentication in browser
60
+ 5. CLI receives session token
61
+ 6. Success message: "✅ You are now signed in and cloud sync is enabled!"
62
+ 7. Main CLI interface loads
63
+
64
+ ### Option 2: Exit
65
+ 1. User selects "❌ Exit"
66
+ 2. Screen clears
67
+ 3. Shows: "👋 Goodbye!"
68
+ 4. CLI exits gracefully
69
+
70
+ ## Returning Users
71
+
72
+ When a user has an existing valid session:
73
+ - Authentication screen is skipped
74
+ - CLI loads directly to the main interface
75
+ - User can start chatting immediately
76
+
77
+ ## Backend Unavailable
78
+
79
+ If the backend API is not reachable:
80
+ - Shows warning: "⚠️ Backend API is not reachable."
81
+ - Continues in offline mode
82
+ - User can still use AI features (except web search)
83
+
84
+ ## Session Management
85
+
86
+ ### Active Session
87
+ - Session token stored in `~/.centaurus/session.json`
88
+ - Valid for 30 days
89
+ - Automatically refreshed on use
90
+
91
+ ### Logout
92
+ - User types `/logout` command
93
+ - Session cleared from local storage
94
+ - CLI exits
95
+ - Next start will show authentication screen again
96
+
97
+ ## Technical Details
98
+
99
+ ### Components Used
100
+ - `AuthWelcomeScreen.tsx` - Main authentication welcome screen
101
+ - `WelcomeBanner.tsx` - ASCII art banner
102
+ - `SelectPrompt.tsx` - Interactive picker component
103
+
104
+ ### Authentication Flow
105
+ 1. Check if `apiClient.isAuthenticated()` returns true
106
+ 2. If not authenticated, check backend availability
107
+ 3. Render `AuthWelcomeScreen` component
108
+ 4. Wait for user selection
109
+ 5. Handle sign-in or exit accordingly
110
+
111
+ ### Error Handling
112
+ - Backend unreachable → Continue in offline mode
113
+ - Authentication failed → Exit with error message
114
+ - User cancels → Exit gracefully
115
+
116
+ ## Benefits
117
+
118
+ ### User Experience
119
+ - ✅ Beautiful, branded welcome screen
120
+ - ✅ Clear explanation of features
121
+ - ✅ Easy-to-use picker interface
122
+ - ✅ No confusing Y/N prompts
123
+ - ✅ Consistent with CLI UI theme
124
+
125
+ ### Developer Experience
126
+ - ✅ Reusable components
127
+ - ✅ Clean separation of concerns
128
+ - ✅ Easy to modify or extend
129
+ - ✅ Proper error handling
130
+
131
+ ## Future Enhancements
132
+
133
+ Potential improvements:
134
+ - Add "Learn More" option with detailed feature explanation
135
+ - Show backend status (online/offline) in real-time
136
+ - Add "Skip for now" option to continue in offline mode
137
+ - Remember user preference for future sessions
138
+ - Add animation to the banner
@@ -0,0 +1,255 @@
1
+ # Centaurus CLI Configuration Guide
2
+
3
+ ## Overview
4
+
5
+ The Centaurus CLI stores configuration in two places:
6
+ 1. **Environment variables** (`.env` file) - Backend API URL only
7
+ 2. **User config file** (`~/.centaurus/config.json`) - API keys and preferences
8
+
9
+ ## Initial Setup
10
+
11
+ ### 1. Backend API Configuration
12
+
13
+ Create or update `.env` file in the CLI directory:
14
+
15
+ ```env
16
+ BACKEND_API_URL=http://localhost:3000/api
17
+ ```
18
+
19
+ For production, update to your backend URL:
20
+ ```env
21
+ BACKEND_API_URL=https://api.yourapp.com/api
22
+ ```
23
+
24
+ ### 2. AI Provider API Keys
25
+
26
+ Configure your API keys using slash commands in the CLI:
27
+
28
+ ```bash
29
+ # Google AI (Gemini)
30
+ /config set googleApiKey YOUR_GOOGLE_API_KEY
31
+
32
+ # OpenRouter (Multiple AI models)
33
+ /config set openrouterApiKey YOUR_OPENROUTER_API_KEY
34
+ ```
35
+
36
+ **Get API Keys:**
37
+ - Google AI Studio: https://makersuite.google.com/app/apikey
38
+ - OpenRouter: https://openrouter.ai/keys
39
+
40
+ ## Configuration Commands
41
+
42
+ ### View Current Configuration
43
+
44
+ ```bash
45
+ /config
46
+ ```
47
+
48
+ Shows:
49
+ - Current provider (google/openrouter)
50
+ - Current model
51
+ - API key status (configured or not)
52
+
53
+ ### Set API Keys
54
+
55
+ ```bash
56
+ /config set googleApiKey YOUR_KEY_HERE
57
+ /config set openrouterApiKey YOUR_KEY_HERE
58
+ ```
59
+
60
+ Keys are:
61
+ - Encrypted using machine-specific key
62
+ - Stored in `~/.centaurus/config.json`
63
+ - Never sent to backend (except for cloud sync)
64
+
65
+ ### Change Provider
66
+
67
+ ```bash
68
+ /provider
69
+ ```
70
+
71
+ Opens a picker to select:
72
+ - `google` - Google Gemini models
73
+ - `openrouter` - Multiple AI providers
74
+
75
+ Or set directly:
76
+ ```bash
77
+ /provider google
78
+ /provider openrouter
79
+ ```
80
+
81
+ ### Change Model
82
+
83
+ ```bash
84
+ /model
85
+ ```
86
+
87
+ Opens a picker to select from available models:
88
+ - gemini-2.5-flash
89
+ - gemini-2.5-pro
90
+ - gemini-2.0-flash-exp
91
+ - gemini-2.0-flash-thinking-exp
92
+ - gemini-1.5-pro
93
+ - gemini-1.5-flash
94
+
95
+ Or set directly:
96
+ ```bash
97
+ /model gemini-2.5-flash
98
+ ```
99
+
100
+ ## Cloud Sync (Optional)
101
+
102
+ ### Sign In
103
+
104
+ When you first run the CLI, you'll be prompted to sign in with Google for cloud sync features:
105
+
106
+ **Cloud Sync Features:**
107
+ - ✅ Conversation history across devices
108
+ - ✅ Settings synchronization
109
+ - ✅ Encrypted API key storage in cloud
110
+
111
+ **Offline Mode:**
112
+ - ✅ All AI features work
113
+ - ✅ Local conversation history
114
+ - ❌ No sync across devices
115
+ - ❌ No web search (requires backend)
116
+
117
+ ### Sign Out
118
+
119
+ ```bash
120
+ /logout
121
+ ```
122
+
123
+ Clears your session and exits the CLI. You'll need to restart the CLI to continue using it in offline mode or sign in again.
124
+
125
+ ## Configuration File Location
126
+
127
+ Your configuration is stored at:
128
+ - **Windows**: `C:\Users\YourName\.centaurus\config.json`
129
+ - **macOS/Linux**: `~/.centaurus/config.json`
130
+
131
+ ### Config File Structure
132
+
133
+ ```json
134
+ {
135
+ "provider": "google",
136
+ "model": "gemini-2.5-flash",
137
+ "googleApiKey": "encrypted_key_here",
138
+ "openrouterApiKey": "encrypted_key_here",
139
+ "theme": "default",
140
+ "autoAccept": false
141
+ }
142
+ ```
143
+
144
+ **Note:** API keys are encrypted and cannot be read directly.
145
+
146
+ ## Web Search Configuration
147
+
148
+ Web search is handled by the backend and requires:
149
+ 1. Authentication (sign in with Google)
150
+ 2. Backend server running with Serper API key
151
+
152
+ **No client-side configuration needed!**
153
+
154
+ The backend administrator configures the Serper API key server-side.
155
+
156
+ ## Troubleshooting
157
+
158
+ ### "API key not set" Error
159
+
160
+ ```bash
161
+ # Check current config
162
+ /config
163
+
164
+ # Set the appropriate API key
165
+ /config set googleApiKey YOUR_KEY
166
+ ```
167
+
168
+ ### "Authentication required" for Web Search
169
+
170
+ Web search requires signing in:
171
+ 1. Restart the CLI
172
+ 2. Choose "Yes" when prompted to sign in
173
+ 3. Complete Google OAuth flow
174
+
175
+ ### "Backend API is not reachable"
176
+
177
+ Check your `.env` file:
178
+ ```env
179
+ BACKEND_API_URL=http://localhost:3000/api
180
+ ```
181
+
182
+ Verify backend is running:
183
+ ```bash
184
+ cd backend
185
+ npm start
186
+ ```
187
+
188
+ ### Reset Configuration
189
+
190
+ To start fresh, delete the config file:
191
+
192
+ **Windows:**
193
+ ```cmd
194
+ del %USERPROFILE%\.centaurus\config.json
195
+ ```
196
+
197
+ **macOS/Linux:**
198
+ ```bash
199
+ rm ~/.centaurus/config.json
200
+ ```
201
+
202
+ Then restart the CLI and reconfigure.
203
+
204
+ ## Security Best Practices
205
+
206
+ 1. **Never commit `.env` files** - Add to `.gitignore`
207
+ 2. **Keep API keys private** - Don't share your config file
208
+ 3. **Use environment-specific URLs** - Different URLs for dev/prod
209
+ 4. **Rotate keys regularly** - Update keys periodically
210
+ 5. **Sign out on shared machines** - Use `/logout` command
211
+
212
+ ## Advanced Configuration
213
+
214
+ ### Multiple API Keys (Key Rotation)
215
+
216
+ You can configure multiple API keys for automatic rotation:
217
+
218
+ ```bash
219
+ /config set googleApiKey key1,key2,key3
220
+ ```
221
+
222
+ The CLI will automatically rotate between keys to avoid rate limits.
223
+
224
+ ### Custom Backend URL
225
+
226
+ For development or self-hosted backends:
227
+
228
+ ```env
229
+ BACKEND_API_URL=http://localhost:3000/api
230
+ ```
231
+
232
+ For production:
233
+
234
+ ```env
235
+ BACKEND_API_URL=https://api.centaurus.app/api
236
+ ```
237
+
238
+ ## Getting Help
239
+
240
+ ```bash
241
+ /help
242
+ ```
243
+
244
+ Shows all available commands and their usage.
245
+
246
+ ## Next Steps
247
+
248
+ 1. Configure your API keys
249
+ 2. Choose your preferred provider and model
250
+ 3. Start chatting with the AI!
251
+ 4. (Optional) Sign in for cloud sync
252
+
253
+ For more information, see:
254
+ - [README.md](./README.md) - General CLI documentation
255
+ - [COMMANDS.md](./COMMANDS.md) - Complete command reference
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Centaurus CLI Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.