@codemieai/code 0.0.7 → 0.0.8

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 (184) hide show
  1. package/README.md +265 -47
  2. package/bin/agent-executor.js +6 -4
  3. package/dist/agents/codemie-code/agent.d.ts.map +1 -1
  4. package/dist/agents/codemie-code/agent.js +29 -28
  5. package/dist/agents/codemie-code/agent.js.map +1 -1
  6. package/dist/agents/codemie-code/config.d.ts.map +1 -1
  7. package/dist/agents/codemie-code/config.js +4 -3
  8. package/dist/agents/codemie-code/config.js.map +1 -1
  9. package/dist/agents/codemie-code/index.d.ts.map +1 -1
  10. package/dist/agents/codemie-code/index.js +10 -9
  11. package/dist/agents/codemie-code/index.js.map +1 -1
  12. package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
  13. package/dist/agents/codemie-code/tools/index.js +6 -5
  14. package/dist/agents/codemie-code/tools/index.js.map +1 -1
  15. package/dist/agents/codemie-code/ui/todoPanel.js +9 -9
  16. package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
  17. package/dist/agents/codemie-code/ui.d.ts.map +1 -1
  18. package/dist/agents/codemie-code/ui.js +34 -33
  19. package/dist/agents/codemie-code/ui.js.map +1 -1
  20. package/dist/agents/core/AgentCLI.d.ts.map +1 -1
  21. package/dist/agents/core/AgentCLI.js +31 -16
  22. package/dist/agents/core/AgentCLI.js.map +1 -1
  23. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  24. package/dist/agents/core/BaseAgentAdapter.js +5 -11
  25. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  26. package/dist/agents/plugins/claude.plugin.d.ts.map +1 -1
  27. package/dist/agents/plugins/claude.plugin.js +9 -0
  28. package/dist/agents/plugins/claude.plugin.js.map +1 -1
  29. package/dist/agents/plugins/codemie-code.plugin.d.ts +4 -0
  30. package/dist/agents/plugins/codemie-code.plugin.d.ts.map +1 -1
  31. package/dist/agents/plugins/codemie-code.plugin.js +9 -2
  32. package/dist/agents/plugins/codemie-code.plugin.js.map +1 -1
  33. package/dist/agents/registry.d.ts +1 -0
  34. package/dist/agents/registry.d.ts.map +1 -1
  35. package/dist/agents/registry.js +3 -2
  36. package/dist/agents/registry.js.map +1 -1
  37. package/dist/cli/commands/auth.js +5 -5
  38. package/dist/cli/commands/auth.js.map +1 -1
  39. package/dist/cli/commands/config.js +21 -21
  40. package/dist/cli/commands/config.js.map +1 -1
  41. package/dist/cli/commands/doctor/checks/AIConfigCheck.d.ts +13 -0
  42. package/dist/cli/commands/doctor/checks/AIConfigCheck.d.ts.map +1 -0
  43. package/dist/cli/commands/doctor/checks/AIConfigCheck.js +135 -0
  44. package/dist/cli/commands/doctor/checks/AIConfigCheck.js.map +1 -0
  45. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +10 -0
  46. package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -0
  47. package/dist/cli/commands/doctor/checks/AgentsCheck.js +57 -0
  48. package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -0
  49. package/dist/cli/commands/doctor/checks/NodeVersionCheck.d.ts +9 -0
  50. package/dist/cli/commands/doctor/checks/NodeVersionCheck.d.ts.map +1 -0
  51. package/dist/cli/commands/doctor/checks/NodeVersionCheck.js +38 -0
  52. package/dist/cli/commands/doctor/checks/NodeVersionCheck.js.map +1 -0
  53. package/dist/cli/commands/doctor/checks/NpmCheck.d.ts +9 -0
  54. package/dist/cli/commands/doctor/checks/NpmCheck.d.ts.map +1 -0
  55. package/dist/cli/commands/doctor/checks/NpmCheck.js +28 -0
  56. package/dist/cli/commands/doctor/checks/NpmCheck.js.map +1 -0
  57. package/dist/cli/commands/doctor/checks/WorkflowsCheck.d.ts +9 -0
  58. package/dist/cli/commands/doctor/checks/WorkflowsCheck.d.ts.map +1 -0
  59. package/dist/cli/commands/doctor/checks/WorkflowsCheck.js +72 -0
  60. package/dist/cli/commands/doctor/checks/WorkflowsCheck.js.map +1 -0
  61. package/dist/cli/commands/doctor/checks/index.d.ts +9 -0
  62. package/dist/cli/commands/doctor/checks/index.d.ts.map +1 -0
  63. package/dist/cli/commands/doctor/checks/index.js +9 -0
  64. package/dist/cli/commands/doctor/checks/index.js.map +1 -0
  65. package/dist/cli/commands/doctor/formatter.d.ts +53 -0
  66. package/dist/cli/commands/doctor/formatter.d.ts.map +1 -0
  67. package/dist/cli/commands/doctor/formatter.js +153 -0
  68. package/dist/cli/commands/doctor/formatter.js.map +1 -0
  69. package/dist/cli/commands/{doctor.d.ts → doctor/index.d.ts} +4 -1
  70. package/dist/cli/commands/doctor/index.d.ts.map +1 -0
  71. package/dist/cli/commands/doctor/index.js +67 -0
  72. package/dist/cli/commands/doctor/index.js.map +1 -0
  73. package/dist/cli/commands/doctor/providers/AIRunSSOProviderCheck.d.ts +11 -0
  74. package/dist/cli/commands/doctor/providers/AIRunSSOProviderCheck.d.ts.map +1 -0
  75. package/dist/cli/commands/doctor/providers/AIRunSSOProviderCheck.js +192 -0
  76. package/dist/cli/commands/doctor/providers/AIRunSSOProviderCheck.js.map +1 -0
  77. package/dist/cli/commands/doctor/providers/BaseProviderCheck.d.ts +12 -0
  78. package/dist/cli/commands/doctor/providers/BaseProviderCheck.d.ts.map +1 -0
  79. package/dist/cli/commands/doctor/providers/BaseProviderCheck.js +12 -0
  80. package/dist/cli/commands/doctor/providers/BaseProviderCheck.js.map +1 -0
  81. package/dist/cli/commands/doctor/providers/StandardProviderCheck.d.ts +11 -0
  82. package/dist/cli/commands/doctor/providers/StandardProviderCheck.d.ts.map +1 -0
  83. package/dist/cli/commands/doctor/providers/StandardProviderCheck.js +97 -0
  84. package/dist/cli/commands/doctor/providers/StandardProviderCheck.js.map +1 -0
  85. package/dist/cli/commands/doctor/providers/index.d.ts +30 -0
  86. package/dist/cli/commands/doctor/providers/index.d.ts.map +1 -0
  87. package/dist/cli/commands/doctor/providers/index.js +66 -0
  88. package/dist/cli/commands/doctor/providers/index.js.map +1 -0
  89. package/dist/cli/commands/doctor/types.d.ts +59 -0
  90. package/dist/cli/commands/doctor/types.d.ts.map +1 -0
  91. package/dist/cli/commands/doctor/types.js +5 -0
  92. package/dist/cli/commands/doctor/types.js.map +1 -0
  93. package/dist/cli/commands/install.d.ts.map +1 -1
  94. package/dist/cli/commands/install.js +24 -8
  95. package/dist/cli/commands/install.js.map +1 -1
  96. package/dist/cli/commands/list.js +3 -3
  97. package/dist/cli/commands/list.js.map +1 -1
  98. package/dist/cli/commands/profile.js +6 -6
  99. package/dist/cli/commands/profile.js.map +1 -1
  100. package/dist/cli/commands/setup.js +51 -38
  101. package/dist/cli/commands/setup.js.map +1 -1
  102. package/dist/cli/commands/uninstall.d.ts.map +1 -1
  103. package/dist/cli/commands/uninstall.js +19 -4
  104. package/dist/cli/commands/uninstall.js.map +1 -1
  105. package/dist/cli/commands/workflow.d.ts.map +1 -1
  106. package/dist/cli/commands/workflow.js +30 -59
  107. package/dist/cli/commands/workflow.js.map +1 -1
  108. package/dist/cli/index.js +1 -3
  109. package/dist/cli/index.js.map +1 -1
  110. package/dist/env/types.d.ts.map +1 -1
  111. package/dist/env/types.js +2 -2
  112. package/dist/env/types.js.map +1 -1
  113. package/dist/utils/async-tips.js +6 -6
  114. package/dist/utils/async-tips.js.map +1 -1
  115. package/dist/utils/codemie-integration-validator.d.ts +3 -2
  116. package/dist/utils/codemie-integration-validator.d.ts.map +1 -1
  117. package/dist/utils/codemie-integration-validator.js +38 -11
  118. package/dist/utils/codemie-integration-validator.js.map +1 -1
  119. package/dist/utils/config-loader.d.ts.map +1 -1
  120. package/dist/utils/config-loader.js +17 -6
  121. package/dist/utils/config-loader.js.map +1 -1
  122. package/dist/utils/credential-store.d.ts.map +1 -1
  123. package/dist/utils/credential-store.js +55 -24
  124. package/dist/utils/credential-store.js.map +1 -1
  125. package/dist/utils/first-time.d.ts +8 -0
  126. package/dist/utils/first-time.d.ts.map +1 -1
  127. package/dist/utils/first-time.js +133 -86
  128. package/dist/utils/first-time.js.map +1 -1
  129. package/dist/utils/logger.d.ts +19 -1
  130. package/dist/utils/logger.d.ts.map +1 -1
  131. package/dist/utils/logger.js +93 -8
  132. package/dist/utils/logger.js.map +1 -1
  133. package/dist/utils/sso-auth.d.ts.map +1 -1
  134. package/dist/utils/sso-auth.js +24 -10
  135. package/dist/utils/sso-auth.js.map +1 -1
  136. package/dist/utils/sso-gateway.d.ts +28 -0
  137. package/dist/utils/sso-gateway.d.ts.map +1 -1
  138. package/dist/utils/sso-gateway.js +197 -46
  139. package/dist/utils/sso-gateway.js.map +1 -1
  140. package/dist/utils/tips.js +3 -3
  141. package/dist/utils/tips.js.map +1 -1
  142. package/dist/workflows/installer.d.ts.map +1 -1
  143. package/dist/workflows/installer.js +3 -8
  144. package/dist/workflows/installer.js.map +1 -1
  145. package/package.json +6 -2
  146. package/dist/cli/commands/doctor.d.ts.map +0 -1
  147. package/dist/cli/commands/doctor.js +0 -365
  148. package/dist/cli/commands/doctor.js.map +0 -1
  149. package/dist/cli/commands/tools.d.ts +0 -6
  150. package/dist/cli/commands/tools.d.ts.map +0 -1
  151. package/dist/cli/commands/tools.js +0 -244
  152. package/dist/cli/commands/tools.js.map +0 -1
  153. package/dist/clients/adapters/github.d.ts +0 -17
  154. package/dist/clients/adapters/github.d.ts.map +0 -1
  155. package/dist/clients/adapters/github.js +0 -150
  156. package/dist/clients/adapters/github.js.map +0 -1
  157. package/dist/clients/adapters/gitlab.d.ts +0 -17
  158. package/dist/clients/adapters/gitlab.d.ts.map +0 -1
  159. package/dist/clients/adapters/gitlab.js +0 -147
  160. package/dist/clients/adapters/gitlab.js.map +0 -1
  161. package/dist/clients/registry.d.ts +0 -20
  162. package/dist/clients/registry.d.ts.map +0 -1
  163. package/dist/clients/registry.js +0 -27
  164. package/dist/clients/registry.js.map +0 -1
  165. package/dist/tools/detector.d.ts +0 -33
  166. package/dist/tools/detector.d.ts.map +0 -1
  167. package/dist/tools/detector.js +0 -145
  168. package/dist/tools/detector.js.map +0 -1
  169. package/dist/tools/index.d.ts +0 -8
  170. package/dist/tools/index.d.ts.map +0 -1
  171. package/dist/tools/index.js +0 -8
  172. package/dist/tools/index.js.map +0 -1
  173. package/dist/tools/manager.d.ts +0 -21
  174. package/dist/tools/manager.d.ts.map +0 -1
  175. package/dist/tools/manager.js +0 -104
  176. package/dist/tools/manager.js.map +0 -1
  177. package/dist/tools/registry.d.ts +0 -8
  178. package/dist/tools/registry.d.ts.map +0 -1
  179. package/dist/tools/registry.js +0 -36
  180. package/dist/tools/registry.js.map +0 -1
  181. package/dist/tools/types.d.ts +0 -41
  182. package/dist/tools/types.d.ts.map +0 -1
  183. package/dist/tools/types.js +0 -5
  184. package/dist/tools/types.js.map +0 -1
