@codemieai/code 0.0.12 → 0.0.13

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 (124) hide show
  1. package/README.md +65 -778
  2. package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
  3. package/dist/agents/core/BaseAgentAdapter.js +31 -3
  4. package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
  5. package/dist/agents/core/types.d.ts +18 -0
  6. package/dist/agents/core/types.d.ts.map +1 -1
  7. package/dist/agents/plugins/claude.plugin.d.ts +0 -3
  8. package/dist/agents/plugins/claude.plugin.d.ts.map +1 -1
  9. package/dist/agents/plugins/claude.plugin.js +12 -1
  10. package/dist/agents/plugins/claude.plugin.js.map +1 -1
  11. package/dist/agents/plugins/codex.plugin.d.ts.map +1 -1
  12. package/dist/agents/plugins/codex.plugin.js +40 -4
  13. package/dist/agents/plugins/codex.plugin.js.map +1 -1
  14. package/dist/agents/plugins/gemini.plugin.d.ts.map +1 -1
  15. package/dist/agents/plugins/gemini.plugin.js +50 -5
  16. package/dist/agents/plugins/gemini.plugin.js.map +1 -1
  17. package/dist/agents/registry.d.ts +15 -2
  18. package/dist/agents/registry.d.ts.map +1 -1
  19. package/dist/agents/registry.js +30 -6
  20. package/dist/agents/registry.js.map +1 -1
  21. package/dist/analytics/aggregation/adapters/claude.adapter.d.ts +37 -0
  22. package/dist/analytics/aggregation/adapters/claude.adapter.d.ts.map +1 -0
  23. package/dist/analytics/aggregation/adapters/claude.adapter.js +471 -0
  24. package/dist/analytics/aggregation/adapters/claude.adapter.js.map +1 -0
  25. package/dist/analytics/aggregation/adapters/codex.adapter.d.ts +25 -0
  26. package/dist/analytics/aggregation/adapters/codex.adapter.d.ts.map +1 -0
  27. package/dist/analytics/aggregation/adapters/codex.adapter.js +376 -0
  28. package/dist/analytics/aggregation/adapters/codex.adapter.js.map +1 -0
  29. package/dist/analytics/aggregation/adapters/gemini.adapter.d.ts +28 -0
  30. package/dist/analytics/aggregation/adapters/gemini.adapter.d.ts.map +1 -0
  31. package/dist/analytics/aggregation/adapters/gemini.adapter.js +320 -0
  32. package/dist/analytics/aggregation/adapters/gemini.adapter.js.map +1 -0
  33. package/dist/analytics/aggregation/adapters/index.d.ts +7 -0
  34. package/dist/analytics/aggregation/adapters/index.d.ts.map +1 -0
  35. package/dist/analytics/aggregation/adapters/index.js +7 -0
  36. package/dist/analytics/aggregation/adapters/index.js.map +1 -0
  37. package/dist/analytics/aggregation/aggregator.d.ts +49 -0
  38. package/dist/analytics/aggregation/aggregator.d.ts.map +1 -0
  39. package/dist/analytics/aggregation/aggregator.js +239 -0
  40. package/dist/analytics/aggregation/aggregator.js.map +1 -0
  41. package/dist/analytics/aggregation/core/BaseAnalyticsAdapter.d.ts +63 -0
  42. package/dist/analytics/aggregation/core/BaseAnalyticsAdapter.d.ts.map +1 -0
  43. package/dist/analytics/aggregation/core/BaseAnalyticsAdapter.js +58 -0
  44. package/dist/analytics/aggregation/core/BaseAnalyticsAdapter.js.map +1 -0
  45. package/dist/analytics/aggregation/core/adapter.interface.d.ts +65 -0
  46. package/dist/analytics/aggregation/core/adapter.interface.d.ts.map +1 -0
  47. package/dist/analytics/aggregation/core/adapter.interface.js +9 -0
  48. package/dist/analytics/aggregation/core/adapter.interface.js.map +1 -0
  49. package/dist/analytics/aggregation/core/aggregation-utils.d.ts +66 -0
  50. package/dist/analytics/aggregation/core/aggregation-utils.d.ts.map +1 -0
  51. package/dist/analytics/aggregation/core/aggregation-utils.js +83 -0
  52. package/dist/analytics/aggregation/core/aggregation-utils.js.map +1 -0
  53. package/dist/analytics/aggregation/core/discovery.d.ts +40 -0
  54. package/dist/analytics/aggregation/core/discovery.d.ts.map +1 -0
  55. package/dist/analytics/aggregation/core/discovery.js +132 -0
  56. package/dist/analytics/aggregation/core/discovery.js.map +1 -0
  57. package/dist/analytics/aggregation/core/file-utils.d.ts +23 -0
  58. package/dist/analytics/aggregation/core/file-utils.d.ts.map +1 -0
  59. package/dist/analytics/aggregation/core/file-utils.js +208 -0
  60. package/dist/analytics/aggregation/core/file-utils.js.map +1 -0
  61. package/dist/analytics/aggregation/core/index.d.ts +11 -0
  62. package/dist/analytics/aggregation/core/index.d.ts.map +1 -0
  63. package/dist/analytics/aggregation/core/index.js +11 -0
  64. package/dist/analytics/aggregation/core/index.js.map +1 -0
  65. package/dist/analytics/aggregation/core/project-mapping.d.ts +50 -0
  66. package/dist/analytics/aggregation/core/project-mapping.d.ts.map +1 -0
  67. package/dist/analytics/aggregation/core/project-mapping.js +102 -0
  68. package/dist/analytics/aggregation/core/project-mapping.js.map +1 -0
  69. package/dist/analytics/aggregation/core/streaming.d.ts +26 -0
  70. package/dist/analytics/aggregation/core/streaming.d.ts.map +1 -0
  71. package/dist/analytics/aggregation/core/streaming.js +58 -0
  72. package/dist/analytics/aggregation/core/streaming.js.map +1 -0
  73. package/dist/analytics/aggregation/index.d.ts +8 -0
  74. package/dist/analytics/aggregation/index.d.ts.map +1 -0
  75. package/dist/analytics/aggregation/index.js +8 -0
  76. package/dist/analytics/aggregation/index.js.map +1 -0
  77. package/dist/analytics/aggregation/types.d.ts +258 -0
  78. package/dist/analytics/aggregation/types.d.ts.map +1 -0
  79. package/dist/analytics/aggregation/types.js +8 -0
  80. package/dist/analytics/aggregation/types.js.map +1 -0
  81. package/dist/analytics/config.d.ts +1 -0
  82. package/dist/analytics/config.d.ts.map +1 -1
  83. package/dist/analytics/config.js +20 -1
  84. package/dist/analytics/config.js.map +1 -1
  85. package/dist/analytics/index.d.ts +0 -9
  86. package/dist/analytics/index.d.ts.map +1 -1
  87. package/dist/analytics/index.js +14 -48
  88. package/dist/analytics/index.js.map +1 -1
  89. package/dist/analytics/plugins/api-metrics.plugin.d.ts +4 -1
  90. package/dist/analytics/plugins/api-metrics.plugin.d.ts.map +1 -1
  91. package/dist/analytics/plugins/api-metrics.plugin.js +6 -22
  92. package/dist/analytics/plugins/api-metrics.plugin.js.map +1 -1
  93. package/dist/analytics/plugins/model-metrics.plugin.d.ts +4 -1
  94. package/dist/analytics/plugins/model-metrics.plugin.d.ts.map +1 -1
  95. package/dist/analytics/plugins/model-metrics.plugin.js +7 -17
  96. package/dist/analytics/plugins/model-metrics.plugin.js.map +1 -1
  97. package/dist/analytics/plugins/provider-metrics.plugin.d.ts +4 -1
  98. package/dist/analytics/plugins/provider-metrics.plugin.d.ts.map +1 -1
  99. package/dist/analytics/plugins/provider-metrics.plugin.js +7 -22
  100. package/dist/analytics/plugins/provider-metrics.plugin.js.map +1 -1
  101. package/dist/analytics/plugins/types.d.ts +0 -2
  102. package/dist/analytics/plugins/types.d.ts.map +1 -1
  103. package/dist/analytics/plugins/types.js.map +1 -1
  104. package/dist/analytics/session.d.ts +2 -2
  105. package/dist/analytics/session.d.ts.map +1 -1
  106. package/dist/analytics/session.js +3 -3
  107. package/dist/analytics/session.js.map +1 -1
  108. package/dist/analytics/types.d.ts +1 -1
  109. package/dist/analytics/types.d.ts.map +1 -1
  110. package/dist/cli/commands/analytics.d.ts.map +1 -1
  111. package/dist/cli/commands/analytics.js +512 -252
  112. package/dist/cli/commands/analytics.js.map +1 -1
  113. package/dist/cli/commands/setup.js +70 -1
  114. package/dist/cli/commands/setup.js.map +1 -1
  115. package/dist/utils/codemie-proxy.d.ts.map +1 -1
  116. package/dist/utils/codemie-proxy.js +16 -3
  117. package/dist/utils/codemie-proxy.js.map +1 -1
  118. package/dist/utils/proxy/http-client.d.ts.map +1 -1
  119. package/dist/utils/proxy/http-client.js +8 -2
  120. package/dist/utils/proxy/http-client.js.map +1 -1
  121. package/dist/utils/proxy/interceptors.d.ts.map +1 -1
  122. package/dist/utils/proxy/interceptors.js +4 -15
  123. package/dist/utils/proxy/interceptors.js.map +1 -1
  124. package/package.json +6 -2
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # AI/Run CodeMie CLI
2
2
 
