@codemieai/code 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/.codemie/guides/git-workflow.md +493 -0
  2. package/CLAUDE.md +130 -761
  3. package/README.md +283 -695
  4. package/bin/codemie-claude.js +122 -0
  5. package/bin/codemie-code.js +90 -15
  6. package/bin/codemie-codex.js +138 -0
  7. package/bin/codemie.js +1 -1
  8. package/config.example.json +10 -0
  9. package/dist/agents/adapters/claude-code.d.ts +2 -2
  10. package/dist/agents/adapters/claude-code.d.ts.map +1 -1
  11. package/dist/agents/adapters/claude-code.js +20 -42
  12. package/dist/agents/adapters/claude-code.js.map +1 -1
  13. package/dist/agents/adapters/codemie-code.d.ts +11 -2
  14. package/dist/agents/adapters/codemie-code.d.ts.map +1 -1
  15. package/dist/agents/adapters/codemie-code.js +93 -25
  16. package/dist/agents/adapters/codemie-code.js.map +1 -1
  17. package/dist/agents/adapters/codex.d.ts +2 -2
  18. package/dist/agents/adapters/codex.d.ts.map +1 -1
  19. package/dist/agents/adapters/codex.js +31 -24
  20. package/dist/agents/adapters/codex.js.map +1 -1
  21. package/dist/agents/codemie-code/agent.d.ts +89 -0
  22. package/dist/agents/codemie-code/agent.d.ts.map +1 -0
  23. package/dist/agents/codemie-code/agent.js +523 -0
  24. package/dist/agents/codemie-code/agent.js.map +1 -0
  25. package/dist/agents/codemie-code/config.d.ts +40 -0
  26. package/dist/agents/codemie-code/config.d.ts.map +1 -0
  27. package/dist/agents/codemie-code/config.js +276 -0
  28. package/dist/agents/codemie-code/config.js.map +1 -0
  29. package/dist/agents/codemie-code/filters.d.ts +91 -0
  30. package/dist/agents/codemie-code/filters.d.ts.map +1 -0
  31. package/dist/agents/codemie-code/filters.js +328 -0
  32. package/dist/agents/codemie-code/filters.js.map +1 -0
  33. package/dist/agents/codemie-code/index.d.ts +78 -0
  34. package/dist/agents/codemie-code/index.d.ts.map +1 -0
  35. package/dist/agents/codemie-code/index.js +259 -0
  36. package/dist/agents/codemie-code/index.js.map +1 -0
  37. package/dist/agents/codemie-code/prompts.d.ts +11 -0
  38. package/dist/agents/codemie-code/prompts.d.ts.map +1 -0
  39. package/dist/agents/codemie-code/prompts.js +31 -0
  40. package/dist/agents/codemie-code/prompts.js.map +1 -0
  41. package/dist/agents/codemie-code/streaming/events.d.ts +7 -0
  42. package/dist/agents/codemie-code/streaming/events.d.ts.map +1 -0
  43. package/dist/agents/codemie-code/streaming/events.js +7 -0
  44. package/dist/agents/codemie-code/streaming/events.js.map +1 -0
  45. package/dist/agents/codemie-code/streaming/formatter.d.ts +2 -0
  46. package/dist/agents/codemie-code/streaming/formatter.d.ts.map +1 -0
  47. package/dist/agents/codemie-code/streaming/formatter.js +2 -0
  48. package/dist/agents/codemie-code/streaming/formatter.js.map +1 -0
  49. package/dist/agents/codemie-code/streaming/ui.d.ts +2 -0
  50. package/dist/agents/codemie-code/streaming/ui.d.ts.map +1 -0
  51. package/dist/agents/codemie-code/streaming/ui.js +2 -0
  52. package/dist/agents/codemie-code/streaming/ui.js.map +1 -0
  53. package/dist/agents/codemie-code/tokenUtils.d.ts +108 -0
  54. package/dist/agents/codemie-code/tokenUtils.d.ts.map +1 -0
  55. package/dist/agents/codemie-code/tokenUtils.js +220 -0
  56. package/dist/agents/codemie-code/tokenUtils.js.map +1 -0
  57. package/dist/agents/codemie-code/toolMetadata.d.ts +15 -0
  58. package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -0
  59. package/dist/agents/codemie-code/toolMetadata.js +315 -0
  60. package/dist/agents/codemie-code/toolMetadata.js.map +1 -0
  61. package/dist/agents/codemie-code/tools/command.d.ts +2 -0
  62. package/dist/agents/codemie-code/tools/command.d.ts.map +1 -0
  63. package/dist/agents/codemie-code/tools/command.js +2 -0
  64. package/dist/agents/codemie-code/tools/command.js.map +1 -0
  65. package/dist/agents/codemie-code/tools/filesystem.d.ts +2 -0
  66. package/dist/agents/codemie-code/tools/filesystem.d.ts.map +1 -0
  67. package/dist/agents/codemie-code/tools/filesystem.js +2 -0
  68. package/dist/agents/codemie-code/tools/filesystem.js.map +1 -0
  69. package/dist/agents/codemie-code/tools/git.d.ts +2 -0
  70. package/dist/agents/codemie-code/tools/git.d.ts.map +1 -0
  71. package/dist/agents/codemie-code/tools/git.js +2 -0
  72. package/dist/agents/codemie-code/tools/git.js.map +1 -0
  73. package/dist/agents/codemie-code/tools/index.d.ts +19 -0
  74. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -0
  75. package/dist/agents/codemie-code/tools/index.js +239 -0
  76. package/dist/agents/codemie-code/tools/index.js.map +1 -0
  77. package/dist/agents/codemie-code/tools/security.d.ts +2 -0
  78. package/dist/agents/codemie-code/tools/security.d.ts.map +1 -0
  79. package/dist/agents/codemie-code/tools/security.js +2 -0
  80. package/dist/agents/codemie-code/tools/security.js.map +1 -0
  81. package/dist/agents/codemie-code/types.d.ts +254 -0
  82. package/dist/agents/codemie-code/types.d.ts.map +1 -0
  83. package/dist/agents/codemie-code/types.js +35 -0
  84. package/dist/agents/codemie-code/types.js.map +1 -0
  85. package/dist/agents/codemie-code/ui.d.ts +83 -0
  86. package/dist/agents/codemie-code/ui.d.ts.map +1 -0
  87. package/dist/agents/codemie-code/ui.js +624 -0
  88. package/dist/agents/codemie-code/ui.js.map +1 -0
  89. package/dist/agents/registry.d.ts +1 -1
  90. package/dist/agents/registry.d.ts.map +1 -1
  91. package/dist/agents/registry.js +7 -13
  92. package/dist/agents/registry.js.map +1 -1
  93. package/dist/cli/commands/config.d.ts +3 -0
  94. package/dist/cli/commands/config.d.ts.map +1 -0
  95. package/dist/cli/commands/config.js +323 -0
  96. package/dist/cli/commands/config.js.map +1 -0
  97. package/dist/cli/commands/doctor.d.ts.map +1 -1
  98. package/dist/cli/commands/doctor.js +113 -69
  99. package/dist/cli/commands/doctor.js.map +1 -1
  100. package/dist/cli/commands/env.d.ts +3 -0
  101. package/dist/cli/commands/env.d.ts.map +1 -0
  102. package/dist/cli/commands/env.js +19 -0
  103. package/dist/cli/commands/env.js.map +1 -0
  104. package/dist/cli/commands/install.js +27 -33
  105. package/dist/cli/commands/install.js.map +1 -1
  106. package/dist/cli/commands/list.js +18 -24
  107. package/dist/cli/commands/list.js.map +1 -1
  108. package/dist/cli/commands/run.d.ts.map +1 -1
  109. package/dist/cli/commands/run.js +307 -21
  110. package/dist/cli/commands/run.js.map +1 -1
  111. package/dist/cli/commands/setup.d.ts +3 -0
  112. package/dist/cli/commands/setup.d.ts.map +1 -0
  113. package/dist/cli/commands/setup.js +357 -0
  114. package/dist/cli/commands/setup.js.map +1 -0
  115. package/dist/cli/commands/uninstall.js +24 -30
  116. package/dist/cli/commands/uninstall.js.map +1 -1
  117. package/dist/cli/commands/version.d.ts.map +1 -1
  118. package/dist/cli/commands/version.js +11 -16
  119. package/dist/cli/commands/version.js.map +1 -1
  120. package/dist/cli/index.js +47 -31
  121. package/dist/cli/index.js.map +1 -1
  122. package/dist/env/manager.js +9 -46
  123. package/dist/env/manager.js.map +1 -1
  124. package/dist/index.d.ts +6 -13
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +6 -43
  127. package/dist/index.js.map +1 -1
  128. package/dist/utils/async-tips.d.ts.map +1 -1
  129. package/dist/utils/async-tips.js +16 -55
  130. package/dist/utils/async-tips.js.map +1 -1
  131. package/dist/utils/clipboard.d.ts +16 -0
  132. package/dist/utils/clipboard.d.ts.map +1 -0
  133. package/dist/utils/clipboard.js +179 -0
  134. package/dist/utils/clipboard.js.map +1 -0
  135. package/dist/utils/config-loader.d.ts +96 -0
  136. package/dist/utils/config-loader.d.ts.map +1 -0
  137. package/dist/utils/config-loader.js +351 -0
  138. package/dist/utils/config-loader.js.map +1 -0
  139. package/dist/utils/dirname.d.ts +7 -0
  140. package/dist/utils/dirname.d.ts.map +1 -0
  141. package/dist/utils/dirname.js +11 -0
  142. package/dist/utils/dirname.js.map +1 -0
  143. package/dist/utils/errors.js +7 -17
  144. package/dist/utils/errors.js.map +1 -1
  145. package/dist/utils/exec.js +3 -6
  146. package/dist/utils/exec.js.map +1 -1
  147. package/dist/utils/first-time.d.ts +34 -0
  148. package/dist/utils/first-time.d.ts.map +1 -0
  149. package/dist/utils/first-time.js +245 -0
  150. package/dist/utils/first-time.js.map +1 -0
  151. package/dist/utils/health-checker.d.ts +20 -0
  152. package/dist/utils/health-checker.d.ts.map +1 -0
  153. package/dist/utils/health-checker.js +168 -0
  154. package/dist/utils/health-checker.js.map +1 -0
  155. package/dist/utils/logger.js +12 -18
  156. package/dist/utils/logger.js.map +1 -1
  157. package/dist/utils/model-fetcher.d.ts +21 -0
  158. package/dist/utils/model-fetcher.d.ts.map +1 -0
  159. package/dist/utils/model-fetcher.js +137 -0
  160. package/dist/utils/model-fetcher.js.map +1 -0
  161. package/dist/utils/tips.d.ts.map +1 -1
  162. package/dist/utils/tips.js +13 -52
  163. package/dist/utils/tips.js.map +1 -1
  164. package/package.json +17 -23
  165. package/scripts/README.md +80 -0
  166. package/scripts/release.sh +156 -0
  167. package/dist/agents/adapters/aider.d.ts +0 -12
  168. package/dist/agents/adapters/aider.d.ts.map +0 -1
  169. package/dist/agents/adapters/aider.js +0 -80
  170. package/dist/agents/adapters/aider.js.map +0 -1
  171. package/dist/cli/cli.d.ts +0 -4
  172. package/dist/cli/cli.d.ts.map +0 -1
  173. package/dist/cli/cli.js +0 -107
  174. package/dist/cli/cli.js.map +0 -1
  175. package/dist/cli/commands/mcp.d.ts +0 -3
  176. package/dist/cli/commands/mcp.d.ts.map +0 -1
  177. package/dist/cli/commands/mcp.js +0 -459
  178. package/dist/cli/commands/mcp.js.map +0 -1
  179. package/dist/code/agent-events.d.ts +0 -39
  180. package/dist/code/agent-events.d.ts.map +0 -1
  181. package/dist/code/agent-events.js +0 -4
  182. package/dist/code/agent-events.js.map +0 -1
  183. package/dist/code/agent.d.ts +0 -19
  184. package/dist/code/agent.d.ts.map +0 -1
  185. package/dist/code/agent.js +0 -144
  186. package/dist/code/agent.js.map +0 -1
  187. package/dist/code/config.d.ts +0 -13
  188. package/dist/code/config.d.ts.map +0 -1
  189. package/dist/code/config.js +0 -41
  190. package/dist/code/config.js.map +0 -1
  191. package/dist/code/index.d.ts +0 -19
  192. package/dist/code/index.d.ts.map +0 -1
  193. package/dist/code/index.js +0 -400
  194. package/dist/code/index.js.map +0 -1
  195. package/dist/code/prompts.d.ts +0 -2
  196. package/dist/code/prompts.d.ts.map +0 -1
  197. package/dist/code/prompts.js +0 -45
  198. package/dist/code/prompts.js.map +0 -1
  199. package/dist/code/tools/command.d.ts +0 -8
  200. package/dist/code/tools/command.d.ts.map +0 -1
  201. package/dist/code/tools/command.js +0 -83
  202. package/dist/code/tools/command.js.map +0 -1
  203. package/dist/code/tools/diff-utils.d.ts +0 -2
  204. package/dist/code/tools/diff-utils.d.ts.map +0 -1
  205. package/dist/code/tools/diff-utils.js +0 -45
  206. package/dist/code/tools/diff-utils.js.map +0 -1
  207. package/dist/code/tools/filesystem.d.ts +0 -11
  208. package/dist/code/tools/filesystem.d.ts.map +0 -1
  209. package/dist/code/tools/filesystem.js +0 -442
  210. package/dist/code/tools/filesystem.js.map +0 -1
  211. package/dist/code/tools/git.d.ts +0 -7
  212. package/dist/code/tools/git.d.ts.map +0 -1
  213. package/dist/code/tools/git.js +0 -111
  214. package/dist/code/tools/git.js.map +0 -1
  215. package/dist/code/tools/mcp.d.ts +0 -13
  216. package/dist/code/tools/mcp.d.ts.map +0 -1
  217. package/dist/code/tools/mcp.js +0 -230
  218. package/dist/code/tools/mcp.js.map +0 -1
  219. package/dist/data/tips.json +0 -118
  220. package/dist/ui/terminal-ui.d.ts +0 -73
  221. package/dist/ui/terminal-ui.d.ts.map +0 -1
  222. package/dist/ui/terminal-ui.js +0 -900
  223. package/dist/ui/terminal-ui.js.map +0 -1
  224. package/dist/utils/env-mapper.d.ts +0 -40
  225. package/dist/utils/env-mapper.d.ts.map +0 -1
  226. package/dist/utils/env-mapper.js +0 -122
  227. package/dist/utils/env-mapper.js.map +0 -1
  228. package/docs/USER_GUIDE.md +0 -573
  229. package/tests/agent-direct.test.mjs +0 -45
  230. package/tests/agent-output.test.mjs +0 -64
  231. package/tests/codemie-code.test.mjs +0 -42
  232. package/tests/context7-only.test.mjs +0 -42
  233. package/tests/conversation-flow.test.mjs +0 -63
  234. package/tests/interactive-simulation.test.mjs +0 -60
  235. package/tests/live-output.test.mjs +0 -53
  236. package/tests/mcp-context7.test.mjs +0 -105
  237. package/tests/mcp-e2e.test.mjs +0 -109
  238. package/tests/mcp-time-server.test.mjs +0 -58
  239. package/tests/streaming.test.mjs +0 -57
  240. package/tests/test-helpers.mjs +0 -94
  241. package/tests/text-wrapping.test.mjs +0 -33
  242. package/tests/tool-count.test.mjs +0 -81
  243. package/tests/ui-format.test.mjs +0 -39
  244. package/tests/ui-state.test.mjs +0 -72