package/README.md CHANGED
@@ -54,14 +54,21 @@
54
54
 
55
55
  ```bash
56
56
  codemie [COMMAND] [OPTIONS]
57
- codemie-code [MESSAGE|--task TASK] [OPTIONS]
57
+ codemie-code [MESSAGE] [OPTIONS]
58
58
  codemie-claude [-p MESSAGE] [OPTIONS]
59
- codemie-codex [MESSAGE|--task TASK] [OPTIONS]
59
+ codemie-codex [-p MESSAGE] [OPTIONS]
60
60
  codemie-gemini [-m MODEL] [-p MESSAGE] [OPTIONS]
61
61
  ```
62
62
 
63
63
  AI/Run CodeMie CLI is a professional, unified CLI tool for installing, configuring, and running multiple AI coding agents from a single interface. It includes a built-in LangGraph-based agent (CodeMie Native) and supports external agents like Claude Code, Codex, and Gemini CLI.
64
64
 
65
+ All agent shortcuts (`codemie-*`) share common configuration options:
66
+ - `--profile <name>` - Use specific provider profile
67
+ - `--model <model>` - Override model
68
+ - `--api-key <key>` - Override API key
69
+ - `--base-url <url>` - Override base URL
70
+ - `--debug` - Enable debug logging
71
+
65
72
  ## Quick Start