3
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/codemie-ai/codemie-code/ci.yml?branch=main)](https://github.com/codemie-ai/codemie-code/actions/workflows/ci.yml)
3
4
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
5
  [![npm version](https://img.shields.io/npm/v/@codemieai/code.svg)](https://www.npmjs.com/package/@codemieai/code)
5
6
  [![Node.js Version](https://img.shields.io/badge/node-%3E%3D24.0.0-brightgreen.svg)](https://nodejs.org/)
@@ -7,85 +8,26 @@
7
8
 
8
9
  > **Unified AI Coding Assistant CLI** - Manage Claude Code, OpenAI Codex, Google Gemini, and custom AI agents from one powerful command-line interface. Multi-provider support (OpenAI, Azure OpenAI, AWS Bedrock, LiteLLM, Enterprise SSO). Built-in LangGraph agent with file operations, git integration, and advanced code generation.
9
10
 
10
- ## Why CodeMie CLI?
11
+ * * * * *
11
12
 
12
- **The all-in-one AI coding assistant for developers**
13
-
14
- ✨ **One CLI, Multiple AI Agents** - Switch between Claude Code, Codex, Gemini, and more
15
- 🔄 **Multi-Provider Support** - OpenAI, Azure, Bedrock, LiteLLM, Enterprise SSO
16
- 🚀 **Built-in Agent** - LangGraph-based assistant with file operations & git integration
17
- 🔐 **Enterprise Ready** - SSO authentication, audit logging, role-based access
18
- ⚡ **Productivity Boost** - Code review, refactoring, test generation, bug fixing
19
- 🎯 **Profile Management** - Manage work, personal, and team configurations separately
20
-
21
- Perfect for developers seeking a **GitHub Copilot alternative**, **Cursor alternative**, or unified interface for AI-powered coding assistance.
22
-
23
- ## Table of Contents
24
-
25
- - [Synopsis](#synopsis)
26
- - [Quick Start](#quick-start)
27
- - [Installation](#installation)
28
- - [From npm (Recommended)](#from-npm-recommended)
29
- - [From Source (Development)](#from-source-development)
30
- - [Verify Installation](#verify-installation)
31
- - [Usage](#usage)
32
- - [Built-in Agent (CodeMie Native)](#built-in-agent-codemie-native)
33
- - [External Agents](#external-agents)
34
- - [Commands](#commands)
35
- - [Core Commands](#core-commands)
36
- - [Agent Shortcuts](#agent-shortcuts)
37
- - [Configuration Commands](#configuration-commands)
38
- - [Profile Management Commands](#profile-management-commands)
39
- - [Configuration](#configuration)
40
- - [Setup Wizard (Recommended)](#setup-wizard-recommended)
41
- - [Multi-Provider Profiles](#multi-provider-profiles)
42
- - [Supported Providers](#supported-providers)
43
- - [Manual Configuration](#manual-configuration)
44
- - [Model Compatibility](#model-compatibility)
45
- - [Authentication & SSO Management](#authentication--sso-management)
46
- - [AI/Run CodeMie SSO Setup](#airun-codemie-sso-setup)
47
- - [Token Management](#token-management)
48
- - [Enterprise SSO Features](#enterprise-sso-features)
49
- - [Examples](#examples)
50
- - [Common Workflows](#common-workflows)
51
- - [Configuration Examples](#configuration-examples)
52
- - [Advanced Usage](#advanced-usage)
53
- - [Agents](#agents)
54
- - [CodeMie Native (Built-in)](#codemie-native-built-in)
55
- - [Claude Code](#claude-code)
56
- - [Codex](#codex)
57
- - [Gemini CLI](#gemini-cli)
58
- - [Deep Agents CLI](#deep-agents-cli)
59
- - [Troubleshooting](#troubleshooting)
60
- - [Command Not Found](#command-not-found)
61
- - [Configuration Issues](#configuration-issues)
62
- - [Connection Problems](#connection-problems)
63
- - [Agent Installation Failures](#agent-installation-failures)
64
- - [Model Compatibility Errors](#model-compatibility-errors)
65
- - [Development](#development)
66
- - [Project Structure](#project-structure)
67
- - [Building](#building)
68
- - [Testing](#testing)
69
- - [License](#license)
70
- - [Links](#links)
71
-
72
- ## Synopsis
13
+ **(Suggestion: Add a GIF or screenshot of the CLI in action here)**
73
14
 
74
- ```bash
75
- codemie [COMMAND] [OPTIONS]
76
- codemie-code [MESSAGE] [OPTIONS]
77
- codemie-claude [-p MESSAGE] [OPTIONS]
78
- codemie-codex [-p MESSAGE] [OPTIONS]
79
- codemie-gemini [-m MODEL] [-p MESSAGE] [OPTIONS]
80
- ```
15
+ * * * * *
16
+
17
+ ## Why CodeMie CLI?
18
+
19
+ CodeMie CLI is the all-in-one AI coding assistant for developers.
81
20
 
82
- 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.
21
+ **One CLI, Multiple AI Agents** - Switch between Claude Code, Codex, Gemini, Deep Agents, and built-in agent.
22
+ 🔄 **Multi-Provider Support** - OpenAI, Azure, Bedrock, LiteLLM, Google Gemini, and Enterprise SSO.
23
+ 🚀 **Built-in Agent** - A powerful LangGraph-based assistant with file operations and git integration.
24
+ 🔐 **Enterprise Ready** - SSO authentication, audit logging, and role-based access.
25
+ ⚡ **Productivity Boost** - Code review, refactoring, test generation, and bug fixing.
26
+ 🎯 **Profile Management** - Manage work, personal, and team configurations separately.
27
+ 📊 **Usage Analytics** - Track and analyze AI usage across all agents with detailed insights.
28
+ 🔧 **CI/CD Workflows** - Automated code review, fixes, and feature implementation.
83
29
 
84
- All agent shortcuts (`codemie-*`) share common configuration options:
85
- - `--profile <name>` - Use specific provider profile
86
- - `--model <model>` - Override model
87
- - `--api-key <key>` - Override API key
88
- - `--base-url <url>` - Override base URL
30
+ Perfect for developers seeking a powerful alternative to GitHub Copilot or Cursor.
89
31
 
90
32
  ## Quick Start
91
33
 
@@ -96,29 +38,12 @@ npm install -g @codemieai/code
96
38
  # 2. Setup (interactive wizard)
97
39
  codemie setup
98
40
 
99
- # 3. View supported agents
100
- codemie list
101
-
102
- # 4. Install external agents (optional)
103
- codemie install claude # Claude Code
104
- codemie install codex # OpenAI Codex
105
- codemie install gemini # Google Gemini CLI
106
-
107
- # 5. Manage profiles (multi-provider support)
108
- codemie profile list # List all profiles
109
- codemie profile switch work # Switch to different profile
110
- codemie setup # Add new profile or update existing
111
-
112
- # 6. Start coding with built-in agent
41
+ # 3. Start coding with the built-in agent
113
42
  codemie-code "Review my code for bugs"
114
43
 
115
- # 7. Use external agents
44
+ # 4. Install and use other agents
45
+ codemie install claude
116
46
  codemie-claude "Refactor this function"
117
- codemie-codex "Add unit tests"
118
- codemie-gemini "Optimize performance"
119
-
120
- # 8. Use specific profile for a task
121
- codemie-code --profile work "Deploy to production"
122
47
  ```
123
48
 
124
49
  ## Installation
@@ -129,13 +54,13 @@ codemie-code --profile work "Deploy to production"
129
54
  npm install -g @codemieai/code
130
55
  ```
131
56
 
132
- ### From Source (Development)
57
+ ### From Source
133
58
 
134
59
  ```bash
135
60
  git clone https://github.com/codemie-ai/codemie-code.git
136
61
  cd codemie-code
137
- npm install # Installs all dependencies
138
- npm run build && npm link # Build and link globally
62
+ npm install
63
+ npm run build && npm link
139
64
  ```
140
65
 
141
66
  ### Verify Installation
@@ -147,732 +72,94 @@ codemie doctor
147
72
 
148
73
  ## Usage
149
74
 
75
+ The CodeMie CLI provides two ways to interact with AI agents:
76
+
150
77
  ### Built-in Agent (CodeMie Native)
151
78
 
152
- Ready to use immediately - no installation required:
79
+ The built-in agent is ready to use immediately and is great for a wide range of coding tasks.
153
80
 
154
81
  ```bash
155
- # Interactive conversation
82
+ # Start an interactive conversation
156
83
  codemie-code
157
84
 
158
- # Start with initial message
85
+ # Start with an initial message
159
86
  codemie-code "Help me refactor this component"
160
-
161
- # Execute single task (via main CLI)
162
- codemie --task "fix bugs in src/utils"
163
87
  ```
164
88
 
165
89
  ### External Agents
166
90
 
167
- Install and run external agents:
91
+ You can also install and use external agents like Claude Code, Codex, and Gemini.
168
92
 
169
93
  ```bash
170
- # Install agents
94
+ # Install an agent
171
95
  codemie install claude
172
- codemie install codex
173
- codemie install gemini
174
96
 
175
- # Run via direct shortcuts (recommended)
97
+ # Use the agent
176
98
  codemie-claude "Review my API code"
177
- codemie-codex "Generate unit tests"
178
- codemie-gemini "Optimize performance"
179
-
180
- # With model override
181
- codemie-claude --model claude-4-5-sonnet "Fix security issues"
182
- codemie-codex --model gpt-4.1 "Add type annotations"
183
99
  ```
184
100
 
185
- ## Commands
186
-
187
- ### Core Commands
188
-
189
- ```bash
190
- codemie setup # Interactive configuration wizard
191
- codemie profile <command> # Manage provider profiles
192
- codemie auth <command> # Manage SSO authentication
193
- codemie list # List all available agents
194
- codemie install <agent> # Install an agent
195
- codemie uninstall <agent> # Uninstall an agent
196
- codemie doctor # Health check and diagnostics
197
- codemie config <action> # Manage configuration
198
- codemie version # Show version information
199
- ```
200
-
201
- ### Agent Shortcuts
202
-
203
- Direct access to agents with automatic configuration:
101
+ For more detailed information on the available agents, see the [Agents Documentation](docs/AGENTS.md).
204
102
 
205
- ```bash
206
- # Built-in agent
207
- codemie-code # Interactive mode
208
- codemie-code "message" # Start with initial message
209
- codemie-code health # Health check
210
-
211
- # External agents (direct invocation)
212
- codemie-claude "message" # Claude Code agent (interactive)
213
- codemie-claude -p "message" # Claude Code agent (non-interactive/print mode)
214
- codemie-codex "message" # Codex agent (interactive)
215
- codemie-codex -p "message" # Codex agent (non-interactive mode)
216
- codemie-gemini "message" # Gemini CLI agent
217
- codemie-deepagents "message" # Deep Agents CLI agent
218
-
219
- # With agent-specific options (pass-through to underlying CLI)
220
- codemie-claude --context large -p "review code"
221
- codemie-codex --temperature 0.1 -p "generate tests"
222
- codemie-gemini -p "your prompt" # Gemini's non-interactive mode
223
-
224
- # Configuration overrides (model, API key, base URL, timeout)
225
- codemie-claude --model claude-4-5-sonnet --api-key your-key "review code"
226
- codemie-codex --model gpt-4.1 --base-url https://api.openai.com/v1 "generate tests"
227
- codemie-gemini -m gemini-2.5-flash "optimize performance"
228
-
229
- # Profile selection (profiles contain provider + all settings)
230
- codemie-code --profile work-litellm "analyze codebase"
231
- codemie-claude --profile personal-openai "review PR"
232
- codemie-gemini --profile lite --model gemini-2.5-flash "document code"
233
- ```
103
+ ## Commands
234
104
 
235
- ### Configuration Commands
105
+ The CodeMie CLI has a rich set of commands for managing agents, configuration, and more.
236
106
 
237
107
  ```bash
238
- codemie config show # Show current configuration with sources
239
- codemie config list # List all available parameters
240
- codemie config test # Test connection with current configuration
241
- codemie config init # Initialize project-specific configuration
108
+ codemie setup # Interactive configuration wizard
109
+ codemie list # List all available agents
110
+ codemie install <agent> # Install an agent
111
+ codemie profile <cmd> # Manage provider profiles
112
+ codemie auth <cmd> # Manage SSO authentication
113
+ codemie doctor # Health check and diagnostics
242
114
  ```
243
115
 
244
- ### Profile Management Commands
245
-
246
- ```bash
247
- codemie profile list # List all provider profiles
248
- codemie profile switch <name> # Switch to a different profile
249
- codemie profile show [name] # Show profile details (defaults to active)
250
- codemie profile delete <name> # Delete a profile
251
- codemie profile rename <old> <new> # Rename a profile
252
- ```
116
+ For a full command reference, see the [Commands Documentation](docs/COMMANDS.md).
253
117
 
254
118
  ## Configuration
255
119
 
256
- ### Setup Wizard (Recommended)
257
-
258
- Run the interactive setup wizard:
120
+ ### Quick Setup
259
121
 
260
- ```bash
261
- codemie setup
262
- ```
263
-
264
- The wizard will:
265
- - Guide you through provider selection
266
- - Test your credentials via health endpoints
267
- - Fetch available models in real-time
268
- - Save configuration to `~/.codemie/config.json`
269
-
270
- **Multi-Provider Support**: If you already have profiles configured, the wizard will offer to:
271
- - Add a new profile (prompts for unique name)
272
- - Update an existing profile (select from list)
273
- - Cancel without changes
274
-
275
- This ensures you can configure multiple providers (work, personal, enterprise SSO) without losing existing configurations.
276
-
277
- ### Multi-Provider Profiles
278
-
279
- CodeMie CLI supports multiple provider profiles, allowing you to:
280
- - Configure different providers for different contexts (work, personal, etc.)
281
- - Switch between profiles with a single command
282
- - Keep all configurations without overwriting
283
-
284
- #### Creating Multiple Profiles
122
+ The easiest way to get started:
285
123
 
286
124
  ```bash
287
- # First profile - work account with LiteLLM
288
- codemie setup
289
- # → Choose: Add a new profile
290
- # → Name: "work-litellm"
291
- # → Provider: LiteLLM
292
- # → Configure credentials...
293
-
294
- # Second profile - personal OpenAI account
125
+ # Interactive setup wizard
295
126
  codemie setup
296
- # → Choose: Add a new profile
297
- # → Name: "personal-openai"
298
- # → Provider: OpenAI
299
- # → Configure credentials...
300
127
 
301
- # Third profile - enterprise SSO
302
- codemie setup
303
- # → Choose: Add a new profile
304
- # → Name: "enterprise-sso"
305
- # → Provider: CodeMie SSO
306
- # → Authenticate via SSO...
128
+ # Or use environment variables
129
+ export CODEMIE_PROVIDER=openai
130
+ export CODEMIE_API_KEY=sk-...
131
+ export CODEMIE_MODEL=gpt-4
307
132
  ```
308
133
 
309
- #### Using Profiles
134
+ ### Configuration Options
310
135
 
311
- ```bash
312
- # List all profiles (shows active profile with ●)
313
- codemie profile list
314
- # Output:
315
- # ● work-litellm (litellm) - claude-4-5-sonnet
316
- # ○ personal-openai (openai) - gpt-4.1
317
- # ○ enterprise-sso (ai-run-sso) - claude-4-5-sonnet
318
-
319
- # Switch active profile
320
- codemie profile switch personal-openai
136
+ - **Setup Wizard** - `codemie setup` (recommended)
137
+ - **Environment Variables** - Override config for specific sessions
138
+ - **Config File** - `~/.codemie/config.json` for persistent settings
139
+ - **Multi-Provider Profiles** - Manage work, personal, and team configs
321
140
 
322
- # Use active profile (default behavior)
323
- codemie-code "analyze this code"
141
+ See [Configuration Documentation](docs/CONFIGURATION.md) for detailed setup, environment variables reference, and advanced configuration.
324
142
 
325
- # Override with specific profile for one command
326
- codemie-claude --profile work-litellm "review PR"
327
- codemie-codex --profile personal-openai "generate tests"
143
+ ## Documentation
328
144
 
329
- # Show profile details
330
- codemie profile show work-litellm
331
- ```
332
-
333
- #### Profile Configuration File
334
-
335
- Profiles are stored in `~/.codemie/config.json`:
336
-
337
- ```json
338
- {
339
- "version": 2,
340
- "activeProfile": "work-litellm",
341
- "profiles": {
342
- "work-litellm": {
343
- "name": "work-litellm",
344
- "provider": "litellm",
345
- "baseUrl": "https://litellm.company.com",
346
- "apiKey": "sk-***",
347
- "model": "claude-4-5-sonnet",
348
- "timeout": 300
349
- },
350
- "personal-openai": {
351
- "name": "personal-openai",
352
- "provider": "openai",
353
- "baseUrl": "https://api.openai.com/v1",
354
- "apiKey": "sk-***",
355
- "model": "gpt-4.1",
356
- "timeout": 300
357
- }
358
- }
359
- }
360
- ```
361
-
362
- **Legacy Configuration**: If you have an existing single-provider config, it will automatically migrate to a profile named "default" on first use.
363
-
364
- ### Supported Providers
365
-
366
- - **ai-run-sso** - AI/Run CodeMie SSO (unified enterprise gateway)
367
- - **gemini** - Google Gemini API (direct access)
368
- - **openai** - OpenAI API
369
- - **azure** - Azure OpenAI
370
- - **bedrock** - AWS Bedrock
371
- - **litellm** - LiteLLM Proxy
372
-
373
- ### Manual Configuration
374
-
375
- #### Environment Variables (Highest Priority)
376
-
377
- ```bash
378
- # Generic (works with any provider)
379
- export CODEMIE_BASE_URL="https://your-proxy.com"
380
- export CODEMIE_API_KEY="your-api-key"
381
- export CODEMIE_MODEL="your-model"
382
- export CODEMIE_PROVIDER="litellm"
383
-
384
- # Provider-specific
385
- export OPENAI_API_KEY="your-openai-key"
386
- export OPENAI_BASE_URL="https://api.openai.com/v1"
387
-
388
- # Gemini-specific
389
- export GEMINI_API_KEY="your-gemini-key"
390
- export GEMINI_MODEL="gemini-2.5-flash"
391
- ```
392
-
393
- #### Configuration File
394
-
395
- Location: `~/.codemie/config.json`
396
-
397
- ```json
398
- {
399
- "provider": "litellm",
400
- "model": "claude-sonnet-4-5",
401
- "baseUrl": "https://litellm.codemie.example.com",
402
- "apiKey": "your-api-key",
403
- "timeout": 300
404
- }
405
- ```
145
+ Comprehensive guides are available in the `docs/` directory:
406
146
 
407
- ### Model Compatibility
147
+ - **[Configuration](docs/CONFIGURATION.md)** - Setup wizard, environment variables, multi-provider profiles, manual configuration
148
+ - **[Commands](docs/COMMANDS.md)** - Complete command reference including analytics and workflow commands
149
+ - **[Agents](docs/AGENTS.md)** - Detailed information about each agent (Claude Code, Codex, Gemini, Deep Agents, built-in)
150
+ - **[Authentication](docs/AUTHENTICATION.md)** - SSO setup, token management, enterprise authentication
151
+ - **[Examples](docs/EXAMPLES.md)** - Common workflows, multi-provider examples, CI/CD integration
408
152
 
409
- AI/Run CodeMie CLI automatically validates model compatibility:
410
-
411
- - **Codex**: OpenAI models only (gpt-4, gpt-4.1, gpt-5, etc.)
412
- - **Claude**: Both Claude and GPT models
413
- - **Gemini CLI**: Gemini models only (gemini-2.5-flash, gemini-2.5-pro, gemini-1.5-pro, etc.)
414
- - **CodeMie Native**: All supported models
415
-
416
- When incompatible models are detected, AI/Run CodeMie CLI will:
417
- 1. Fetch available models from your provider's API
418
- 2. Filter to compatible models
419
- 3. Offer to switch automatically
420
-
421
- ## Authentication & SSO Management
422
-
423
- ### AI/Run CodeMie SSO Setup
424
-
425
- For enterprise environments with AI/Run CodeMie SSO (Single Sign-On):
426
-
427
- #### Initial Setup via Wizard
428
-
429
- The setup wizard automatically detects and configures AI/Run CodeMie SSO:
430
-
431
- ```bash
432
- codemie setup
433
- ```
434
-
435
- **The wizard will:**
436
- 1. Detect if you have access to AI/Run CodeMie SSO
437
- 2. Guide you through the authentication flow
438
- 3. Test the connection with health checks
439
- 4. Fetch and display available models
440
- 5. Save secure credentials to `~/.codemie/config.json`
441
-
442
- #### Manual SSO Authentication
443
-
444
- If you need to authenticate separately or refresh your credentials:
445
-
446
- ```bash
447
- # Authenticate with AI/Run CodeMie SSO
448
- codemie auth login --url https://your-airun-codemie-instance.com
449
-
450
- # Check authentication status
451
- codemie auth status
452
-
453
- # Refresh expired tokens
454
- codemie auth refresh
455
-
456
- # Logout and clear credentials
457
- codemie auth logout
458
- ```
459
-
460
- ### Token Management
461
-
462
- SSO tokens are automatically managed, but you can control them manually:
463
-
464
- #### Token Refresh
465
-
466
- AI/Run CodeMie CLI automatically refreshes tokens when they expire. For manual refresh:
467
-
468
- ```bash
469
- # Refresh SSO credentials (extends session)
470
- codemie auth refresh
471
- ```
472
-
473
- **When to refresh manually:**
474
- - Before long-running tasks
475
- - After extended periods of inactivity
476
- - When you receive authentication errors
477
- - Before important demonstrations
478
-
479
- #### Authentication Status
480
-
481
- Check your current authentication state:
482
-
483
- ```bash
484
- codemie auth status
485
- ```
486
-
487
- **Status information includes:**
488
- - Connection status to AI/Run CodeMie SSO
489
- - Token validity and expiration
490
- - Available models for your account
491
- - Provider configuration details
492
-
493
- #### Token Troubleshooting
494
-
495
- Common authentication issues and solutions:
496
-
497
- ```bash
498
- # Token expired
499
- codemie auth refresh
500
-
501
- # Connection issues
502
- codemie doctor # Full system diagnostics
503
- codemie auth status # Check auth-specific issues
504
-
505
- # Complete re-authentication
506
- codemie auth logout
507
- codemie auth login --url https://your-airun-codemie-instance.com
508
-
509
- # Reset all configuration
510
- codemie config reset
511
- codemie setup # Run wizard again
512
- ```
513
-
514
- ### Enterprise SSO Features
515
-
516
- AI/Run CodeMie SSO provides enterprise-grade features:
517
-
518
- - **Secure Token Storage**: Credentials stored in system keychain
519
- - **Automatic Refresh**: Seamless token renewal without interruption
520
- - **Multi-Model Access**: Access to Claude, GPT, and other models through unified gateway
521
- - **Audit Logging**: Enterprise audit trails for security compliance
522
- - **Role-Based Access**: Model access based on organizational permissions
523
-
524
- ## Examples
525
-
526
- ### Common Workflows
527
-
528
- ```bash
529
- # Code review workflow
530
- codemie-code "Review this PR for security issues and performance"
531
-
532
- # Bug fixing
533
- codemie-claude "Fix the authentication bug in src/auth.ts"
534
-
535
- # Test generation
536
- codemie-codex "Generate comprehensive tests for the API endpoints"
537
-
538
- # Documentation
539
- codemie-code "Document the functions in utils/helpers.js"
540
-
541
- # Refactoring
542
- codemie-claude "Refactor this component to use React hooks"
543
- ```
544
-
545
- ### Configuration Examples
546
-
547
- ```bash
548
- # View current configuration with sources
549
- codemie config show
153
+ ## Contributing
550
154
 
551
- # Test connection
552
- codemie config test
553
-
554
- # Initialize project-specific overrides
555
- codemie config init
556
-
557
- # Temporary model override
558
- codemie-claude --model claude-4-5-sonnet "Explain this algorithm"
559
- ```
560
-
561
- ### Multi-Provider Workflow Examples
562
-
563
- ```bash
564
- # Scenario: Developer with work and personal accounts
565
-
566
- # Setup work profile with enterprise LiteLLM
567
- codemie setup
568
- # → Name: "work"
569
- # → Provider: LiteLLM
570
- # → URL: https://litellm.company.com
571
- # → Model: claude-4-5-sonnet
572
-
573
- # Setup personal profile with OpenAI
574
- codemie setup
575
- # → Name: "personal"
576
- # → Provider: OpenAI
577
- # → Model: gpt-4.1
578
-
579
- # List profiles to verify
580
- codemie profile list
581
- # ● work (litellm) - claude-4-5-sonnet
582
- # ○ personal (openai) - gpt-4.1
583
-
584
- # Use work profile during work hours
585
- codemie-code "review company codebase"
586
-
587
- # Switch to personal for side projects
588
- codemie profile switch personal
589
- codemie-code "help with my open source project"
590
-
591
- # Or use specific profile without switching
592
- codemie-claude --profile work "analyze security"
593
- codemie-codex --profile personal "generate tests"
594
-
595
- # Update work profile when credentials rotate
596
- codemie setup
597
- # → Choose: Update existing profile
598
- # → Select: work
599
- # → Update credentials...
600
- ```
601
-
602
- ### Advanced Usage
603
-
604
- ```bash
605
- # Pass custom arguments to agents (unknown options pass through)
606
- codemie-codex --temperature 0.1 --max-tokens 2000 "Generate clean code"
607
- codemie-claude --context large "Review this code"
608
-
609
- # Non-interactive mode with -p (useful for CI/CD)
610
- codemie-claude -p "$(cat prompt.txt)" --max-turns 50
611
- codemie-codex -p "Generate tests for src/utils" --output json
612
-
613
- # Health checks
614
- codemie doctor # Full system check
615
- codemie-code health # Built-in agent check
616
- codemie-claude health # Claude agent check
617
- codemie-gemini health # Gemini agent check
618
- codemie-deepagents health # Deep Agents CLI check
619
- ```
620
-
621
- ### CI/CD Integration Example
622
-
623
- ```bash
624
- # GitHub Actions / GitLab CI workflow example
625
- codemie-claude \
626
- --base-url "${CODEMIE_BASE_URL}" \
627
- --api-key "${CODEMIE_API_KEY}" \
628
- --model "${CODEMIE_MODEL:-claude-4-5-sonnet}" \
629
- --provider "litellm" \
630
- -p "$(cat /tmp/review-prompt.txt)" \
631
- --max-turns "${CODEMIE_MAX_TURNS:-50}" \
632
- --dangerously-skip-permissions \
633
- --allowedTools "Bash(*),Read(*),Curl(*)"
634
-
635
- # Using profile for CI/CD
636
- codemie-claude \
637
- --profile ci-litellm \
638
- -p "Review this PR for security issues" \
639
- --max-turns 30
640
- ```
641
-
642
- ## Agents
643
-
644
- ### CodeMie Native (Built-in)
645
-
646
- LangGraph-based coding assistant with no installation required.
647
-
648
- **Features:**
649
- - Modern terminal UI with streaming responses
650
- - File operations, git integration, command execution
651
- - Clipboard support with automatic image detection
652
- - Interactive conversations with context memory
653
- - Task-focused execution mode
654
-
655
- **Usage:**
656
- ```bash
657
- codemie-code # Interactive mode
658
- codemie-code "task" # Start with message
659
- codemie --task "task" # Single task execution
660
- ```
661
-
662
- ### Claude Code
663
-
664
- Anthropic's official CLI with advanced code understanding.
665
-
666
- **Installation:** `codemie install claude`
667
-
668
- **Features:**
669
- - Advanced code understanding and generation
670
- - Multi-file editing capabilities
671
- - Project-aware context
672
- - Interactive conversations
673
- - Non-interactive mode with `-p` flag
674
-
675
- **Usage:**
676
- ```bash
677
- codemie-claude # Interactive mode
678
- codemie-claude "message" # Start with message
679
- codemie-claude -p "message" # Non-interactive/print mode
680
- codemie-claude health # Health check
681
- ```
682
-
683
- ### Codex
684
-
685
- OpenAI's code generation assistant optimized for completion tasks.
686
-
687
- **Installation:** `codemie install codex`
688
-
689
- **Features:**
690
- - Code completion and generation
691
- - Function generation and bug fixing
692
- - Code explanation and documentation
693
- - Non-interactive mode with `-p` flag
694
- - **Requires OpenAI-compatible models only**
695
-
696
- **Usage:**
697
- ```bash
698
- codemie-codex # Interactive mode
699
- codemie-codex "message" # Start with message
700
- codemie-codex -p "message" # Non-interactive mode
701
- codemie-codex health # Health check
702
- ```
703
-
704
- ### Gemini CLI
705
-
706
- Google's Gemini AI coding assistant with advanced code understanding.
707
-
708
- **Installation:** `codemie install gemini`
709
-
710
- **Requirements:**
711
- - **Requires a valid Google Gemini API key** from https://aistudio.google.com/apikey
712
- - **Requires Gemini-compatible models only** (gemini-2.5-flash, gemini-2.5-pro, etc.)
713
- - LiteLLM or AI-Run SSO API keys will **not** work with Gemini CLI
714
-
715
- **Setup:**
716
- ```bash
717
- # Configure Gemini with dedicated API key
718
- codemie setup
719
- # Select: "Google Gemini (Direct API Access)"
720
- # Enter your Gemini API key from https://aistudio.google.com/apikey
721
-
722
- # Or use environment variable
723
- export GEMINI_API_KEY="your-gemini-api-key-here"
724
- ```
725
-
726
- **Features:**
727
- - Advanced code generation and analysis
728
- - Multi-model support (Gemini 2.5 Flash, Pro, etc.)
729
- - Project-aware context with directory inclusion
730
- - JSON and streaming JSON output formats
731
-
732
- **Usage:**
733
- ```bash
734
- codemie-gemini # Interactive mode
735
- codemie-gemini "your prompt" # With initial message
736
- codemie-gemini -p "your prompt" # Non-interactive mode (Gemini-specific)
737
- codemie-gemini -m gemini-2.5-flash # Specify model (Gemini-specific)
738
- codemie-gemini --model gemini-2.5-flash "analyze code" # With config override
739
- ```
740
-
741
- ### Deep Agents CLI
742
-
743
- LangChain's terminal interface for building agents with persistent memory. Built on LangGraph with planning capabilities, file system tools, and subagent delegation.
744
-
745
- **Installation:** `codemie install deepagents`
746
-
747
- **Links:**
748
- - [Documentation](https://docs.langchain.com/oss/javascript/deepagents/cli)
749
- - [Overview](https://docs.langchain.com/oss/javascript/deepagents/overview)
750
- - [Middleware](https://docs.langchain.com/oss/javascript/deepagents/middleware)
751
- - [Subagents](https://docs.langchain.com/oss/javascript/deepagents/subagents)
752
- - [Customization](https://docs.langchain.com/oss/javascript/deepagents/customization)
753
-
754
- **Usage:**
755
- ```bash
756
- codemie-deepagents # Interactive mode
757
- codemie-deepagents "your task" # Start with message
758
- codemie-deepagents health # Health check
759
- ```
760
-
761
- **Note:** Installed via Python (pip/uv), not npm. Requires Python 3.9+ and Anthropic or OpenAI API key.
762
-
763
- ## Troubleshooting
764
-
765
- ### Command Not Found
766
-
767
- ```bash
768
- # Re-link the package
769
- npm link
770
- which codemie
771
-
772
- # Check installation
773
- npm list -g @codemieai/code
774
- ```
775
-
776
- ### Configuration Issues
777
-
778
- ```bash
779
- # Run setup wizard
780
- codemie setup
781
-
782
- # Check current config
783
- codemie config show
784
-
785
- # View available parameters
786
- codemie config list
787
-
788
- # Test connection
789
- codemie config test
790
- ```
791
-
792
- ### Connection Problems
793
-
794
- ```bash
795
- # Run diagnostics
796
- codemie doctor
797
-
798
- # Test specific agent
799
- codemie-code health
800
- codemie-claude health
801
-
802
- # Debug mode for detailed logs
803
- codemie-code --debug
804
- ```
805
-
806
- ### Agent Installation Failures
807
-
808
- ```bash
809
- # Check internet connection
810
- curl -I https://api.github.com
811
-
812
- # Clear npm cache
813
- npm cache clean --force
814
-
815
- # Retry installation
816
- codemie install claude
817
- ```
818
-
819
- ### Model Compatibility Errors
820
-
821
- When you see "Model not compatible" errors:
822
-
823
- 1. Check your configured model: `codemie config show`
824
- 2. Run the agent to see compatible options
825
- 3. Update your profile: `codemie setup` (choose "Update existing profile")
826
- 4. Or override temporarily: `codemie-codex --model gpt-4.1`
827
-
828
- ## Development
829
-
830
- ### Project Structure
831
-
832
- ```
833
- codemie-code/
834
- ├── bin/ # Executable entry points
835
- │ ├── codemie.js # Main CLI
836
- │ └── agent-executor.js # Universal agent executor (all shortcuts)
837
- ├── src/
838
- │ ├── agents/ # Agent system
839
- │ │ ├── core/ # Core agent abstractions
840
- │ │ ├── plugins/ # Plugin-based adapters (claude, codex, gemini, codemie-code)
841
- │ │ └── codemie-code/ # Built-in agent implementation
842
- │ ├── cli/ # CLI commands
843
- │ │ └── commands/ # Command implementations (setup, doctor, workflow, etc.)
844
- │ ├── env/ # Configuration management
845
- │ ├── workflows/ # CI/CD workflow management
846
- │ │ └── templates/ # Workflow templates (GitHub Actions, GitLab CI)
847
- │ └── utils/ # Shared utilities
848
- └── tests/ # Test files
849
- ```
850
-
851
- ### Building
852
-
853
- ```bash
854
- npm run build # Compile TypeScript
855
- npm run dev # Watch mode
856
- npm run lint # Check code style
857
- npm run test # Run tests
858
- npm run ci # Full CI pipeline
859
- ```
860
-
861
- ### Testing
862
-
863
- ```bash
864
- npm run build && npm link
865
- codemie --help
866
- codemie doctor
867
- codemie-code health
868
- ```
155
+ Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) to get started.
869
156
 
870
157
  ## License
871
158
 
872
- Apache-2.0
159
+ This project is licensed under the Apache-2.0 License.
873
160
 
874
161
  ## Links
875
162
 
876
163
  - [GitHub Repository](https://github.com/codemie-ai/codemie-code)
877
164
  - [Issue Tracker](https://github.com/codemie-ai/codemie-code/issues)
878
- - [NPM Package](https://www.npmjs.com/package/@codemieai/code)
165
+ - [NPM Package](https://www.npmjs.com/package/@codemieai/code)