centaurus-cli 2.0.1 → 2.1.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/CONFIG_GUIDE.md +100 -106
- package/README.md +68 -63
- package/dist/cli-adapter.d.ts +9 -3
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +175 -164
- package/dist/cli-adapter.js.map +1 -1
- package/dist/commands/CommandParser.d.ts +1 -1
- package/dist/commands/CommandParser.d.ts.map +1 -1
- package/dist/commands/CommandParser.js +3 -18
- package/dist/commands/CommandParser.js.map +1 -1
- package/dist/commands/view-duplication-logs.d.ts +5 -0
- package/dist/commands/view-duplication-logs.d.ts.map +1 -0
- package/dist/commands/view-duplication-logs.js +14 -0
- package/dist/commands/view-duplication-logs.js.map +1 -0
- package/dist/config/ConfigManager.d.ts +10 -7
- package/dist/config/ConfigManager.d.ts.map +1 -1
- package/dist/config/ConfigManager.js +43 -142
- package/dist/config/ConfigManager.js.map +1 -1
- package/dist/config/defaultConfig.d.ts +0 -4
- package/dist/config/defaultConfig.d.ts.map +1 -1
- package/dist/config/defaultConfig.js +1 -6
- package/dist/config/defaultConfig.js.map +1 -1
- package/dist/config/manager.d.ts +15 -13
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +52 -41
- package/dist/config/manager.js.map +1 -1
- package/dist/config/models.d.ts +31 -0
- package/dist/config/models.d.ts.map +1 -0
- package/dist/config/models.js +49 -0
- package/dist/config/models.js.map +1 -0
- package/dist/config/types.d.ts +0 -3
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +0 -1
- package/dist/config/types.js.map +1 -1
- package/dist/index.js +48 -8
- package/dist/index.js.map +1 -1
- package/dist/prompts/system-prompt.d.ts +1 -1
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +0 -1
- package/dist/prompts/system-prompt.js.map +1 -1
- package/dist/services/ai-service-client.d.ts +87 -0
- package/dist/services/ai-service-client.d.ts.map +1 -0
- package/dist/services/ai-service-client.js +268 -0
- package/dist/services/ai-service-client.js.map +1 -0
- package/dist/services/api-client.d.ts +5 -0
- package/dist/services/api-client.d.ts.map +1 -1
- package/dist/services/api-client.js +72 -59
- package/dist/services/api-client.js.map +1 -1
- package/dist/services/auth-handler.js +2 -2
- package/dist/services/auth-handler.js.map +1 -1
- package/dist/tools/ToolRegistry.d.ts +14 -3
- package/dist/tools/ToolRegistry.d.ts.map +1 -1
- package/dist/tools/ToolRegistry.js +46 -34
- package/dist/tools/ToolRegistry.js.map +1 -1
- package/dist/tools/command.d.ts.map +1 -1
- package/dist/tools/command.js +17 -3
- package/dist/tools/command.js.map +1 -1
- package/dist/tools/file-ops.js +3 -3
- package/dist/tools/file-ops.js.map +1 -1
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +6 -2
- package/dist/tools/web-search.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/ui/components/App.d.ts +3 -2
- package/dist/ui/components/App.d.ts.map +1 -1
- package/dist/ui/components/App.js +107 -16
- package/dist/ui/components/App.js.map +1 -1
- package/dist/ui/components/CodeBlock.d.ts.map +1 -1
- package/dist/ui/components/CodeBlock.js +15 -3
- package/dist/ui/components/CodeBlock.js.map +1 -1
- package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -1
- package/dist/ui/components/ConfirmPrompt.js +32 -20
- package/dist/ui/components/ConfirmPrompt.js.map +1 -1
- package/dist/ui/components/DiffViewer.d.ts.map +1 -1
- package/dist/ui/components/DiffViewer.js +16 -2
- package/dist/ui/components/DiffViewer.js.map +1 -1
- package/dist/ui/components/InputBox.d.ts.map +1 -1
- package/dist/ui/components/InputBox.js +26 -9
- package/dist/ui/components/InputBox.js.map +1 -1
- package/dist/ui/components/LoadingIndicator.d.ts.map +1 -1
- package/dist/ui/components/LoadingIndicator.js +6 -2
- package/dist/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/ui/components/MarkdownRenderer.js +8 -12
- package/dist/ui/components/MarkdownRenderer.js.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.d.ts +6 -7
- package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
- package/dist/ui/components/StreamingMessageDisplay.js +69 -12
- package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
- package/dist/ui/components/ToolExecutionMessage.js +44 -16
- package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
- package/dist/ui/components/WelcomeBanner.d.ts.map +1 -1
- package/dist/ui/components/WelcomeBanner.js.map +1 -1
- package/dist/ui/utils/duplication-detector.d.ts +32 -0
- package/dist/ui/utils/duplication-detector.d.ts.map +1 -0
- package/dist/ui/utils/duplication-detector.js +227 -0
- package/dist/ui/utils/duplication-detector.js.map +1 -0
- package/dist/ui/utils/duplication-logger.d.ts +21 -0
- package/dist/ui/utils/duplication-logger.d.ts.map +1 -0
- package/dist/ui/utils/duplication-logger.js +85 -0
- package/dist/ui/utils/duplication-logger.js.map +1 -0
- package/dist/ui/utils/terminal-scanner.d.ts +19 -0
- package/dist/ui/utils/terminal-scanner.d.ts.map +1 -0
- package/dist/ui/utils/terminal-scanner.js +217 -0
- package/dist/ui/utils/terminal-scanner.js.map +1 -0
- package/package.json +2 -5
package/CONFIG_GUIDE.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
5
|
The Centaurus CLI stores configuration in two places:
|
|
6
|
-
1. **Environment variables** (`.env` file) - Backend API URL
|
|
7
|
-
2. **User config file** (`~/.centaurus/config.json`) -
|
|
6
|
+
1. **Environment variables** (`.env` file) - Backend API URL (required)
|
|
7
|
+
2. **User config file** (`~/.centaurus/config.json`) - Model preferences and settings
|
|
8
|
+
|
|
9
|
+
**Important:** API keys are no longer stored in the CLI. All AI model access is managed by the backend service for security and centralized control.
|
|
8
10
|
|
|
9
11
|
## Initial Setup
|
|
10
12
|
|
|
11
|
-
### 1. Backend API Configuration
|
|
13
|
+
### 1. Backend API Configuration (Required)
|
|
12
14
|
|
|
13
15
|
Create or update `.env` file in the CLI directory:
|
|
14
16
|
|
|
@@ -21,21 +23,22 @@ For production, update to your backend URL:
|
|
|
21
23
|
BACKEND_API_URL=https://api.yourapp.com/api
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
|
|
26
|
+
**Important:** The backend URL is required for all AI features. The CLI cannot function without a connection to the backend service.
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
### 2. Authentication (Required)
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
# Google AI (Gemini)
|
|
30
|
-
/config set googleApiKey YOUR_GOOGLE_API_KEY
|
|
30
|
+
When you first run the CLI, you'll be prompted to sign in with Google:
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
1. Start Centaurus: `centaurus`
|
|
33
|
+
2. Choose "Yes" when prompted to sign in
|
|
34
|
+
3. Complete the authentication flow in your browser
|
|
35
|
+
4. Return to the CLI and start chatting!
|
|
35
36
|
|
|
36
|
-
**
|
|
37
|
-
-
|
|
38
|
-
-
|
|
37
|
+
**Why Authentication?**
|
|
38
|
+
- Secures access to AI models
|
|
39
|
+
- Enables conversation history sync
|
|
40
|
+
- Prevents unauthorized usage
|
|
41
|
+
- No local API key management needed
|
|
39
42
|
|
|
40
43
|
## Configuration Commands
|
|
41
44
|
|
|
@@ -46,37 +49,10 @@ Configure your API keys using slash commands in the CLI:
|
|
|
46
49
|
```
|
|
47
50
|
|
|
48
51
|
Shows:
|
|
49
|
-
- Current provider (google/openrouter)
|
|
50
52
|
- Current model
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
```
|
|
53
|
+
- Theme settings
|
|
54
|
+
- Auto-accept preferences
|
|
55
|
+
- Plan mode status
|
|
80
56
|
|
|
81
57
|
### Change Model
|
|
82
58
|
|
|
@@ -84,35 +60,32 @@ Or set directly:
|
|
|
84
60
|
/model
|
|
85
61
|
```
|
|
86
62
|
|
|
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-
|
|
92
|
-
- gemini-1.5-
|
|
93
|
-
- gemini-1.5-flash
|
|
63
|
+
Opens a picker to select from available Google Gemini models:
|
|
64
|
+
- **gemini-2.5-flash** - Fast and efficient (recommended)
|
|
65
|
+
- **gemini-2.5-pro** - Most capable, slower
|
|
66
|
+
- **gemini-2.0-flash-exp** - Experimental features
|
|
67
|
+
- **gemini-1.5-pro** - Previous generation, high quality
|
|
68
|
+
- **gemini-1.5-flash** - Previous generation, fast
|
|
94
69
|
|
|
95
70
|
Or set directly:
|
|
96
71
|
```bash
|
|
97
72
|
/model gemini-2.5-flash
|
|
98
73
|
```
|
|
99
74
|
|
|
100
|
-
|
|
75
|
+
Your model preference is saved and persists across sessions.
|
|
76
|
+
|
|
77
|
+
## Authentication
|
|
101
78
|
|
|
102
|
-
### Sign In
|
|
79
|
+
### Sign In (Required)
|
|
103
80
|
|
|
104
|
-
When you first run the CLI, you'll be prompted to sign in with Google
|
|
81
|
+
Authentication is required to use Centaurus CLI. When you first run the CLI, you'll be prompted to sign in with Google:
|
|
105
82
|
|
|
106
|
-
**
|
|
83
|
+
**What You Get:**
|
|
84
|
+
- ✅ Secure access to AI models
|
|
107
85
|
- ✅ Conversation history across devices
|
|
108
86
|
- ✅ Settings synchronization
|
|
109
|
-
- ✅
|
|
110
|
-
|
|
111
|
-
**Offline Mode:**
|
|
112
|
-
- ✅ All AI features work
|
|
113
|
-
- ✅ Local conversation history
|
|
114
|
-
- ❌ No sync across devices
|
|
115
|
-
- ❌ No web search (requires backend)
|
|
87
|
+
- ✅ Web search capabilities
|
|
88
|
+
- ✅ No local API key management
|
|
116
89
|
|
|
117
90
|
### Sign Out
|
|
118
91
|
|
|
@@ -120,7 +93,7 @@ When you first run the CLI, you'll be prompted to sign in with Google for cloud
|
|
|
120
93
|
/logout
|
|
121
94
|
```
|
|
122
95
|
|
|
123
|
-
Clears your session and exits the CLI. You'll need to
|
|
96
|
+
Clears your session and exits the CLI. You'll need to sign in again the next time you start the CLI.
|
|
124
97
|
|
|
125
98
|
## Configuration File Location
|
|
126
99
|
|
|
@@ -132,59 +105,83 @@ Your configuration is stored at:
|
|
|
132
105
|
|
|
133
106
|
```json
|
|
134
107
|
{
|
|
135
|
-
"provider": "google",
|
|
136
108
|
"model": "gemini-2.5-flash",
|
|
137
|
-
"googleApiKey": "encrypted_key_here",
|
|
138
|
-
"openrouterApiKey": "encrypted_key_here",
|
|
139
109
|
"theme": "default",
|
|
140
|
-
"autoAccept": false
|
|
110
|
+
"autoAccept": false,
|
|
111
|
+
"planMode": false
|
|
141
112
|
}
|
|
142
113
|
```
|
|
143
114
|
|
|
144
|
-
**Note:** API keys are
|
|
115
|
+
**Note:** API keys are no longer stored in the CLI configuration. They are managed by the backend service.
|
|
145
116
|
|
|
146
|
-
## Web Search
|
|
117
|
+
## Web Search
|
|
147
118
|
|
|
148
119
|
Web search is handled by the backend and requires:
|
|
149
120
|
1. Authentication (sign in with Google)
|
|
150
|
-
2. Backend server running with Serper API key
|
|
121
|
+
2. Backend server running with Serper API key configured
|
|
151
122
|
|
|
152
123
|
**No client-side configuration needed!**
|
|
153
124
|
|
|
154
|
-
The backend administrator
|
|
125
|
+
The backend administrator manages the Serper API key server-side.
|
|
155
126
|
|
|
156
127
|
## Troubleshooting
|
|
157
128
|
|
|
158
|
-
### "
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
# Check current config
|
|
162
|
-
/config
|
|
163
|
-
|
|
164
|
-
# Set the appropriate API key
|
|
165
|
-
/config set googleApiKey YOUR_KEY
|
|
166
|
-
```
|
|
129
|
+
### "Authentication required"
|
|
167
130
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Web search requires signing in:
|
|
131
|
+
All AI features require authentication. To sign in:
|
|
171
132
|
1. Restart the CLI
|
|
172
133
|
2. Choose "Yes" when prompted to sign in
|
|
173
|
-
3. Complete Google OAuth flow
|
|
134
|
+
3. Complete the Google OAuth flow in your browser
|
|
135
|
+
4. Return to the CLI
|
|
174
136
|
|
|
175
137
|
### "Backend API is not reachable"
|
|
176
138
|
|
|
177
|
-
|
|
139
|
+
This error means the CLI cannot connect to the backend service.
|
|
140
|
+
|
|
141
|
+
**Check your `.env` file:**
|
|
178
142
|
```env
|
|
179
143
|
BACKEND_API_URL=http://localhost:3000/api
|
|
180
144
|
```
|
|
181
145
|
|
|
182
|
-
Verify backend is running
|
|
146
|
+
**Verify backend is running:**
|
|
183
147
|
```bash
|
|
184
148
|
cd backend
|
|
185
149
|
npm start
|
|
186
150
|
```
|
|
187
151
|
|
|
152
|
+
**Common causes:**
|
|
153
|
+
- Backend service is not running
|
|
154
|
+
- Incorrect backend URL in `.env`
|
|
155
|
+
- Network connectivity issues
|
|
156
|
+
- Firewall blocking the connection
|
|
157
|
+
- Backend is deployed but not accessible from your network
|
|
158
|
+
|
|
159
|
+
**For production deployments:**
|
|
160
|
+
Ensure the backend URL points to your deployed backend:
|
|
161
|
+
```env
|
|
162
|
+
BACKEND_API_URL=https://api.yourapp.com/api
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### "Rate limit exceeded"
|
|
166
|
+
|
|
167
|
+
The backend has exhausted its API quota with Google. This is managed by the backend administrator.
|
|
168
|
+
|
|
169
|
+
**What to do:**
|
|
170
|
+
- Wait a few moments and try again
|
|
171
|
+
- Contact your backend administrator if the issue persists
|
|
172
|
+
- The backend may need additional API keys configured for rotation
|
|
173
|
+
|
|
174
|
+
### "Invalid model"
|
|
175
|
+
|
|
176
|
+
The model you selected is not supported by the backend.
|
|
177
|
+
|
|
178
|
+
**Solution:**
|
|
179
|
+
```bash
|
|
180
|
+
/model
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Select a valid Google Gemini model from the list.
|
|
184
|
+
|
|
188
185
|
### Reset Configuration
|
|
189
186
|
|
|
190
187
|
To start fresh, delete the config file:
|
|
@@ -199,28 +196,18 @@ del %USERPROFILE%\.centaurus\config.json
|
|
|
199
196
|
rm ~/.centaurus/config.json
|
|
200
197
|
```
|
|
201
198
|
|
|
202
|
-
Then restart the CLI and reconfigure.
|
|
199
|
+
Then restart the CLI. You'll need to sign in again and reconfigure your preferences.
|
|
203
200
|
|
|
204
201
|
## Security Best Practices
|
|
205
202
|
|
|
206
203
|
1. **Never commit `.env` files** - Add to `.gitignore`
|
|
207
|
-
2. **
|
|
208
|
-
3. **
|
|
209
|
-
4. **
|
|
210
|
-
5. **
|
|
204
|
+
2. **Use environment-specific URLs** - Different URLs for dev/prod
|
|
205
|
+
3. **Sign out on shared machines** - Use `/logout` command
|
|
206
|
+
4. **Keep your session secure** - Don't share authentication tokens
|
|
207
|
+
5. **Backend security** - API keys are managed server-side for enhanced security
|
|
211
208
|
|
|
212
209
|
## Advanced Configuration
|
|
213
210
|
|
|
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
211
|
### Custom Backend URL
|
|
225
212
|
|
|
226
213
|
For development or self-hosted backends:
|
|
@@ -235,6 +222,12 @@ For production:
|
|
|
235
222
|
BACKEND_API_URL=https://api.centaurus.app/api
|
|
236
223
|
```
|
|
237
224
|
|
|
225
|
+
**Backend Requirements:**
|
|
226
|
+
- Must be configured with Google API keys (managed by backend admin)
|
|
227
|
+
- Must support the `/api/ai/chat` endpoint for streaming
|
|
228
|
+
- Must handle authentication and session management
|
|
229
|
+
- Should implement API key rotation for rate limit handling
|
|
230
|
+
|
|
238
231
|
## Getting Help
|
|
239
232
|
|
|
240
233
|
```bash
|
|
@@ -245,11 +238,12 @@ Shows all available commands and their usage.
|
|
|
245
238
|
|
|
246
239
|
## Next Steps
|
|
247
240
|
|
|
248
|
-
1.
|
|
249
|
-
2.
|
|
250
|
-
3.
|
|
251
|
-
4.
|
|
241
|
+
1. Ensure backend is running and accessible
|
|
242
|
+
2. Configure backend URL in `.env`
|
|
243
|
+
3. Sign in with Google (required)
|
|
244
|
+
4. Choose your preferred model
|
|
245
|
+
5. Start chatting with the AI!
|
|
252
246
|
|
|
253
247
|
For more information, see:
|
|
254
248
|
- [README.md](./README.md) - General CLI documentation
|
|
255
|
-
- [
|
|
249
|
+
- [MIGRATION.md](./MIGRATION.md) - Upgrading from previous versions
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Centaurus CLI
|
|
2
2
|
|
|
3
|
-
> A powerful command-line AI coding assistant
|
|
3
|
+
> A powerful command-line AI coding assistant powered by Google Gemini
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/centaurus-cli)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
✨ **AI-Powered Coding Assistant**
|
|
12
12
|
- Support for Google Gemini (2.5 Flash, 2.5 Pro, 2.0 Flash, and more)
|
|
13
|
-
- OpenRouter integration for access to multiple AI models
|
|
14
13
|
- Intelligent code generation and editing
|
|
15
14
|
- Context-aware file operations
|
|
16
15
|
|
|
@@ -28,11 +27,11 @@
|
|
|
28
27
|
- Real-time streaming responses
|
|
29
28
|
- Markdown rendering
|
|
30
29
|
|
|
31
|
-
☁️ **Cloud Sync**
|
|
30
|
+
☁️ **Cloud Sync**
|
|
32
31
|
- Conversation history across devices
|
|
33
32
|
- Settings synchronization
|
|
34
|
-
- Encrypted API key storage
|
|
35
33
|
- Seamless authentication with Google
|
|
34
|
+
- Secure backend-managed AI access
|
|
36
35
|
|
|
37
36
|
## Installation
|
|
38
37
|
|
|
@@ -57,35 +56,28 @@ npx centaurus
|
|
|
57
56
|
|
|
58
57
|
## Quick Start
|
|
59
58
|
|
|
60
|
-
### 1.
|
|
59
|
+
### 1. Prerequisites
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
centaurus
|
|
66
|
-
```
|
|
61
|
+
Before using Centaurus CLI, ensure the backend service is running and accessible. The backend handles all AI model interactions.
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
**Backend Setup:**
|
|
64
|
+
- The backend must be deployed and configured with Google API keys
|
|
65
|
+
- Set the backend URL in your `.env` file (see Configuration section)
|
|
66
|
+
- Default: `http://localhost:3000/api`
|
|
69
67
|
|
|
70
|
-
### 2.
|
|
68
|
+
### 2. First Launch
|
|
71
69
|
|
|
72
|
-
|
|
70
|
+
When you first run Centaurus, you'll see a beautiful welcome screen:
|
|
73
71
|
|
|
74
72
|
```bash
|
|
75
|
-
|
|
76
|
-
/config set googleApiKey YOUR_GOOGLE_API_KEY
|
|
77
|
-
|
|
78
|
-
# For OpenRouter
|
|
79
|
-
/config set openrouterApiKey YOUR_OPENROUTER_API_KEY
|
|
73
|
+
centaurus
|
|
80
74
|
```
|
|
81
75
|
|
|
82
|
-
**
|
|
83
|
-
- Google AI Studio: https://makersuite.google.com/app/apikey
|
|
84
|
-
- OpenRouter: https://openrouter.ai/keys
|
|
76
|
+
You'll be prompted to sign in with Google. **Authentication is required** to use AI features.
|
|
85
77
|
|
|
86
78
|
### 3. Start Chatting
|
|
87
79
|
|
|
88
|
-
|
|
80
|
+
Once authenticated, just type your message and press Enter:
|
|
89
81
|
|
|
90
82
|
```
|
|
91
83
|
> Create a React component for a todo list
|
|
@@ -97,20 +89,24 @@ The AI will help you with code generation, file operations, and more!
|
|
|
97
89
|
|
|
98
90
|
### Environment Setup
|
|
99
91
|
|
|
100
|
-
Create a `.env` file in your project
|
|
92
|
+
Create a `.env` file in your project directory:
|
|
101
93
|
|
|
102
94
|
```env
|
|
103
|
-
# Backend API URL (for
|
|
95
|
+
# Backend API URL (required for all AI features)
|
|
104
96
|
BACKEND_API_URL=http://localhost:3000/api
|
|
105
97
|
```
|
|
106
98
|
|
|
99
|
+
**Important:** The backend URL is required for the CLI to function. All AI model calls are proxied through the backend service.
|
|
100
|
+
|
|
107
101
|
### User Configuration
|
|
108
102
|
|
|
109
103
|
Your settings are stored in `~/.centaurus/config.json`:
|
|
110
|
-
-
|
|
111
|
-
- Preferred model and provider
|
|
104
|
+
- Preferred model
|
|
112
105
|
- Theme settings
|
|
113
106
|
- Auto-accept preferences
|
|
107
|
+
- Plan mode settings
|
|
108
|
+
|
|
109
|
+
**Note:** API keys are no longer stored in the CLI. They are managed centrally by the backend service.
|
|
114
110
|
|
|
115
111
|
## Commands
|
|
116
112
|
|
|
@@ -119,9 +115,7 @@ Your settings are stored in `~/.centaurus/config.json`:
|
|
|
119
115
|
```bash
|
|
120
116
|
/help # Show all commands
|
|
121
117
|
/config # View current configuration
|
|
122
|
-
/config set <key> <value> # Set configuration value
|
|
123
118
|
/model # Select AI model
|
|
124
|
-
/provider # Select AI provider
|
|
125
119
|
/plan # Toggle plan mode
|
|
126
120
|
/clear # Clear conversation history
|
|
127
121
|
/logout # Sign out and exit
|
|
@@ -131,17 +125,14 @@ Your settings are stored in `~/.centaurus/config.json`:
|
|
|
131
125
|
### Examples
|
|
132
126
|
|
|
133
127
|
```bash
|
|
134
|
-
# Set API key
|
|
135
|
-
/config set googleApiKey AIzaSy...
|
|
136
|
-
|
|
137
128
|
# Change model
|
|
138
129
|
/model gemini-2.5-flash
|
|
139
130
|
|
|
140
|
-
# Switch provider
|
|
141
|
-
/provider openrouter
|
|
142
|
-
|
|
143
131
|
# Enable plan mode for complex tasks
|
|
144
132
|
/plan
|
|
133
|
+
|
|
134
|
+
# Clear conversation history
|
|
135
|
+
/clear
|
|
145
136
|
```
|
|
146
137
|
|
|
147
138
|
## Features in Detail
|
|
@@ -196,49 +187,47 @@ For complex tasks, enable plan mode to see the implementation plan before execut
|
|
|
196
187
|
|
|
197
188
|
The AI will create a detailed plan and ask for approval before implementing.
|
|
198
189
|
|
|
199
|
-
##
|
|
190
|
+
## Authentication
|
|
200
191
|
|
|
201
|
-
### Sign In
|
|
192
|
+
### Sign In (Required)
|
|
202
193
|
|
|
203
|
-
|
|
194
|
+
Authentication with Google is required to use Centaurus CLI:
|
|
204
195
|
|
|
205
196
|
1. Start Centaurus
|
|
206
197
|
2. Select "Sign in with Google"
|
|
207
198
|
3. Complete authentication in browser
|
|
208
|
-
4.
|
|
199
|
+
4. Start using AI features!
|
|
209
200
|
|
|
210
201
|
### Features
|
|
211
202
|
|
|
212
203
|
- **Conversation History**: Access your chats from any device
|
|
213
204
|
- **Settings Sync**: Your preferences follow you everywhere
|
|
214
|
-
- **
|
|
205
|
+
- **Secure AI Access**: Backend-managed API keys for security
|
|
215
206
|
- **Web Search**: Powered by backend API
|
|
216
207
|
|
|
217
|
-
###
|
|
208
|
+
### Backend Connectivity
|
|
218
209
|
|
|
219
|
-
|
|
220
|
-
- All AI
|
|
221
|
-
-
|
|
222
|
-
-
|
|
210
|
+
Centaurus CLI requires a connection to the backend service:
|
|
211
|
+
- All AI model calls are proxied through the backend
|
|
212
|
+
- Authentication tokens are validated by the backend
|
|
213
|
+
- Ensures secure and centralized API key management
|
|
214
|
+
- No local API key storage required
|
|
223
215
|
|
|
224
216
|
## Advanced Usage
|
|
225
217
|
|
|
226
|
-
### Multiple API Keys
|
|
227
|
-
|
|
228
|
-
Configure multiple API keys for automatic rotation:
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
/config set googleApiKey key1,key2,key3
|
|
232
|
-
```
|
|
233
|
-
|
|
234
218
|
### Custom Backend
|
|
235
219
|
|
|
236
|
-
Set up your own backend
|
|
220
|
+
Set up your own backend instance:
|
|
237
221
|
|
|
238
222
|
```env
|
|
239
223
|
BACKEND_API_URL=https://your-backend.com/api
|
|
240
224
|
```
|
|
241
225
|
|
|
226
|
+
**Backend Requirements:**
|
|
227
|
+
- Must be configured with Google API keys
|
|
228
|
+
- Must support the `/api/ai/chat` endpoint
|
|
229
|
+
- Must handle authentication and session management
|
|
230
|
+
|
|
242
231
|
### Keyboard Shortcuts
|
|
243
232
|
|
|
244
233
|
- `Ctrl+C` - Cancel current operation
|
|
@@ -248,25 +237,37 @@ BACKEND_API_URL=https://your-backend.com/api
|
|
|
248
237
|
|
|
249
238
|
## Troubleshooting
|
|
250
239
|
|
|
251
|
-
### "
|
|
252
|
-
|
|
253
|
-
Configure your API key:
|
|
254
|
-
```bash
|
|
255
|
-
/config set googleApiKey YOUR_KEY
|
|
256
|
-
```
|
|
240
|
+
### "Authentication required"
|
|
257
241
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
242
|
+
Sign in with Google:
|
|
243
|
+
1. Restart the CLI
|
|
244
|
+
2. Choose "Yes" when prompted to sign in
|
|
245
|
+
3. Complete the authentication flow in your browser
|
|
261
246
|
|
|
262
247
|
### "Backend API is not reachable"
|
|
263
248
|
|
|
264
249
|
Check your `.env` file and ensure the backend is running:
|
|
250
|
+
|
|
251
|
+
```env
|
|
252
|
+
BACKEND_API_URL=http://localhost:3000/api
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Verify backend is running:
|
|
265
256
|
```bash
|
|
266
257
|
cd backend
|
|
267
258
|
npm start
|
|
268
259
|
```
|
|
269
260
|
|
|
261
|
+
**Common Issues:**
|
|
262
|
+
- Backend service is not running
|
|
263
|
+
- Incorrect backend URL in `.env`
|
|
264
|
+
- Network connectivity issues
|
|
265
|
+
- Firewall blocking the connection
|
|
266
|
+
|
|
267
|
+
### "Rate limit exceeded"
|
|
268
|
+
|
|
269
|
+
The backend has exhausted its API quota. This is managed by the backend administrator. Wait a few moments and try again.
|
|
270
|
+
|
|
270
271
|
### Reset Configuration
|
|
271
272
|
|
|
272
273
|
Delete the config file to start fresh:
|
|
@@ -281,11 +282,15 @@ del %USERPROFILE%\.centaurus\config.json
|
|
|
281
282
|
rm ~/.centaurus/config.json
|
|
282
283
|
```
|
|
283
284
|
|
|
285
|
+
**Note:** This will clear your model preferences and settings, but you'll need to re-authenticate.
|
|
286
|
+
|
|
284
287
|
## Requirements
|
|
285
288
|
|
|
286
289
|
- Node.js >= 18.0.0
|
|
287
290
|
- npm or yarn
|
|
288
291
|
- Terminal with color support
|
|
292
|
+
- **Backend service running and accessible**
|
|
293
|
+
- **Google account for authentication**
|
|
289
294
|
|
|
290
295
|
## Development
|
|
291
296
|
|
|
@@ -338,7 +343,7 @@ MIT © [Your Name]
|
|
|
338
343
|
## Acknowledgments
|
|
339
344
|
|
|
340
345
|
- Built with [Ink](https://github.com/vadimdemedes/ink) - React for CLIs
|
|
341
|
-
- Powered by [Google Gemini](https://ai.google.dev/)
|
|
346
|
+
- Powered by [Google Gemini](https://ai.google.dev/)
|
|
342
347
|
- Inspired by modern AI coding assistants
|
|
343
348
|
|
|
344
349
|
---
|
package/dist/cli-adapter.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export declare class CentaurusCLI {
|
|
|
3
3
|
private toolRegistry;
|
|
4
4
|
private conversationHistory;
|
|
5
5
|
private systemPrompt;
|
|
6
|
-
private aiProvider;
|
|
7
6
|
private cwd;
|
|
8
7
|
private planMode;
|
|
9
8
|
private onResponseCallback?;
|
|
9
|
+
private onResponseStreamCallback?;
|
|
10
10
|
private onShowPickerCallback?;
|
|
11
11
|
private onToolExecutionUpdate?;
|
|
12
12
|
private onToolApprovalRequest?;
|
|
@@ -16,13 +16,14 @@ export declare class CentaurusCLI {
|
|
|
16
16
|
private conversationStarted;
|
|
17
17
|
constructor();
|
|
18
18
|
setOnResponseCallback(callback: (message: string) => void): void;
|
|
19
|
+
setOnResponseStreamCallback(callback: (chunk: string) => void): void;
|
|
19
20
|
setOnShowPickerCallback(callback: (options: {
|
|
20
21
|
message: string;
|
|
21
22
|
choices: Array<{
|
|
22
23
|
label: string;
|
|
23
24
|
value: string;
|
|
24
25
|
}>;
|
|
25
|
-
type: 'model'
|
|
26
|
+
type: 'model';
|
|
26
27
|
}) => void): void;
|
|
27
28
|
setOnToolExecutionUpdate(callback: (update: {
|
|
28
29
|
toolName: string;
|
|
@@ -53,8 +54,13 @@ export declare class CentaurusCLI {
|
|
|
53
54
|
question: string;
|
|
54
55
|
}) => Promise<boolean>): void;
|
|
55
56
|
getPlanMode(): boolean;
|
|
56
|
-
handlePickerSelection(selection: string, pickerType: 'model'
|
|
57
|
+
handlePickerSelection(selection: string, pickerType: 'model'): Promise<void>;
|
|
57
58
|
initialize(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Get migration message if configuration was migrated
|
|
61
|
+
* Returns null if no migration occurred
|
|
62
|
+
*/
|
|
63
|
+
getMigrationMessage(): string | null;
|
|
58
64
|
/**
|
|
59
65
|
* Check if user is authenticated
|
|
60
66
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-adapter.d.ts","sourceRoot":"","sources":["../src/cli-adapter.ts"],"names":[],"mappings":"AAkBA,qBAAa,YAAY;IACvB,OAAO,C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