66
73
 
67
74
  ```bash
@@ -129,12 +136,12 @@ Ready to use immediately - no installation required:
129
136
  # Interactive conversation
130
137
  codemie-code
131
138
 
132
- # Execute single task
133
- codemie-code --task "fix bugs in src/utils"
134
-
135
139
  # Start with initial message
136
140
  codemie-code "Help me refactor this component"
137
141
 
142
+ # Execute single task (via main CLI)
143
+ codemie --task "fix bugs in src/utils"
144
+
138
145
  # Debug mode
139
146
  codemie-code --debug
140
147
  ```
@@ -147,13 +154,16 @@ Install and run external agents:
147
154
  # Install agents
148
155
  codemie install claude
149
156
  codemie install codex
157
+ codemie install gemini
150
158
 
151
- # Run via shortcuts (recommended)
152
- codemie-claude -p "Review my API code"
153
- codemie-codex --task "Generate unit tests"
159
+ # Run via direct shortcuts (recommended)
160
+ codemie-claude "Review my API code"
161
+ codemie-codex "Generate unit tests"
162
+ codemie-gemini "Optimize performance"
154
163
 
155
- # Direct shortcuts are the recommended way
156
- codemie-claude -p "Fix security issues"
164
+ # With model override
165
+ codemie-claude --model claude-4-5-sonnet "Fix security issues"
166
+ codemie-codex --model gpt-4.1 "Add type annotations"
157
167
  ```
158
168
 
159
169
  ## Commands
@@ -178,25 +188,31 @@ Direct access to agents with automatic configuration:
178
188
 
179
189
  ```bash
180
190
  # Built-in agent
181
- codemie-code [message] # Interactive or with initial message
182
- codemie-code --task "task" # Single task execution
191
+ codemie-code # Interactive mode
192
+ codemie-code "message" # Start with initial message
183
193
  codemie-code health # Health check
184
194
 
185
- # External agents
186
- codemie-claude # Claude Code agent (interactive)
187
- codemie-claude -p "message" # Claude Code agent (print mode)
188
- codemie-codex [message] # Codex agent
189
- codemie-gemini # Gemini CLI agent
195
+ # External agents (direct invocation)
196
+ codemie-claude "message" # Claude Code agent (interactive)
197
+ codemie-claude -p "message" # Claude Code agent (non-interactive/print mode)
198
+ codemie-codex "message" # Codex agent (interactive)
199
+ codemie-codex -p "message" # Codex agent (non-interactive mode)
200
+ codemie-gemini "message" # Gemini CLI agent
201
+
202
+ # With agent-specific options (pass-through to underlying CLI)
203
+ codemie-claude --context large -p "review code"
204
+ codemie-codex --temperature 0.1 -p "generate tests"
205
+ codemie-gemini -p "your prompt" # Gemini's non-interactive mode
190
206
 
191
207
  # Configuration overrides (model, API key, base URL, timeout)
192
- codemie-claude --model claude-4-5-sonnet --api-key your-key
193
- codemie-codex --model gpt-4.1 --base-url https://api.openai.com/v1
194
- codemie-gemini --model gemini-2.0-flash-exp
208
+ codemie-claude --model claude-4-5-sonnet --api-key your-key "review code"
209
+ codemie-codex --model gpt-4.1 --base-url https://api.openai.com/v1 "generate tests"
210
+ codemie-gemini -m gemini-2.5-flash "optimize performance"
195
211
 
