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.
- package/AUTH_FLOW.md +138 -0
- package/CONFIG_GUIDE.md +255 -0
- package/LICENSE +21 -0
- package/README.md +346 -0
- package/dist/ai/provider-factory.d.ts +6 -0
- package/dist/ai/provider-factory.d.ts.map +1 -0
- package/dist/ai/provider-factory.js +27 -0
- package/dist/ai/provider-factory.js.map +1 -0
- package/dist/ai/providers/base.d.ts +25 -0
- package/dist/ai/providers/base.d.ts.map +1 -0
- package/dist/ai/providers/base.js +9 -0
- package/dist/ai/providers/base.js.map +1 -0
- package/dist/ai/providers/gemini.d.ts +34 -0
- package/dist/ai/providers/gemini.d.ts.map +1 -0
- package/dist/ai/providers/gemini.js +146 -0
- package/dist/ai/providers/gemini.js.map +1 -0
- package/dist/ai/types.d.ts +20 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/cli-adapter.d.ts +78 -0
- package/dist/cli-adapter.d.ts.map +1 -0
- package/dist/cli-adapter.js +605 -0
- package/dist/cli-adapter.js.map +1 -0
- package/dist/commands/CommandParser.d.ts +27 -0
- package/dist/commands/CommandParser.d.ts.map +1 -0
- package/dist/commands/CommandParser.js +238 -0
- package/dist/commands/CommandParser.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +59 -0
- package/dist/config/ConfigManager.d.ts.map +1 -0
- package/dist/config/ConfigManager.js +332 -0
- package/dist/config/ConfigManager.js.map +1 -0
- package/dist/config/defaultConfig.d.ts +82 -0
- package/dist/config/defaultConfig.d.ts.map +1 -0
- package/dist/config/defaultConfig.js +88 -0
- package/dist/config/defaultConfig.js.map +1 -0
- package/dist/config/manager.d.ts +60 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +162 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/types.d.ts +9 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +6 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index-custom.d.ts +3 -0
- package/dist/index-custom.d.ts.map +1 -0
- package/dist/index-custom.js +65 -0
- package/dist/index-custom.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +102 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/system-prompt.d.ts +47 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -0
- package/dist/prompts/system-prompt.js +378 -0
- package/dist/prompts/system-prompt.js.map +1 -0
- package/dist/providers/GoogleProvider.d.ts +26 -0
- package/dist/providers/GoogleProvider.d.ts.map +1 -0
- package/dist/providers/GoogleProvider.js +313 -0
- package/dist/providers/GoogleProvider.js.map +1 -0
- package/dist/providers/Provider.d.ts +114 -0
- package/dist/providers/Provider.d.ts.map +1 -0
- package/dist/providers/Provider.js +44 -0
- package/dist/providers/Provider.js.map +1 -0
- package/dist/services/api-client.d.ts +282 -0
- package/dist/services/api-client.d.ts.map +1 -0
- package/dist/services/api-client.js +339 -0
- package/dist/services/api-client.js.map +1 -0
- package/dist/services/auth-handler.d.ts +30 -0
- package/dist/services/auth-handler.d.ts.map +1 -0
- package/dist/services/auth-handler.js +210 -0
- package/dist/services/auth-handler.js.map +1 -0
- package/dist/services/conversation-manager.d.ts +73 -0
- package/dist/services/conversation-manager.d.ts.map +1 -0
- package/dist/services/conversation-manager.js +128 -0
- package/dist/services/conversation-manager.js.map +1 -0
- package/dist/tests/automated-verification.d.ts +27 -0
- package/dist/tests/automated-verification.d.ts.map +1 -0
- package/dist/tests/automated-verification.js +359 -0
- package/dist/tests/automated-verification.js.map +1 -0
- package/dist/tests/integration-tests.d.ts +50 -0
- package/dist/tests/integration-tests.d.ts.map +1 -0
- package/dist/tests/integration-tests.js +648 -0
- package/dist/tests/integration-tests.js.map +1 -0
- package/dist/tools/ToolRegistry.d.ts +44 -0
- package/dist/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/tools/ToolRegistry.js +494 -0
- package/dist/tools/ToolRegistry.js.map +1 -0
- package/dist/tools/command.d.ts +4 -0
- package/dist/tools/command.d.ts.map +1 -0
- package/dist/tools/command.js +117 -0
- package/dist/tools/command.js.map +1 -0
- package/dist/tools/file-ops-test.d.ts +6 -0
- package/dist/tools/file-ops-test.d.ts.map +1 -0
- package/dist/tools/file-ops-test.js +197 -0
- package/dist/tools/file-ops-test.js.map +1 -0
- package/dist/tools/file-ops.d.ts +6 -0
- package/dist/tools/file-ops.d.ts.map +1 -0
- package/dist/tools/file-ops.js +189 -0
- package/dist/tools/file-ops.js.map +1 -0
- package/dist/tools/plan-mode.d.ts +53 -0
- package/dist/tools/plan-mode.d.ts.map +1 -0
- package/dist/tools/plan-mode.js +202 -0
- package/dist/tools/plan-mode.js.map +1 -0
- package/dist/tools/registry.d.ts +30 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +67 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +34 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/web-search.d.ts +24 -0
- package/dist/tools/web-search.d.ts.map +1 -0
- package/dist/tools/web-search.js +194 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/types/index.d.ts +32 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/DisplayHistory.d.ts +53 -0
- package/dist/ui/DisplayHistory.d.ts.map +1 -0
- package/dist/ui/DisplayHistory.js +82 -0
- package/dist/ui/DisplayHistory.js.map +1 -0
- package/dist/ui/clack-ui.d.ts +83 -0
- package/dist/ui/clack-ui.d.ts.map +1 -0
- package/dist/ui/clack-ui.js +304 -0
- package/dist/ui/clack-ui.js.map +1 -0
- package/dist/ui/components/App.d.ts +47 -0
- package/dist/ui/components/App.d.ts.map +1 -0
- package/dist/ui/components/App.js +389 -0
- package/dist/ui/components/App.js.map +1 -0
- package/dist/ui/components/AuthScreen.d.ts +8 -0
- package/dist/ui/components/AuthScreen.d.ts.map +1 -0
- package/dist/ui/components/AuthScreen.js +37 -0
- package/dist/ui/components/AuthScreen.js.map +1 -0
- package/dist/ui/components/AuthWelcomeScreen.d.ts +8 -0
- package/dist/ui/components/AuthWelcomeScreen.d.ts.map +1 -0
- package/dist/ui/components/AuthWelcomeScreen.js +34 -0
- package/dist/ui/components/AuthWelcomeScreen.js.map +1 -0
- package/dist/ui/components/CodeBlock.d.ts +9 -0
- package/dist/ui/components/CodeBlock.d.ts.map +1 -0
- package/dist/ui/components/CodeBlock.js +22 -0
- package/dist/ui/components/CodeBlock.js.map +1 -0
- package/dist/ui/components/ConfigViewer.d.ts +11 -0
- package/dist/ui/components/ConfigViewer.d.ts.map +1 -0
- package/dist/ui/components/ConfigViewer.js +27 -0
- package/dist/ui/components/ConfigViewer.js.map +1 -0
- package/dist/ui/components/ConfirmPrompt.d.ts +11 -0
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -0
- package/dist/ui/components/ConfirmPrompt.js +55 -0
- package/dist/ui/components/ConfirmPrompt.js.map +1 -0
- package/dist/ui/components/DiffViewer.d.ts +8 -0
- package/dist/ui/components/DiffViewer.d.ts.map +1 -0
- package/dist/ui/components/DiffViewer.js +63 -0
- package/dist/ui/components/DiffViewer.js.map +1 -0
- package/dist/ui/components/DisplayItemRenderer.d.ts +18 -0
- package/dist/ui/components/DisplayItemRenderer.d.ts.map +1 -0
- package/dist/ui/components/DisplayItemRenderer.js +53 -0
- package/dist/ui/components/DisplayItemRenderer.js.map +1 -0
- package/dist/ui/components/DynamicMessage.d.ts +13 -0
- package/dist/ui/components/DynamicMessage.d.ts.map +1 -0
- package/dist/ui/components/DynamicMessage.js +27 -0
- package/dist/ui/components/DynamicMessage.js.map +1 -0
- package/dist/ui/components/ErrorBoundary.d.ts +16 -0
- package/dist/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/ui/components/ErrorBoundary.js +25 -0
- package/dist/ui/components/ErrorBoundary.js.map +1 -0
- package/dist/ui/components/FileOperation.d.ts +10 -0
- package/dist/ui/components/FileOperation.d.ts.map +1 -0
- package/dist/ui/components/FileOperation.js +31 -0
- package/dist/ui/components/FileOperation.js.map +1 -0
- package/dist/ui/components/InputBox.d.ts +12 -0
- package/dist/ui/components/InputBox.d.ts.map +1 -0
- package/dist/ui/components/InputBox.js +50 -0
- package/dist/ui/components/InputBox.js.map +1 -0
- package/dist/ui/components/KeyboardHelp.d.ts +7 -0
- package/dist/ui/components/KeyboardHelp.d.ts.map +1 -0
- package/dist/ui/components/KeyboardHelp.js +25 -0
- package/dist/ui/components/KeyboardHelp.js.map +1 -0
- package/dist/ui/components/LoadingIndicator.d.ts +3 -0
- package/dist/ui/components/LoadingIndicator.d.ts.map +1 -0
- package/dist/ui/components/LoadingIndicator.js +25 -0
- package/dist/ui/components/LoadingIndicator.js.map +1 -0
- package/dist/ui/components/MarkdownRenderer.d.ts +8 -0
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/ui/components/MarkdownRenderer.js +96 -0
- package/dist/ui/components/MarkdownRenderer.js.map +1 -0
- package/dist/ui/components/MessageBox.d.ts +10 -0
- package/dist/ui/components/MessageBox.d.ts.map +1 -0
- package/dist/ui/components/MessageBox.js +50 -0
- package/dist/ui/components/MessageBox.js.map +1 -0
- package/dist/ui/components/MessageDisplay.d.ts +8 -0
- package/dist/ui/components/MessageDisplay.d.ts.map +1 -0
- package/dist/ui/components/MessageDisplay.js +43 -0
- package/dist/ui/components/MessageDisplay.js.map +1 -0
- package/dist/ui/components/ScrollableContent.d.ts +7 -0
- package/dist/ui/components/ScrollableContent.d.ts.map +1 -0
- package/dist/ui/components/ScrollableContent.js +6 -0
- package/dist/ui/components/ScrollableContent.js.map +1 -0
- package/dist/ui/components/ScrollableMessageList.d.ts +10 -0
- package/dist/ui/components/ScrollableMessageList.d.ts.map +1 -0
- package/dist/ui/components/ScrollableMessageList.js +133 -0
- package/dist/ui/components/ScrollableMessageList.js.map +1 -0
- package/dist/ui/components/ScrollableScreen.d.ts +9 -0
- package/dist/ui/components/ScrollableScreen.d.ts.map +1 -0
- package/dist/ui/components/ScrollableScreen.js +22 -0
- package/dist/ui/components/ScrollableScreen.js.map +1 -0
- package/dist/ui/components/SelectPrompt.d.ts +12 -0
- package/dist/ui/components/SelectPrompt.d.ts.map +1 -0
- package/dist/ui/components/SelectPrompt.js +10 -0
- package/dist/ui/components/SelectPrompt.js.map +1 -0
- package/dist/ui/components/StaticMessageHistory.d.ts +14 -0
- package/dist/ui/components/StaticMessageHistory.d.ts.map +1 -0
- package/dist/ui/components/StaticMessageHistory.js +19 -0
- package/dist/ui/components/StaticMessageHistory.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +10 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +20 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/StreamingMessageDisplay.d.ts +13 -0
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -0
- package/dist/ui/components/StreamingMessageDisplay.js +26 -0
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -0
- package/dist/ui/components/ToolExecutionMessage.d.ts +8 -0
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -0
- package/dist/ui/components/ToolExecutionMessage.js +189 -0
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -0
- package/dist/ui/components/ToolExecutionStatus.d.ts +10 -0
- package/dist/ui/components/ToolExecutionStatus.d.ts.map +1 -0
- package/dist/ui/components/ToolExecutionStatus.js +65 -0
- package/dist/ui/components/ToolExecutionStatus.js.map +1 -0
- package/dist/ui/components/ToolResult.d.ts +10 -0
- package/dist/ui/components/ToolResult.d.ts.map +1 -0
- package/dist/ui/components/ToolResult.js +17 -0
- package/dist/ui/components/ToolResult.js.map +1 -0
- package/dist/ui/components/WelcomeBanner.d.ts +3 -0
- package/dist/ui/components/WelcomeBanner.d.ts.map +1 -0
- package/dist/ui/components/WelcomeBanner.js +28 -0
- package/dist/ui/components/WelcomeBanner.js.map +1 -0
- package/dist/ui/components/code-block.d.ts +10 -0
- package/dist/ui/components/code-block.d.ts.map +1 -0
- package/dist/ui/components/code-block.js +74 -0
- package/dist/ui/components/code-block.js.map +1 -0
- package/dist/ui/components/confirm-prompt.d.ts +12 -0
- package/dist/ui/components/confirm-prompt.d.ts.map +1 -0
- package/dist/ui/components/confirm-prompt.js +104 -0
- package/dist/ui/components/confirm-prompt.js.map +1 -0
- package/dist/ui/components/diff-viewer.d.ts +9 -0
- package/dist/ui/components/diff-viewer.d.ts.map +1 -0
- package/dist/ui/components/diff-viewer.js +57 -0
- package/dist/ui/components/diff-viewer.js.map +1 -0
- package/dist/ui/components/input-box.d.ts +18 -0
- package/dist/ui/components/input-box.d.ts.map +1 -0
- package/dist/ui/components/input-box.js +157 -0
- package/dist/ui/components/input-box.js.map +1 -0
- package/dist/ui/components/keyboard-help.d.ts +7 -0
- package/dist/ui/components/keyboard-help.d.ts.map +1 -0
- package/dist/ui/components/keyboard-help.js +43 -0
- package/dist/ui/components/keyboard-help.js.map +1 -0
- package/dist/ui/components/loading-indicator.d.ts +3 -0
- package/dist/ui/components/loading-indicator.d.ts.map +1 -0
- package/dist/ui/components/loading-indicator.js +42 -0
- package/dist/ui/components/loading-indicator.js.map +1 -0
- package/dist/ui/components/message-display.d.ts +7 -0
- package/dist/ui/components/message-display.d.ts.map +1 -0
- package/dist/ui/components/message-display.js +104 -0
- package/dist/ui/components/message-display.js.map +1 -0
- package/dist/ui/components/misc.d.ts +28 -0
- package/dist/ui/components/misc.d.ts.map +1 -0
- package/dist/ui/components/misc.js +128 -0
- package/dist/ui/components/misc.js.map +1 -0
- package/dist/ui/components/select-prompt.d.ts +13 -0
- package/dist/ui/components/select-prompt.d.ts.map +1 -0
- package/dist/ui/components/select-prompt.js +42 -0
- package/dist/ui/components/select-prompt.js.map +1 -0
- package/dist/ui/components/status-bar.d.ts +11 -0
- package/dist/ui/components/status-bar.d.ts.map +1 -0
- package/dist/ui/components/status-bar.js +47 -0
- package/dist/ui/components/status-bar.js.map +1 -0
- package/dist/ui/components/tool-execution.d.ts +3 -0
- package/dist/ui/components/tool-execution.d.ts.map +1 -0
- package/dist/ui/components/tool-execution.js +374 -0
- package/dist/ui/components/tool-execution.js.map +1 -0
- package/dist/ui/components/tool-result.d.ts +11 -0
- package/dist/ui/components/tool-result.d.ts.map +1 -0
- package/dist/ui/components/tool-result.js +58 -0
- package/dist/ui/components/tool-result.js.map +1 -0
- package/dist/ui/components/welcome-banner.d.ts +3 -0
- package/dist/ui/components/welcome-banner.d.ts.map +1 -0
- package/dist/ui/components/welcome-banner.js +46 -0
- package/dist/ui/components/welcome-banner.js.map +1 -0
- package/dist/ui/hooks/useDisplayHistory.d.ts +13 -0
- package/dist/ui/hooks/useDisplayHistory.d.ts.map +1 -0
- package/dist/ui/hooks/useDisplayHistory.js +45 -0
- package/dist/ui/hooks/useDisplayHistory.js.map +1 -0
- package/dist/ui/render-engine.d.ts +69 -0
- package/dist/ui/render-engine.d.ts.map +1 -0
- package/dist/ui/render-engine.js +197 -0
- package/dist/ui/render-engine.js.map +1 -0
- package/dist/ui/terminal/TerminalRenderer.d.ts +84 -0
- package/dist/ui/terminal/TerminalRenderer.d.ts.map +1 -0
- package/dist/ui/terminal/TerminalRenderer.js +154 -0
- package/dist/ui/terminal/TerminalRenderer.js.map +1 -0
- package/dist/ui/terminal/TerminalUI.d.ts +139 -0
- package/dist/ui/terminal/TerminalUI.d.ts.map +1 -0
- package/dist/ui/terminal/TerminalUI.js +430 -0
- package/dist/ui/terminal/TerminalUI.js.map +1 -0
- package/dist/ui/terminal/VirtualChatBuffer.d.ts +32 -0
- package/dist/ui/terminal/VirtualChatBuffer.d.ts.map +1 -0
- package/dist/ui/terminal/VirtualChatBuffer.js +37 -0
- package/dist/ui/terminal/VirtualChatBuffer.js.map +1 -0
- package/dist/ui/terminal-kit-base.d.ts +117 -0
- package/dist/ui/terminal-kit-base.d.ts.map +1 -0
- package/dist/ui/terminal-kit-base.js +188 -0
- package/dist/ui/terminal-kit-base.js.map +1 -0
- package/dist/utils/file.d.ts +21 -0
- package/dist/utils/file.d.ts.map +1 -0
- package/dist/utils/file.js +68 -0
- package/dist/utils/file.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +57 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown-parser.d.ts +56 -0
- package/dist/utils/markdown-parser.d.ts.map +1 -0
- package/dist/utils/markdown-parser.js +307 -0
- package/dist/utils/markdown-parser.js.map +1 -0
- package/dist/utils/shell.d.ts +7 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +62 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/state.d.ts +13 -0
- package/dist/utils/state.d.ts.map +1 -0
- package/dist/utils/state.js +25 -0
- package/dist/utils/state.js.map +1 -0
- package/package.json +81 -0
- 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
|
package/CONFIG_GUIDE.md
ADDED
|
@@ -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.
|