@codemieai/code 0.0.1
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/.claude/agents/README.md +298 -0
- package/.claude/agents/release-manager.md +857 -0
- package/CLAUDE.md +856 -0
- package/LICENSE +201 -0
- package/README.md +917 -0
- package/bin/codemie-code.js +23 -0
- package/bin/codemie.js +8 -0
- package/dist/agents/adapters/aider.d.ts +12 -0
- package/dist/agents/adapters/aider.d.ts.map +1 -0
- package/dist/agents/adapters/aider.js +80 -0
- package/dist/agents/adapters/aider.js.map +1 -0
- package/dist/agents/adapters/claude-code.d.ts +12 -0
- package/dist/agents/adapters/claude-code.d.ts.map +1 -0
- package/dist/agents/adapters/claude-code.js +98 -0
- package/dist/agents/adapters/claude-code.js.map +1 -0
- package/dist/agents/adapters/codemie-code.d.ts +12 -0
- package/dist/agents/adapters/codemie-code.d.ts.map +1 -0
- package/dist/agents/adapters/codemie-code.js +42 -0
- package/dist/agents/adapters/codemie-code.js.map +1 -0
- package/dist/agents/adapters/codex.d.ts +12 -0
- package/dist/agents/adapters/codex.d.ts.map +1 -0
- package/dist/agents/adapters/codex.js +80 -0
- package/dist/agents/adapters/codex.js.map +1 -0
- package/dist/agents/registry.d.ts +18 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +35 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/cli/cli.d.ts +4 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +107 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +3 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +128 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/install.d.ts +3 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +76 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/commands/list.d.ts +3 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +50 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +3 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +459 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/run.d.ts +3 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +41 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/uninstall.d.ts +3 -0
- package/dist/cli/commands/uninstall.d.ts.map +1 -0
- package/dist/cli/commands/uninstall.js +71 -0
- package/dist/cli/commands/uninstall.js.map +1 -0
- package/dist/cli/commands/version.d.ts +3 -0
- package/dist/cli/commands/version.d.ts.map +1 -0
- package/dist/cli/commands/version.js +28 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/code/agent-events.d.ts +39 -0
- package/dist/code/agent-events.d.ts.map +1 -0
- package/dist/code/agent-events.js +4 -0
- package/dist/code/agent-events.js.map +1 -0
- package/dist/code/agent.d.ts +19 -0
- package/dist/code/agent.d.ts.map +1 -0
- package/dist/code/agent.js +144 -0
- package/dist/code/agent.js.map +1 -0
- package/dist/code/config.d.ts +13 -0
- package/dist/code/config.d.ts.map +1 -0
- package/dist/code/config.js +41 -0
- package/dist/code/config.js.map +1 -0
- package/dist/code/index.d.ts +19 -0
- package/dist/code/index.d.ts.map +1 -0
- package/dist/code/index.js +400 -0
- package/dist/code/index.js.map +1 -0
- package/dist/code/prompts.d.ts +2 -0
- package/dist/code/prompts.d.ts.map +1 -0
- package/dist/code/prompts.js +45 -0
- package/dist/code/prompts.js.map +1 -0
- package/dist/code/tools/command.d.ts +8 -0
- package/dist/code/tools/command.d.ts.map +1 -0
- package/dist/code/tools/command.js +83 -0
- package/dist/code/tools/command.js.map +1 -0
- package/dist/code/tools/diff-utils.d.ts +2 -0
- package/dist/code/tools/diff-utils.d.ts.map +1 -0
- package/dist/code/tools/diff-utils.js +45 -0
- package/dist/code/tools/diff-utils.js.map +1 -0
- package/dist/code/tools/filesystem.d.ts +11 -0
- package/dist/code/tools/filesystem.d.ts.map +1 -0
- package/dist/code/tools/filesystem.js +442 -0
- package/dist/code/tools/filesystem.js.map +1 -0
- package/dist/code/tools/git.d.ts +7 -0
- package/dist/code/tools/git.d.ts.map +1 -0
- package/dist/code/tools/git.js +111 -0
- package/dist/code/tools/git.js.map +1 -0
- package/dist/code/tools/mcp.d.ts +13 -0
- package/dist/code/tools/mcp.d.ts.map +1 -0
- package/dist/code/tools/mcp.js +230 -0
- package/dist/code/tools/mcp.js.map +1 -0
- package/dist/data/tips.json +118 -0
- package/dist/env/manager.d.ts +14 -0
- package/dist/env/manager.d.ts.map +1 -0
- package/dist/env/manager.js +99 -0
- package/dist/env/manager.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/ui/terminal-ui.d.ts +73 -0
- package/dist/ui/terminal-ui.d.ts.map +1 -0
- package/dist/ui/terminal-ui.js +900 -0
- package/dist/ui/terminal-ui.js.map +1 -0
- package/dist/utils/async-tips.d.ts +64 -0
- package/dist/utils/async-tips.d.ts.map +1 -0
- package/dist/utils/async-tips.js +242 -0
- package/dist/utils/async-tips.js.map +1 -0
- package/dist/utils/env-mapper.d.ts +40 -0
- package/dist/utils/env-mapper.d.ts.map +1 -0
- package/dist/utils/env-mapper.js +122 -0
- package/dist/utils/env-mapper.js.map +1 -0
- package/dist/utils/errors.d.ts +25 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +58 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/exec.d.ts +12 -0
- package/dist/utils/exec.d.ts.map +1 -0
- package/dist/utils/exec.js +49 -0
- package/dist/utils/exec.js.map +1 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +53 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/tips.d.ts +35 -0
- package/dist/utils/tips.d.ts.map +1 -0
- package/dist/utils/tips.js +132 -0
- package/dist/utils/tips.js.map +1 -0
- package/docs/USER_GUIDE.md +573 -0
- package/eslint.config.mjs +43 -0
- package/package.json +66 -0
- package/tests/agent-direct.test.mjs +45 -0
- package/tests/agent-output.test.mjs +64 -0
- package/tests/codemie-code.test.mjs +42 -0
- package/tests/context7-only.test.mjs +42 -0
- package/tests/conversation-flow.test.mjs +63 -0
- package/tests/interactive-simulation.test.mjs +60 -0
- package/tests/live-output.test.mjs +53 -0
- package/tests/mcp-context7.test.mjs +105 -0
- package/tests/mcp-e2e.test.mjs +109 -0
- package/tests/mcp-time-server.test.mjs +58 -0
- package/tests/streaming.test.mjs +57 -0
- package/tests/test-helpers.mjs +94 -0
- package/tests/text-wrapping.test.mjs +33 -0
- package/tests/tool-count.test.mjs +81 -0
- package/tests/ui-format.test.mjs +39 -0
- package/tests/ui-state.test.mjs +72 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
# CodeMie Code User Guide
|
|
2
|
+
|
|
3
|
+
CodeMie Code provides both a built-in AI coding assistant (`codemie-code`) and a CLI wrapper (`codemie`) for managing multiple AI coding agents.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @codemieai/code
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Verify installation:**
|
|
12
|
+
```bash
|
|
13
|
+
codemie-code --help
|
|
14
|
+
codemie --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
### 1. Configure Your AI Provider
|
|
20
|
+
|
|
21
|
+
Set these environment variables to connect to your AI provider:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
export CODEMIE_BASE_URL="https://your-ai-proxy.com"
|
|
25
|
+
export CODEMIE_AUTH_TOKEN="your-auth-token"
|
|
26
|
+
export CODEMIE_MODEL="claude-4-5-sonnet" # or gpt-4, claude-opus, etc.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Add to your shell profile** for persistence:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Add to ~/.bashrc or ~/.zshrc
|
|
33
|
+
echo 'export CODEMIE_BASE_URL="https://your-ai-proxy.com"' >> ~/.bashrc
|
|
34
|
+
echo 'export CODEMIE_AUTH_TOKEN="your-auth-token"' >> ~/.bashrc
|
|
35
|
+
echo 'export CODEMIE_MODEL="claude-4-5-sonnet"' >> ~/.bashrc
|
|
36
|
+
|
|
37
|
+
# Reload shell
|
|
38
|
+
source ~/.bashrc
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. Verify Installation
|
|
42
|
+
|
|
43
|
+
Check system health and dependencies:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
codemie doctor
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This checks:
|
|
50
|
+
- ✅ Node.js version (>= 24.0.0)
|
|
51
|
+
- ✅ npm installation
|
|
52
|
+
- ✅ git availability
|
|
53
|
+
- ✅ Environment variables configuration
|
|
54
|
+
- ✅ Installed agents
|
|
55
|
+
|
|
56
|
+
### 3. Test Connection
|
|
57
|
+
|
|
58
|
+
Verify your AI provider connection:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
codemie-code test
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Expected output:**
|
|
65
|
+
```
|
|
66
|
+
✓ Configuration loaded
|
|
67
|
+
✓ Testing connection...
|
|
68
|
+
✓ Connection successful
|
|
69
|
+
✓ Model: claude-4-5-sonnet
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
✅ If test passes → You're ready to start coding!
|
|
73
|
+
❌ If test fails → See [Troubleshooting](#troubleshooting)
|
|
74
|
+
|
|
75
|
+
## Quick Start
|
|
76
|
+
|
|
77
|
+
### Start Interactive Mode
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Start in current directory
|
|
81
|
+
codemie-code
|
|
82
|
+
|
|
83
|
+
# Start in specific directory
|
|
84
|
+
codemie-code /path/to/project
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Try Your First Tasks
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
You: Show me the project structure
|
|
91
|
+
You: List all TypeScript files
|
|
92
|
+
You: Read package.json and suggest improvements
|
|
93
|
+
You: Show git status and recent commits
|
|
94
|
+
You: Create a new file called utils.ts with helper functions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Interactive Commands
|
|
98
|
+
|
|
99
|
+
Once inside the assistant:
|
|
100
|
+
|
|
101
|
+
- Type `exit` - Exit the assistant
|
|
102
|
+
- Type `clear` - Clear conversation history
|
|
103
|
+
- Ask any coding question or give tasks
|
|
104
|
+
|
|
105
|
+
## CodeMie Code Assistant
|
|
106
|
+
|
|
107
|
+
The built-in AI assistant with filesystem, git, and command execution tools.
|
|
108
|
+
|
|
109
|
+
### Usage
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Interactive mode (default)
|
|
113
|
+
codemie-code
|
|
114
|
+
codemie-code /path/to/project
|
|
115
|
+
|
|
116
|
+
# Execute one-off task
|
|
117
|
+
codemie-code exec "Add error handling to api.ts"
|
|
118
|
+
|
|
119
|
+
# Execute with custom directory
|
|
120
|
+
codemie-code exec "Run tests" -d /path/to/project
|
|
121
|
+
|
|
122
|
+
# With MCP servers
|
|
123
|
+
codemie-code --mcp-servers time,context7
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Available Tools
|
|
127
|
+
|
|
128
|
+
The assistant comes with 15+ built-in tools:
|
|
129
|
+
|
|
130
|
+
#### Filesystem Tools (10 tools)
|
|
131
|
+
|
|
132
|
+
| Tool | Description |
|
|
133
|
+
|------|-------------|
|
|
134
|
+
| `read_file` | Read contents of a file |
|
|
135
|
+
| `read_multiple_files` | Read multiple files at once |
|
|
136
|
+
| `write_file` | Write/create a file with content |
|
|
137
|
+
| `edit_file` | Edit file with diff-based updates |
|
|
138
|
+
| `create_directory` | Create directories recursively |
|
|
139
|
+
| `list_directory` | List files and directories |
|
|
140
|
+
| `project_tree` | Generate visual project structure tree |
|
|
141
|
+
| `move_file` | Move or rename files |
|
|
142
|
+
| `search_files` | Search files by name or content |
|
|
143
|
+
| `list_allowed_directories` | Show accessible directories |
|
|
144
|
+
|
|
145
|
+
#### Git Tools (4 tools)
|
|
146
|
+
|
|
147
|
+
| Tool | Description |
|
|
148
|
+
|------|-------------|
|
|
149
|
+
| `git_status` | Get repository status |
|
|
150
|
+
| `git_diff` | Show git diff for changes |
|
|
151
|
+
| `git_log` | Show commit history |
|
|
152
|
+
| `git_command` | Execute any git command |
|
|
153
|
+
|
|
154
|
+
#### Command Execution (1 tool)
|
|
155
|
+
|
|
156
|
+
| Tool | Description |
|
|
157
|
+
|------|-------------|
|
|
158
|
+
| `execute_command` | Execute shell commands (with security checks) |
|
|
159
|
+
|
|
160
|
+
### Example Tasks
|
|
161
|
+
|
|
162
|
+
**Code Review:**
|
|
163
|
+
```
|
|
164
|
+
You: Review src/auth.ts and suggest improvements
|
|
165
|
+
You: Refactor the authentication logic to use async/await
|
|
166
|
+
You: Add comprehensive error handling
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Building Features:**
|
|
170
|
+
```
|
|
171
|
+
You: Create a REST API endpoint for user registration
|
|
172
|
+
You: Add email validation
|
|
173
|
+
You: Write unit tests for the new endpoint
|
|
174
|
+
You: Update the API documentation
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Debugging:**
|
|
178
|
+
```
|
|
179
|
+
You: Run the tests and show me any failures
|
|
180
|
+
You: Analyze the error in test/user.test.ts
|
|
181
|
+
You: Fix the failing test
|
|
182
|
+
You: Run tests again to verify the fix
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Git Operations:**
|
|
186
|
+
```
|
|
187
|
+
You: Show me the git status
|
|
188
|
+
You: What files have changed since last commit?
|
|
189
|
+
You: Show me the diff for src/api.ts
|
|
190
|
+
You: Show the last 10 commits
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## MCP Server Management
|
|
194
|
+
|
|
195
|
+
Extend capabilities with Model Context Protocol (MCP) servers.
|
|
196
|
+
|
|
197
|
+
### MCP Commands
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# List available servers
|
|
201
|
+
codemie-code mcp list
|
|
202
|
+
|
|
203
|
+
# List with detailed configuration
|
|
204
|
+
codemie-code mcp list -v
|
|
205
|
+
|
|
206
|
+
# Add new server
|
|
207
|
+
codemie-code mcp add <name> <command-or-url> [options]
|
|
208
|
+
|
|
209
|
+
# Test server configuration
|
|
210
|
+
codemie-code mcp test <server-name>
|
|
211
|
+
|
|
212
|
+
# Remove server
|
|
213
|
+
codemie-code mcp remove <server-name>
|
|
214
|
+
|
|
215
|
+
# Preview which servers will load
|
|
216
|
+
codemie-code mcp servers
|
|
217
|
+
codemie-code mcp servers --servers time,context7
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Popular MCP Servers
|
|
221
|
+
|
|
222
|
+
**Time Server** - Query times in any timezone:
|
|
223
|
+
```bash
|
|
224
|
+
codemie-code mcp add time uvx -a "mcp-server-time"
|
|
225
|
+
codemie-code --mcp-servers time
|
|
226
|
+
|
|
227
|
+
# Then ask: "What time is it in Hong Kong?"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Context7** - Access up-to-date library documentation:
|
|
231
|
+
```bash
|
|
232
|
+
codemie-code mcp add context7 npx -a "-y" "@upstash/context7-mcp"
|
|
233
|
+
codemie-code --mcp-servers context7
|
|
234
|
+
|
|
235
|
+
# Then ask: "Show me LangChain documentation for chains"
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Using MCP Servers
|
|
239
|
+
|
|
240
|
+
**Start with specific servers:**
|
|
241
|
+
```bash
|
|
242
|
+
codemie-code --mcp-servers time,context7
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Or set environment variable:**
|
|
246
|
+
```bash
|
|
247
|
+
export CODEMIE_MCP_SERVERS="time,context7"
|
|
248
|
+
codemie-code
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Example usage:**
|
|
252
|
+
```
|
|
253
|
+
You: What time is it in Tokyo?
|
|
254
|
+
You: Convert 2 PM Los Angeles time to London time
|
|
255
|
+
You: Show me React hooks documentation
|
|
256
|
+
You: How do I use useState in React?
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## CodeMie CLI Wrapper
|
|
260
|
+
|
|
261
|
+
Manage and run multiple AI coding agents from one interface.
|
|
262
|
+
|
|
263
|
+
### List Agents
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# List all available agents
|
|
267
|
+
codemie list
|
|
268
|
+
|
|
269
|
+
# List only installed agents
|
|
270
|
+
codemie list --installed
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Install Agents
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
codemie install claude-code # Anthropic Claude Code
|
|
277
|
+
codemie install aider # Aider AI
|
|
278
|
+
codemie install codex # OpenAI Codex
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Run Agents
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
# Run installed agents
|
|
285
|
+
codemie run claude-code
|
|
286
|
+
codemie run aider
|
|
287
|
+
codemie run codex
|
|
288
|
+
|
|
289
|
+
# Pass arguments to agents
|
|
290
|
+
codemie run aider --model claude-opus
|
|
291
|
+
codemie run claude-code --help
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### System Health Check
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
codemie doctor
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
Checks:
|
|
301
|
+
- Environment variables configuration
|
|
302
|
+
- Agent installations
|
|
303
|
+
- System dependencies
|
|
304
|
+
- AI provider connection
|
|
305
|
+
|
|
306
|
+
### Version Information
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
codemie version # Show all agent versions
|
|
310
|
+
codemie-code --version # Show CodeMie Code version
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Configuration
|
|
314
|
+
|
|
315
|
+
### Required Environment Variables
|
|
316
|
+
|
|
317
|
+
| Variable | Description | Example |
|
|
318
|
+
|----------|-------------|---------|
|
|
319
|
+
| `CODEMIE_BASE_URL` | AI provider base URL | `https://your-ai-proxy.com` |
|
|
320
|
+
| `CODEMIE_AUTH_TOKEN` | Authentication token | `your-auth-token` |
|
|
321
|
+
| `CODEMIE_MODEL` | Model to use | `claude-4-5-sonnet` |
|
|
322
|
+
|
|
323
|
+
### Optional Environment Variables
|
|
324
|
+
|
|
325
|
+
**Debug logging:**
|
|
326
|
+
```bash
|
|
327
|
+
export CODEMIE_DEBUG="true"
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Request timeout (seconds):**
|
|
331
|
+
```bash
|
|
332
|
+
export CODEMIE_TIMEOUT="300" # Default: 300 seconds
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
**Load specific MCP servers:**
|
|
336
|
+
```bash
|
|
337
|
+
export CODEMIE_MCP_SERVERS="time,context7"
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Configuration Methods
|
|
341
|
+
|
|
342
|
+
**Method 1: Shell Profile (Recommended)**
|
|
343
|
+
```bash
|
|
344
|
+
# Add to ~/.bashrc or ~/.zshrc
|
|
345
|
+
export CODEMIE_BASE_URL="https://your-ai-proxy.com"
|
|
346
|
+
export CODEMIE_AUTH_TOKEN="your-token"
|
|
347
|
+
export CODEMIE_MODEL="claude-4-5-sonnet"
|
|
348
|
+
|
|
349
|
+
# Reload shell
|
|
350
|
+
source ~/.bashrc # or ~/.zshrc
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**Method 2: Project .env File**
|
|
354
|
+
```bash
|
|
355
|
+
# Create .env in your project
|
|
356
|
+
cat > .env << EOF
|
|
357
|
+
CODEMIE_BASE_URL=https://your-ai-proxy.com
|
|
358
|
+
CODEMIE_AUTH_TOKEN=your-token
|
|
359
|
+
CODEMIE_MODEL=claude-4-5-sonnet
|
|
360
|
+
EOF
|
|
361
|
+
|
|
362
|
+
# Load and run
|
|
363
|
+
set -a; source .env; set +a
|
|
364
|
+
codemie-code
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
**Method 3: Inline**
|
|
368
|
+
```bash
|
|
369
|
+
CODEMIE_BASE_URL="https://your-ai-proxy.com" \
|
|
370
|
+
CODEMIE_AUTH_TOKEN="your-token" \
|
|
371
|
+
CODEMIE_MODEL="claude-4-5-sonnet" \
|
|
372
|
+
codemie-code
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Advanced: Provider-Specific Configuration
|
|
376
|
+
|
|
377
|
+
For advanced scenarios, you can use provider-specific environment variables. These act as fallbacks if generic `CODEMIE_*` variables are not set:
|
|
378
|
+
|
|
379
|
+
**For Anthropic Claude:**
|
|
380
|
+
```bash
|
|
381
|
+
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
|
|
382
|
+
export ANTHROPIC_AUTH_TOKEN="your-anthropic-token"
|
|
383
|
+
export ANTHROPIC_MODEL="claude-4-5-sonnet"
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**For OpenAI GPT:**
|
|
387
|
+
```bash
|
|
388
|
+
export OPENAI_BASE_URL="https://api.openai.com/v1"
|
|
389
|
+
export OPENAI_API_KEY="your-openai-key"
|
|
390
|
+
export OPENAI_MODEL="gpt-4"
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
**Configuration Priority:**
|
|
394
|
+
1. `CODEMIE_*` (generic - checked first)
|
|
395
|
+
2. `ANTHROPIC_*` or `OPENAI_*` (provider-specific - fallback)
|
|
396
|
+
|
|
397
|
+
## Troubleshooting
|
|
398
|
+
|
|
399
|
+
### Connection Test Fails
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
✗ Connection test failed
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
**Check configuration:**
|
|
406
|
+
```bash
|
|
407
|
+
# Verify environment variables
|
|
408
|
+
echo $CODEMIE_BASE_URL
|
|
409
|
+
echo $CODEMIE_AUTH_TOKEN
|
|
410
|
+
echo $CODEMIE_MODEL
|
|
411
|
+
|
|
412
|
+
# Check URL is accessible
|
|
413
|
+
curl -I $CODEMIE_BASE_URL
|
|
414
|
+
|
|
415
|
+
# Run diagnostics
|
|
416
|
+
codemie doctor
|
|
417
|
+
|
|
418
|
+
# Try test again
|
|
419
|
+
codemie-code test
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**Common issues:**
|
|
423
|
+
|
|
424
|
+
1. **Missing configuration**
|
|
425
|
+
```bash
|
|
426
|
+
# Error: Base URL not configured
|
|
427
|
+
# Solution: Set CODEMIE_BASE_URL
|
|
428
|
+
export CODEMIE_BASE_URL="https://your-proxy.com"
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
2. **Invalid token**
|
|
432
|
+
```bash
|
|
433
|
+
# Error: Auth token not configured
|
|
434
|
+
# Solution: Set CODEMIE_AUTH_TOKEN
|
|
435
|
+
export CODEMIE_AUTH_TOKEN="your-valid-token"
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
3. **Network issues**
|
|
439
|
+
```bash
|
|
440
|
+
# Test connectivity
|
|
441
|
+
curl -v $CODEMIE_BASE_URL
|
|
442
|
+
|
|
443
|
+
# Check VPN if required
|
|
444
|
+
# Verify firewall settings
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Environment Variables Not Loaded
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
# Verify variables are set
|
|
451
|
+
env | grep CODEMIE_
|
|
452
|
+
|
|
453
|
+
# If empty, reload shell profile
|
|
454
|
+
source ~/.bashrc # or ~/.zshrc
|
|
455
|
+
|
|
456
|
+
# Or export again
|
|
457
|
+
export CODEMIE_BASE_URL="..."
|
|
458
|
+
export CODEMIE_AUTH_TOKEN="..."
|
|
459
|
+
export CODEMIE_MODEL="..."
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Command Not Found
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
# Re-install globally
|
|
466
|
+
npm install -g @codemieai/code
|
|
467
|
+
|
|
468
|
+
# Verify installation
|
|
469
|
+
which codemie
|
|
470
|
+
which codemie-code
|
|
471
|
+
|
|
472
|
+
# Check npm global path
|
|
473
|
+
npm config get prefix
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### MCP Server Not Found
|
|
477
|
+
|
|
478
|
+
```
|
|
479
|
+
✗ Server 'my-server' not found
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**Solution:**
|
|
483
|
+
```bash
|
|
484
|
+
codemie-code mcp list # See available servers
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### Agent Not Found
|
|
488
|
+
|
|
489
|
+
```
|
|
490
|
+
✗ Agent 'claude-code' not found
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
**Solution:**
|
|
494
|
+
```bash
|
|
495
|
+
codemie install claude-code
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### Path Outside Allowed Directories
|
|
499
|
+
|
|
500
|
+
```
|
|
501
|
+
Error: path outside allowed directories
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**Explanation:**
|
|
505
|
+
CodeMie Code only operates within the working directory for security.
|
|
506
|
+
|
|
507
|
+
**Solution:**
|
|
508
|
+
```bash
|
|
509
|
+
# Start in the correct directory
|
|
510
|
+
cd /path/to/your/project
|
|
511
|
+
codemie-code
|
|
512
|
+
|
|
513
|
+
# Or specify the directory
|
|
514
|
+
codemie-code /path/to/your/project
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## Best Practices
|
|
518
|
+
|
|
519
|
+
1. **Start with simple tasks** - Get familiar with the assistant's capabilities
|
|
520
|
+
2. **Be specific** - Clear, detailed prompts get better results
|
|
521
|
+
3. **Review changes** - Always review code changes before committing
|
|
522
|
+
4. **Use MCP servers** - Extend capabilities when needed
|
|
523
|
+
5. **Check health regularly** - Run `codemie doctor` to ensure everything is configured
|
|
524
|
+
6. **Test your setup** - Use `codemie-code test` to verify connection before starting work
|
|
525
|
+
7. **Use version control** - Work in git repositories for safety
|
|
526
|
+
8. **Verify environment** - Check `env | grep CODEMIE_` to ensure variables are set
|
|
527
|
+
|
|
528
|
+
## Resources
|
|
529
|
+
|
|
530
|
+
- [Model Context Protocol Specification](https://github.com/modelcontextprotocol/specification)
|
|
531
|
+
- [Available MCP Servers](https://github.com/modelcontextprotocol/servers)
|
|
532
|
+
- [CodeMie Code GitHub Repository](https://github.com/codemie/codemie-code)
|
|
533
|
+
|
|
534
|
+
## Quick Reference
|
|
535
|
+
|
|
536
|
+
### Essential Commands
|
|
537
|
+
|
|
538
|
+
```bash
|
|
539
|
+
# Setup
|
|
540
|
+
export CODEMIE_BASE_URL="https://your-ai-proxy.com"
|
|
541
|
+
export CODEMIE_AUTH_TOKEN="your-token"
|
|
542
|
+
export CODEMIE_MODEL="claude-4-5-sonnet"
|
|
543
|
+
|
|
544
|
+
# Verify
|
|
545
|
+
codemie doctor
|
|
546
|
+
codemie-code test
|
|
547
|
+
|
|
548
|
+
# Start coding
|
|
549
|
+
codemie-code
|
|
550
|
+
codemie-code /path/to/project
|
|
551
|
+
codemie-code exec "task description"
|
|
552
|
+
|
|
553
|
+
# MCP
|
|
554
|
+
codemie-code mcp list
|
|
555
|
+
codemie-code --mcp-servers time,context7
|
|
556
|
+
|
|
557
|
+
# CLI Wrapper
|
|
558
|
+
codemie list
|
|
559
|
+
codemie install claude-code
|
|
560
|
+
codemie run claude-code
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
### Common Tasks
|
|
564
|
+
|
|
565
|
+
| What you want | Command |
|
|
566
|
+
|---------------|---------|
|
|
567
|
+
| Start interactive coding | `codemie-code` |
|
|
568
|
+
| Execute single task | `codemie-code exec "task"` |
|
|
569
|
+
| Test connection | `codemie-code test` |
|
|
570
|
+
| Check system health | `codemie doctor` |
|
|
571
|
+
| List MCP servers | `codemie-code mcp list` |
|
|
572
|
+
| Install agent | `codemie install <agent>` |
|
|
573
|
+
| Show versions | `codemie version` |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
3
|
+
import tsparser from '@typescript-eslint/parser';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
eslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
files: ['src/**/*.ts'],
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parser: tsparser,
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaVersion: 2022,
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
project: './tsconfig.json',
|
|
15
|
+
},
|
|
16
|
+
globals: {
|
|
17
|
+
console: 'readonly',
|
|
18
|
+
process: 'readonly',
|
|
19
|
+
Buffer: 'readonly',
|
|
20
|
+
__dirname: 'readonly',
|
|
21
|
+
__filename: 'readonly',
|
|
22
|
+
require: 'readonly',
|
|
23
|
+
module: 'readonly',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
plugins: {
|
|
27
|
+
'@typescript-eslint': tseslint,
|
|
28
|
+
},
|
|
29
|
+
rules: {
|
|
30
|
+
...tseslint.configs.recommended.rules,
|
|
31
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
32
|
+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
33
|
+
'@typescript-eslint/no-require-imports': 'warn',
|
|
34
|
+
'no-undef': 'off', // TypeScript handles this
|
|
35
|
+
'no-useless-catch': 'warn',
|
|
36
|
+
'no-case-declarations': 'warn',
|
|
37
|
+
'no-useless-escape': 'warn',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
ignores: ['dist/**', 'node_modules/**', '**/*.js'],
|
|
42
|
+
},
|
|
43
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codemieai/code",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "CodeMie Code - AI coding assistant and CLI wrapper for multiple agents",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"codemie-code": "./bin/codemie-code.js",
|
|
9
|
+
"codemie": "./bin/codemie.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc && mkdir -p dist/data && cp src/data/tips.json dist/data/",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"lint": "eslint 'src/**/*.ts' --max-warnings=-1",
|
|
15
|
+
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
16
|
+
"license-check": "npx license-checker --summary --onlyAllow 'MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;CC0-1.0;Unlicense;BlueOak-1.0.0;Python-2.0;CC-BY-4.0;Apache*;(MIT OR CC0-1.0)'",
|
|
17
|
+
"test": "node --test tests/*.test.mjs",
|
|
18
|
+
"test:watch": "node --test --watch tests/*.test.mjs",
|
|
19
|
+
"ci": "npm run license-check && npm run lint && npm run build && npm test",
|
|
20
|
+
"prepublishOnly": "npm run build",
|
|
21
|
+
"prepack": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ai",
|
|
25
|
+
"coding",
|
|
26
|
+
"assistant",
|
|
27
|
+
"cli",
|
|
28
|
+
"langchain",
|
|
29
|
+
"litellm",
|
|
30
|
+
"mcp",
|
|
31
|
+
"claude",
|
|
32
|
+
"codex",
|
|
33
|
+
"aider"
|
|
34
|
+
],
|
|
35
|
+
"author": "CodeMie Team",
|
|
36
|
+
"license": "Apache-2.0",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@langchain/core": "^1.0.1",
|
|
39
|
+
"@langchain/langgraph": "^1.0.1",
|
|
40
|
+
"@langchain/mcp-adapters": "^1.0.0",
|
|
41
|
+
"@langchain/openai": "^1.0.0",
|
|
42
|
+
"@types/blessed": "^0.1.25",
|
|
43
|
+
"blessed": "^0.1.81",
|
|
44
|
+
"chalk": "^5.3.0",
|
|
45
|
+
"commander": "^11.1.0",
|
|
46
|
+
"diff": "^5.1.0",
|
|
47
|
+
"dotenv": "^16.3.1",
|
|
48
|
+
"inquirer": "^9.2.12",
|
|
49
|
+
"langchain": "^1.0.2",
|
|
50
|
+
"ora": "^7.0.1",
|
|
51
|
+
"zod": "^3.22.4"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@eslint/js": "^9.38.0",
|
|
55
|
+
"@types/diff": "^5.0.9",
|
|
56
|
+
"@types/inquirer": "^9.0.7",
|
|
57
|
+
"@types/node": "^20.10.5",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
59
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
60
|
+
"eslint": "^9.38.0",
|
|
61
|
+
"typescript": "^5.3.3"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=24.0.0"
|
|
65
|
+
}
|
|
66
|
+
}
|