196
212
  # Profile selection (profiles contain provider + all settings)
197
- codemie-code --profile work-litellm "task"
198
- codemie-claude --profile personal-openai -p "message"
199
- codemie-gemini --profile lite --model gemini-2.5-flash # Use LiteLLM proxy
213
+ codemie-code --profile work-litellm "analyze codebase"
214
+ codemie-claude --profile personal-openai "review PR"
215
+ codemie-gemini --profile lite --model gemini-2.5-flash "document code"
200
216
  ```
201
217
 
202
218
  ### Configuration Commands
@@ -364,7 +380,7 @@ Location: `~/.codemie/config.json`
364
380
  ```json
365
381
  {
366
382
  "provider": "litellm",
367
- "model": "claude-4-5-sonnet",
383
+ "model": "claude-sonnet-4-5",
368
384
  "baseUrl": "https://litellm.codemie.example.com",
369
385
  "apiKey": "your-api-key",
370
386
  "timeout": 300
@@ -426,7 +442,7 @@ codemie auth logout
426
442
 
427
443
  ### Token Management
428
444
 
429
- SSO tokens are automatically managed but you can control them manually:
445
+ SSO tokens are automatically managed, but you can control them manually:
430
446
 
431
447
  #### Token Refresh
432
448
 
@@ -497,16 +513,16 @@ AI/Run CodeMie SSO provides enterprise-grade features:
497
513
  codemie-code "Review this PR for security issues and performance"
498
514
 
499
515
  # Bug fixing
500
- codemie-claude -p "Fix the authentication bug in src/auth.ts"
516
+ codemie-claude "Fix the authentication bug in src/auth.ts"
501
517
 
502
518
  # Test generation
503
- codemie-codex --task "Generate comprehensive tests for the API endpoints"
519
+ codemie-codex "Generate comprehensive tests for the API endpoints"
504
520
 
505
521
  # Documentation
506
522
  codemie-code "Document the functions in utils/helpers.js"
507
523
 
508
524
  # Refactoring
509
- codemie-claude -p "Refactor this component to use React hooks"
525
+ codemie-claude "Refactor this component to use React hooks"
510
526
  ```
511
527
 
512
528
  ### Configuration Examples
@@ -522,10 +538,10 @@ codemie config test
522
538
  codemie config init
523
539
 
524
540
  # Temporary model override
525
- codemie-claude --model claude-4-5-sonnet -p "Explain this algorithm"
541
+ codemie-claude --model claude-4-5-sonnet "Explain this algorithm"
526
542
 
527
543
  # Debug mode for troubleshooting
528
- codemie-code --debug --task "analyze performance issues"
544
+ codemie-code --debug "analyze performance issues"
529
545
  ```
530
546
 
531
547
  ### Multi-Provider Workflow Examples
@@ -572,14 +588,52 @@ codemie setup
572
588
  ### Advanced Usage
573
589
 
574
590
  ```bash
575
- # Pass custom arguments to agents
591
+ # Pass custom arguments to agents (unknown options pass through)
576
592
  codemie-codex --temperature 0.1 --max-tokens 2000 "Generate clean code"
577
- codemie-claude -p "Review this code" --context large
593
+ codemie-claude --context large "Review this code"
594
+
595
+ # Non-interactive mode with -p (useful for CI/CD)
596
+ codemie-claude -p "$(cat prompt.txt)" --max-turns 50
597
+ codemie-codex -p "Generate tests for src/utils" --output json
598
+
599
+ # Debug logging (writes to ~/.codemie/debug/)
600
+ codemie-claude --debug "analyze codebase"
601
+ codemie-codex --debug "implement feature"
602
+ codemie-code --debug "test task"
603
+
604
+ # Debug logging (writes to ~/.codemie/debug/)
605
+ codemie-claude --debug "analyze codebase"
606
+ codemie-codex --debug "implement feature"
607
+ codemie-code --debug "test task"
578
608
 
579
609
  # Health checks
580
610
  codemie doctor # Full system check
581
611
  codemie-code health # Built-in agent check
582
612
  codemie-claude health # Claude agent check
613
+ codemie-gemini health # Gemini agent check
614
+ ```
615
+
616
+ ### CI/CD Integration Example
617
+
618
+ ```bash
619
+ # GitHub Actions / GitLab CI workflow example
620
+ codemie-claude \
621
+ --base-url "${CODEMIE_BASE_URL}" \
622
+ --api-key "${CODEMIE_API_KEY}" \
623
+ --model "${CODEMIE_MODEL:-claude-4-5-sonnet}" \
624
+ --provider "litellm" \
625
+ -p "$(cat /tmp/review-prompt.txt)" \
626
+ --max-turns "${CODEMIE_MAX_TURNS:-50}" \
627
+ --dangerously-skip-permissions \
628
+ --allowedTools "Bash(*),Read(*),Curl(*)" \
629
+ --debug
630
+
631
+ # Using profile for CI/CD
632
+ codemie-claude \
633
+ --profile ci-litellm \
634
+ -p "Review this PR for security issues" \
635
+ --max-turns 30 \
636
+ --debug
583
637
  ```
584
638
 
585
639
  ## Agents
@@ -599,7 +653,8 @@ LangGraph-based coding assistant with no installation required.
599
653
  **Usage:**
600
654
  ```bash
601
655
  codemie-code # Interactive mode
602
- codemie-code --task "task" # Single task
656
+ codemie-code "task" # Start with message
657
+ codemie --task "task" # Single task execution
603
658
  codemie-code --debug # Debug mode
604
659
  ```
605
660
 
@@ -614,6 +669,15 @@ Anthropic's official CLI with advanced code understanding.
614
669
  - Multi-file editing capabilities
615
670
  - Project-aware context
616
671
  - Interactive conversations
672
+ - Non-interactive mode with `-p` flag
673
+
674
+ **Usage:**
675
+ ```bash
676
+ codemie-claude # Interactive mode
677
+ codemie-claude "message" # Start with message
678
+ codemie-claude -p "message" # Non-interactive/print mode
679
+ codemie-claude health # Health check
680
+ ```
617
681
 
618
682
  ### Codex
619
683
 
@@ -625,8 +689,17 @@ OpenAI's code generation assistant optimized for completion tasks.
625
689
  - Code completion and generation
626
690
  - Function generation and bug fixing
627
691
  - Code explanation and documentation
692
+ - Non-interactive mode with `-p` flag
628
693
  - **Requires OpenAI-compatible models only**
629
694
 
695
+ **Usage:**
696
+ ```bash
697
+ codemie-codex # Interactive mode
698
+ codemie-codex "message" # Start with message
699
+ codemie-codex -p "message" # Non-interactive mode
700
+ codemie-codex health # Health check
701
+ ```
702
+
630
703
  ### Gemini CLI
631
704
 
632
705
  Google's Gemini AI coding assistant with advanced code understanding.
@@ -658,8 +731,151 @@ export GEMINI_API_KEY="your-gemini-api-key-here"
658
731
  **Usage:**
659
732
  ```bash
660
733
  codemie-gemini # Interactive mode
661
- codemie-gemini -m gemini-2.5-flash # Specify model
662
- codemie-gemini -p "your prompt" # Non-interactive mode
734
+ codemie-gemini "your prompt" # With initial message
735
+ codemie-gemini -p "your prompt" # Non-interactive mode (Gemini-specific)
736
+ codemie-gemini -m gemini-2.5-flash # Specify model (Gemini-specific)
737
+ codemie-gemini --model gemini-2.5-flash "analyze code" # With config override
738
+ ```
739
+
740
+ ## Debug Logging
741
+
742
+ All CodeMie agents support comprehensive debug logging that writes to files.
743
+
744
+ ### Enabling Debug Mode
745
+
746
+ ```bash
747
+ # Using --debug flag (recommended)
748
+ codemie-claude --debug "your task"
749
+ codemie-codex --debug "your task"
750
+ codemie-code --debug "your task"
751
+
752
+ # Using environment variable
753
+ CODEMIE_DEBUG=1 codemie-claude "your task"
754
+
755
+ # For entire session
756
+ export CODEMIE_DEBUG=1
757
+ codemie-claude "task 1"
758
+ codemie-codex "task 2"
759
+ ```
760
+
761
+ ### Debug Log Files
762
+
763
+ When debug mode is enabled, each session creates a timestamped directory:
764
+
765
+ **Location:** `~/.codemie/debug/session-<timestamp>/`
766
+
767
+ **Log Files:**
768
+ 1. **application.log** - All application activity
769
+ - Contains: Info, warnings, errors, debug messages
770
+ - Format: Plain text with timestamps
771
+ - Example: `[2025-11-27T12:30:00.000Z] [INFO] Starting agent...`
772
+
773
+ 2. **requests.jsonl** - HTTP request/response details (ai-run-sso provider only)
774
+ - Contains: Request/response headers, bodies, timing
775
+ - Format: JSONL (one JSON object per line)
776
+ - Security: Sensitive headers automatically redacted
777
+ - Example: `{"type":"request","requestId":1,"method":"POST",...}`
778
+
779
+ ### Console Output
780
+
781
+ Debug mode keeps your console clean - you'll only see:
782
+ ```bash
783
+ $ codemie-claude --debug "analyze code"
784
+ Starting Claude Code | Profile: work | Provider: ai-run-sso | Model: claude-4-5-sonnet | Debug: /Users/username/.codemie/debug/session-2025-11-27T12-30-00-000Z
785
+ ```
786
+
787
+ All debug details are written to files in the session directory.
788
+
789
+ ### Analyzing Logs
790
+
791
+ **Using command-line tools:**
792
+ ```bash
793
+ # View latest application log
794
+ tail -f ~/.codemie/debug/session-*/application.log
795
+
796
+ # Search for errors in latest session
797
+ grep ERROR ~/.codemie/debug/session-*/application.log
798
+
799
+ # Parse HTTP requests with jq
800
+ cat ~/.codemie/debug/session-*/requests.jsonl | jq 'select(.type == "request")'
801
+ ```
802
+
803
+ **Clean up old logs:**
804
+ ```bash
805
+ # Remove session directories older than 7 days
806
+ find ~/.codemie/debug -type d -name "session-*" -mtime +7 -exec rm -rf {} +
807
+
808
+ # Remove all debug logs
809
+ rm -rf ~/.codemie/debug
810
+ ```
811
+
812
+ ## Debug Logging
813
+
814
+ All CodeMie agents support comprehensive debug logging that writes to files.
815
+
816
+ ### Enabling Debug Mode
817
+
818
+ ```bash
819
+ # Using --debug flag (recommended)
820
+ codemie-claude --debug "your task"
821
+ codemie-codex --debug "your task"
822
+ codemie-code --debug "your task"
823
+
824
+ # Using environment variable
825
+ CODEMIE_DEBUG=1 codemie-claude "your task"
826
+
827
+ # For entire session
828
+ export CODEMIE_DEBUG=1
829
+ codemie-claude "task 1"
830
+ codemie-codex "task 2"
831
+ ```
832
+
833
+ ### Debug Log Files
834
+
835
+ When debug mode is enabled, logs are written to a unified session directory:
836
+
837
+ **Location:** `~/.codemie/debug/session-<timestamp>/`
838
+
839
+ 1. **application.log** - All application logs
840
+ - Contains: Info, warnings, errors, debug messages
841
+ - Format: Plain text with timestamps
842
+
843
+ 2. **requests.jsonl** - HTTP request/response details (ai-run-sso provider only)
844
+ - Contains: Request/response headers, bodies, timing
845
+ - Format: JSONL (one JSON object per line)
846
+ - Security: Sensitive headers automatically redacted
847
+
848
+ ### Console Output
849
+
850
+ Debug mode keeps your console clean - you'll only see:
851
+ ```bash
852
+ $ codemie-claude --debug "analyze code"
853
+ Starting Claude Code | Profile: default | Provider: openai | Model: claude-sonnet-4-5 | Debug: /Users/username/.codemie/debug/session-2025-11-27T12-30-00-000Z
854
+ ```
855
+
856
+ All debug details are written to files in the session directory.
857
+
858
+ ### Analyzing Logs
859
+
860
+ **Using command-line tools:**
861
+ ```bash
862
+ # View latest application log
863
+ tail -f ~/.codemie/debug/session-*/application.log
864
+
865
+ # Search for errors in latest session
866
+ grep ERROR ~/.codemie/debug/session-*/application.log
867
+
868
+ # Parse HTTP request logs with jq (ai-run-sso only)
869
+ cat ~/.codemie/debug/session-*/requests.jsonl | jq 'select(.type == "request")'
870
+ ```
871
+
872
+ **Clean up old logs:**
873
+ ```bash
874
+ # Remove logs older than 7 days
875
+ find ~/.codemie/debug -name "session-*" -mtime +7 -delete
876
+
877
+ # Remove all debug logs
878
+ rm -rf ~/.codemie/debug
663
879
  ```
664
880
 
665
881
  ## Troubleshooting
@@ -733,19 +949,21 @@ When you see "Model not compatible" errors:
733
949
 
734
950
  ```
735
951
  codemie-code/
736
- ├── bin/ # Executable entry points
737
- │ ├── codemie.js # Main CLI
738
- ├── codemie-code.js # Built-in agent
739
- │ ├── codemie-claude.js # Claude shortcut
740
- │ └── codemie-codex.js # Codex shortcut
952
+ ├── bin/ # Executable entry points
953
+ │ ├── codemie.js # Main CLI
954
+ └── agent-executor.js # Universal agent executor (all shortcuts)
741
955
  ├── src/
742
- │ ├── agents/ # Agent registry and adapters
743
- │ ├── cli/ # CLI command implementations
744
- │ ├── env/ # Environment and config management
745
- ├── workflows/ # Workflow management
746
- │ ├── tools/ # VCS tools management
747
- │ └── utils/ # Shared utilities
748
- └── tests/ # Test files
956
+ │ ├── agents/ # Agent system
957
+ ├── core/ # Core agent abstractions
958
+ ├── plugins/ # Plugin-based adapters (claude, codex, gemini, codemie-code)
959
+ │ └── codemie-code/ # Built-in agent implementation
960
+ │ ├── cli/ # CLI commands
961
+ └── commands/ # Command implementations (setup, doctor, workflow, etc.)
962
+ │ ├── env/ # Configuration management
963
+ │ ├── workflows/ # CI/CD workflow management
964
+ │ │ └── templates/ # Workflow templates (GitHub Actions, GitLab CI)
965
+ │ └── utils/ # Shared utilities
966
+ └── tests/ # Test files
749
967
  ```
750
968
 
751
969
  ### Building
@@ -19,12 +19,14 @@ import { logger } from '../dist/utils/logger.js';
19
19
 
20
20
  // Detect agent from executable name
21
21
  // /usr/local/bin/codemie-claude → 'claude'
22
- // /usr/local/bin/codemie-code → 'codemie-code' (special case)
22
+ // /usr/local/bin/codemie-code → 'codemie-code' (special case for built-in agent)
23
+ // NOTE: 'codemie-code' constant defined in src/agents/plugins/codemie-code.plugin.ts
23
24
  const executableName = basename(process.argv[1]);
25
+ const BUILTIN_AGENT_NAME = 'codemie-code';
24
26
 
25
27
  let agentName;
26
- if (executableName === 'codemie-code') {
27
- agentName = 'codemie-code'; // Keep full name for built-in agent
28
+ if (executableName === BUILTIN_AGENT_NAME) {
29
+ agentName = BUILTIN_AGENT_NAME; // Keep full name for built-in agent
28
30
  } else {
29
31
  agentName = executableName.replace('codemie-', ''); // Strip prefix for external agents
30
32
  }
@@ -33,7 +35,7 @@ if (executableName === 'codemie-code') {
33
35
  const agent = AgentRegistry.getAgent(agentName);
34
36
 
35
37
  if (!agent) {
36
- logger.error(`Unknown agent: ${agentName}`);
38
+ logger.error(`Unknown agent '${agentName}'`);
37
39
  console.log('Available agents:', AgentRegistry.getAgentNames().join(', '));
38
40
  process.exit(1);
39
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agents/codemie-code/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAA6B,MAAM,YAAY,CAAC;AACtG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAO/D,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,KAAK,CAYX;gBAEU,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE;IAmB1D;;OAEG;IACH,OAAO,CAAC,SAAS;IA6LjB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAE,cAAc,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuOvG;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4F1B;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BtD;;OAEG;IACH,YAAY,IAAI,IAAI;IA4BpB;;OAEG;IACH,UAAU,IAAI,WAAW,EAAE;IAI3B;;OAEG;IACH,QAAQ,IAAI,UAAU;IAItB;;OAEG;IACH,QAAQ,IAAI,cAAc,EAAE;IAI5B;;OAEG;IACH,SAAS,IAAI,aAAa;IAQ1B;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;QAC3B,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;QAChC,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAsBF;;OAEG;IACH,OAAO,CAAC,YAAY;IA8BpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAuBrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAUpB;;OAEG;IACH,OAAO,CAAC,yBAAyB;CAclC"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agents/codemie-code/agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAA6B,MAAM,YAAY,CAAC;AACtG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAQ/D,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,YAAY,CAA+C;IACnE,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,KAAK,CAYX;gBAEU,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE;IAmB1D;;OAEG;IACH,OAAO,CAAC,SAAS;IA6LjB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA2B1B;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAE,cAAc,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAuOvG;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4F1B;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BtD;;OAEG;IACH,YAAY,IAAI,IAAI;IA4BpB;;OAEG;IACH,UAAU,IAAI,WAAW,EAAE;IAI3B;;OAEG;IACH,QAAQ,IAAI,UAAU;IAItB;;OAEG;IACH,QAAQ,IAAI,cAAc,EAAE;IAI5B;;OAEG;IACH,SAAS,IAAI,aAAa;IAQ1B;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC;QAC3B,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;QAChC,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAsBF;;OAEG;IACH,OAAO,CAAC,YAAY;IA8BpB;;OAEG;IACH,OAAO,CAAC,aAAa;IAuBrB;;OAEG;IACH,OAAO,CAAC,YAAY;IAUpB;;OAEG;IACH,OAAO,CAAC,yBAAyB;CAclC"}
@@ -11,6 +11,7 @@ import { CodeMieAgentError } from './types.js';
11
11
  import { extractToolMetadata } from './toolMetadata.js';
12
12
  import { extractTokenUsageFromStreamChunk, extractTokenUsageFromFinalState } from './tokenUtils.js';
13
13
  import { setGlobalToolEventCallback } from './tools/index.js';
14
+ import { logger } from '../../utils/logger.js';
14
15
  export class CodeMieAgent {
15
16
  agent;
16
17
  config;
@@ -46,7 +47,7 @@ export class CodeMieAgent {
46
47
  messageModifier: getSystemPrompt(config.workingDirectory)
47
48
  });
48
49
  if (config.debug) {
49
- console.log(`[DEBUG] CodeMie Agent initialized with ${tools.length} tools`);
50
+ logger.debug(`CodeMie Agent initialized with ${tools.length} tools`);
50
51
  }
51
52
  }
52
53
  /**
@@ -139,8 +140,8 @@ export class CodeMieAgent {
139
140
  // Check if we have SSO cookies to inject (following codemie-ide-plugin pattern)
140
141
  const ssoCookies = global.codemieSSOCookies;
141
142
  if (this.config.debug) {
142
- console.log(`[DEBUG] SSO Cookies available:`, ssoCookies ? Object.keys(ssoCookies) : 'none');
143
- console.log(`[DEBUG] Auth token:`, this.config.authToken);
143
+ logger.debug(`SSO Cookies available:`, ssoCookies ? Object.keys(ssoCookies) : 'none');
144
+ logger.debug(`Auth token:`, this.config.authToken);
144
145
  }
145
146
  if (ssoCookies && this.config.authToken === 'sso-authenticated') {
146
147
  // Create custom fetch function that includes SSO cookies (matches oauth2Proxy.js line 134)
@@ -163,23 +164,23 @@ export class CodeMieAgent {
163
164
  // that matches how codemie-claude works through SSO Gateway
164
165
  process.removeAllListeners('warning');
165
166
  if (this.config.debug) {
166
- console.log('[DEBUG] Disabled SSL verification (like SSO Gateway and codemie-model-fetcher)');
167
+ logger.debug('Disabled SSL verification (like SSO Gateway and codemie-model-fetcher)');
167
168
  }
168
169
  if (this.config.debug) {
169
- console.log(`[DEBUG] SSO request to ${input}`);
170
- console.log(`[DEBUG] Cookies: ${Object.keys(ssoCookies).join(', ')}`);
171
- console.log(`[DEBUG] Full cookie string length: ${cookieString.length}`);
170
+ logger.debug(`SSO request to ${input}`);
171
+ logger.debug(`Cookies: ${Object.keys(ssoCookies).join(', ')}`);
172
+ logger.debug(`Full cookie string length: ${cookieString.length}`);
172
173
  }
173
174
  try {
174
175
  const response = await fetch(input, updatedInit);
175
176
  if (this.config.debug && !response.ok) {
176
- console.log(`[DEBUG] SSO request failed: ${response.status} ${response.statusText}`);
177
+ logger.debug(`SSO request failed: ${response.status} ${response.statusText}`);
177
178
  }
178
179
  return response;
179
180
  }
180
181
  catch (error) {
181
182
  if (this.config.debug) {
182
- console.log(`[DEBUG] SSO request error:`, error);
183
+ logger.debug(`SSO request error:`, error);
183
184
  }
184
185
  throw error;
185
186
  }
@@ -198,13 +199,13 @@ export class CodeMieAgent {
198
199
  }
199
200
  };
200
201
  if (this.config.debug) {
201
- console.log(`[DEBUG] Non-SSO LiteLLM request to ${input}`);
202
- console.log(`[DEBUG] Authorization header set with API key`);
202
+ logger.debug(`Non-SSO LiteLLM request to ${input}`);
203
+ logger.debug(`Authorization header set with API key`);
203
204
  }
204
205
  return fetch(input, updatedInit);
205
206
  };
206
207
  if (this.config.debug) {
207
- console.log(`[DEBUG] LiteLLM provider configured with API key authentication`);
208
+ logger.debug(`LiteLLM provider configured with API key authentication`);
208
209
  }
209
210
  }
210
211
  return new ChatOpenAI({
@@ -270,7 +271,7 @@ export class CodeMieAgent {
270
271
  const originalSigintHandler = process.listeners('SIGINT');
271
272
  const sigintHandler = () => {
272
273
  if (this.config.debug) {
273
- console.log('\n[DEBUG] Received SIGINT - aborting stream...');
274
+ logger.debug('\nReceived SIGINT - aborting stream...');
274
275
  }
275
276
  streamAborted = true;
276
277
  abortController.abort();
@@ -279,7 +280,7 @@ export class CodeMieAgent {
279
280
  process.once('SIGINT', sigintHandler);
280
281
  try {
281
282
  if (this.config.debug) {
282
- console.log(`[DEBUG] Processing message: ${message.substring(0, 100)}...`);
283
+ logger.debug(`Processing message: ${message.substring(0, 100)}...`);
283
284
  }
284
285
  // Add user message to conversation history (with optional images)
285
286
  const userMessage = this.createHumanMessage(message, images);
@@ -300,7 +301,7 @@ export class CodeMieAgent {
300
301
  // Check if stream was aborted
301
302
  if (streamAborted || abortController.signal.aborted) {
302
303
  if (this.config.debug) {
303
- console.log('[DEBUG] Stream processing aborted');
304
+ logger.debug('Stream processing aborted');
304
305
  }
305
306
  break;
306
307
  }
@@ -313,7 +314,7 @@ export class CodeMieAgent {
313
314
  // Store token usage to associate with next tool call
314
315
  this.currentLLMTokenUsage = tokenUsage;
315
316
  if (this.config.debug) {
316
- console.log(`[DEBUG] Token usage: ${tokenUsage.inputTokens} in, ${tokenUsage.outputTokens} out`);
317
+ logger.debug(`Token usage: ${tokenUsage.inputTokens} in, ${tokenUsage.outputTokens} out`);
317
318
  }
318
319
  }
319
320
  this.processStreamChunk(chunk, onEvent, (toolStarted) => {
@@ -374,7 +375,7 @@ export class CodeMieAgent {
374
375
  catch {
375
376
  // If getState fails, continue without updating history
376
377
  if (this.config.debug) {
377
- console.log('[DEBUG] Could not get final state, continuing...');
378
+ logger.debug('Could not get final state, continuing...');
378
379
  }
379
380
  }
380
381
  // Finalize execution statistics
@@ -384,9 +385,9 @@ export class CodeMieAgent {
384
385
  onEvent({ type: 'thinking_end' });
385
386
  onEvent({ type: 'complete' });
386
387
  if (this.config.debug) {
387
- console.log(`[DEBUG] Agent completed in ${this.stats.executionTime}ms`);
388
- console.log(`[DEBUG] Total tokens: ${this.stats.totalTokens} (${this.stats.inputTokens} in, ${this.stats.outputTokens} out)`);
389
- console.log(`[DEBUG] Estimated cost: $${this.stats.estimatedTotalCost.toFixed(4)}`);
388
+ logger.debug(`Agent completed in ${this.stats.executionTime}ms`);
389
+ logger.debug(`Total tokens: ${this.stats.totalTokens} (${this.stats.inputTokens} in, ${this.stats.outputTokens} out)`);
390
+ logger.debug(`Estimated cost: $${this.stats.estimatedTotalCost.toFixed(4)}`);
390
391
  }
391
392
  }
392
393
  catch (error) {
@@ -398,7 +399,7 @@ export class CodeMieAgent {
398
399
  // Handle AbortError from user interruption gracefully
399
400
  if (error instanceof Error && (error.name === 'AbortError' || streamAborted)) {
400
401
  if (this.config.debug) {
401
- console.log('[DEBUG] Stream aborted by user');
402
+ logger.debug('Stream aborted by user');
402
403
  }
403
404
  onEvent({
404
405
  type: 'error',
@@ -407,7 +408,7 @@ export class CodeMieAgent {
407
408
  return; // Don't throw error for user interruptions
408
409
  }
409
410
  if (this.config.debug) {
410
- console.error(`[DEBUG] Agent error:`, error);
411
+ logger.debug(`Agent error:`, error);
411
412
  }
412
413
  onEvent({
413
414
  type: 'error',
@@ -497,7 +498,7 @@ export class CodeMieAgent {
497
498
  }
498
499
  catch (error) {
499
500
  if (this.config.debug) {
500
- console.error(`[DEBUG] Error processing stream chunk:`, error);
501
+ logger.debug(`Error processing stream chunk:`, error);
501
502
  }
502
503
  // Don't throw here, just log - let the main stream continue
503
504
  onEvent({
@@ -556,7 +557,7 @@ export class CodeMieAgent {
556
557
  executionSteps: []
557
558
  };
558
559
  if (this.config.debug) {
559
- console.log('[DEBUG] Conversation history cleared');
560
+ logger.debug('Conversation history cleared');
560
561
  }
561
562
  }
562
563
  /**
@@ -635,7 +636,7 @@ export class CodeMieAgent {
635
636
  this.currentExecutionSteps.push(step);
636
637
  this.stats.llmCalls++;
637
638
  if (this.config.debug) {
638
- console.log(`[DEBUG] Started LLM step ${step.stepNumber} (${llmContext})`);
639
+ logger.debug(`Started LLM step ${step.stepNumber} (${llmContext})`);
639
640
  }
640
641
  return step;
641
642
  }
@@ -654,10 +655,10 @@ export class CodeMieAgent {
654
655
  // Get the stored tool args for enhanced logging
655
656
  const toolArgs = this.toolCallArgs.get(toolName);
656
657
  if (toolArgs && Object.keys(toolArgs).length > 0) {
657
- console.log(`[DEBUG] Started tool step ${step.stepNumber}: ${toolName} ${JSON.stringify(toolArgs)}`);
658
+ logger.debug(`Started tool step ${step.stepNumber}: ${toolName} ${JSON.stringify(toolArgs)}`);
658
659
  }
659
660
  else {
660
- console.log(`[DEBUG] Started tool step ${step.stepNumber}: ${toolName}`);
661
+ logger.debug(`Started tool step ${step.stepNumber}: ${toolName}`);
661
662
  }
662
663
  }
663
664
  return step;
@@ -670,7 +671,7 @@ export class CodeMieAgent {
670
671
  step.duration = step.endTime - step.startTime;
671
672
  if (this.config.debug) {
672
673
  const type = step.type === 'llm_call' ? 'LLM' : `Tool (${step.toolName})`;
673
- console.log(`[DEBUG] Completed ${type} step ${step.stepNumber} in ${step.duration}ms`);
674
+ logger.debug(`Completed ${type} step ${step.stepNumber} in ${step.duration}ms`);
674
675
  }
675
676
  }
676
677
  /**