@@ -1,573 +0,0 @@
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` |
@@ -1,45 +0,0 @@
1
- /**
2
- * Integration Test: Direct agent tool calling
3
- * Uses Node.js native test runner
4
- */
5
-
6
- import { describe, it, before } from 'node:test';
7
- import assert from 'node:assert';
8
- import { CodeMieAgent } from '../dist/code/agent.js';
9
- import { loadConfig } from '../dist/code/config.js';
10
- import { FilesystemTools } from '../dist/code/tools/filesystem.js';
11
- import { skipIfNoBaseUrl } from './test-helpers.mjs';
12
-
13
- describe('Direct Agent Tool Calling', () => {
14
- let agent;
15
- let config;
16
-
17
- before(() => {
18
- if (skipIfNoBaseUrl()) return;
19
-
20
- config = loadConfig(process.cwd());
21
- const filesystemTools = new FilesystemTools({
22
- allowedDirectories: [process.cwd()]
23
- });
24
- const tools = filesystemTools.getTools();
25
- agent = new CodeMieAgent(config, tools);
26
- });
27
-
28
- it('should load configuration correctly', () => {
29
- if (skipIfNoBaseUrl()) return;
30
-
31
- assert.ok(config, 'Config should be loaded');
32
- assert.ok(config.model, 'Config should have a model');
33
- assert.ok(config.provider, 'Config should have a provider');
34
- });
35
-
36
- it('should list files in current directory', async () => {
37
- if (skipIfNoBaseUrl()) return;
38
-
39
- const response = await agent.chat('list all files in the current directory');
40
-
41
- assert.ok(response, 'Response should be defined');
42
- assert.ok(typeof response === 'string', 'Response should be a string');
43
- assert.ok(response.length > 0, 'Response should not be empty');
44
- });
45
- });
@@ -1,64 +0,0 @@
1
- /**
2
- * Integration Test: Agent output format
3
- * Uses Node.js native test runner
4
- */
5
-
6
- import { describe, it, before, after } from 'node:test';
7
- import assert from 'node:assert';
8
- import { CodeMieCode } from '../dist/code/index.js';
9
- import { skipIfNoBaseUrl } from './test-helpers.mjs';
10
-
11
- describe('Agent Output Format', () => {
12
- let assistant;
13
-
14
- before(async () => {
15
- if (skipIfNoBaseUrl()) return;
16
-
17
- assistant = new CodeMieCode(process.cwd());
18
- await assistant.initialize({ showTips: false });
19
- });
20
-
21
- after(async () => {
22
- if (assistant) {
23
- await assistant.dispose();
24
- }
25
- });
26
-
27
- it('should produce correctly formatted output', async () => {
28
- if (skipIfNoBaseUrl()) return;
29
- const capturedOutput = {
30
- contentChunks: [],
31
- toolCalls: [],
32
- toolResults: [],
33
- errors: []
34
- };
35
-
36
- await assistant.agent.chatStream('list files in current directory', (event) => {
37
- switch (event.type) {
38
- case 'content_chunk':
39
- capturedOutput.contentChunks.push(event.content);
40
- break;
41
-
42
- case 'tool_call_start':
43
- const args = Object.entries(event.toolArgs)
44
- .map(([k, v]) => typeof v === 'string' ? v : JSON.stringify(v))
45
- .join(', ');
46
- capturedOutput.toolCalls.push(`${event.toolName}(${args})`);
47
- break;
48
-
49
- case 'tool_call_result':
50
- capturedOutput.toolResults.push(event.result);
51
- break;
52
-
53
- case 'tool_call_error':
54
- capturedOutput.errors.push(event.error);
55
- break;
56
- }
57
- });
58
-
59
- // Validate output format
60
- assert.ok(capturedOutput.contentChunks.length > 0, 'Should have content chunks');
61
- assert.ok(capturedOutput.toolCalls.length > 0, 'Should have tool calls');
62
- assert.ok(capturedOutput.toolResults.length > 0, 'Should have tool results');
63
- });
64
- });
@@ -1,42 +0,0 @@
1
- /**
2
- * Integration Test: CodeMieCode class tool calling
3
- * Uses Node.js native test runner
4
- */
5
-
6
- import { describe, it, before, after } from 'node:test';
7
- import assert from 'node:assert';
8
- import { CodeMieCode } from '../dist/code/index.js';
9
- import { skipIfNoBaseUrl } from './test-helpers.mjs';
10
-
11
- describe('CodeMieCode Tool Calling', () => {
12
- let assistant;
13
-
14
- before(async () => {
15
- if (skipIfNoBaseUrl()) return;
16
-
17
- assistant = new CodeMieCode(process.cwd());
18
- await assistant.initialize({ showTips: false });
19
- });
20
-
21
- after(async () => {
22
- if (assistant) {
23
- await assistant.dispose();
24
- }
25
- });
26
-
27
- it('should initialize successfully', () => {
28
- if (skipIfNoBaseUrl()) return;
29
-
30
- assert.ok(assistant, 'Assistant should be initialized');
31
- assert.ok(assistant.agent, 'Assistant should have an agent');
32
- });
33
-
34
- it('should list files in current directory', async () => {
35
- if (skipIfNoBaseUrl()) return;
36
- const response = await assistant.chat('list files in the current directory');
37
-
38
- assert.ok(response, 'Response should be defined');
39
- assert.ok(typeof response === 'string', 'Response should be a string');
40
- assert.ok(response.length > 0, 'Response should not be empty');
41
- });
42
- });