@codemieai/code 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -57
- package/bin/codemie-copilot.js +224 -0
- package/bin/codemie-pi.js +18 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +16 -10
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +43 -19
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/agent-aliases.d.ts +17 -0
- package/dist/agents/core/agent-aliases.d.ts.map +1 -0
- package/dist/agents/core/agent-aliases.js +41 -0
- package/dist/agents/core/agent-aliases.js.map +1 -0
- package/dist/agents/core/session/session-origin-audit.d.ts +13 -0
- package/dist/agents/core/session/session-origin-audit.d.ts.map +1 -1
- package/dist/agents/core/session/session-origin-audit.js +34 -0
- package/dist/agents/core/session/session-origin-audit.js.map +1 -1
- package/dist/agents/core/session/stale-session-reconciliation.d.ts +42 -0
- package/dist/agents/core/session/stale-session-reconciliation.d.ts.map +1 -0
- package/dist/agents/core/session/stale-session-reconciliation.js +141 -0
- package/dist/agents/core/session/stale-session-reconciliation.js.map +1 -0
- package/dist/agents/core/session/types.d.ts +19 -0
- package/dist/agents/core/session/types.d.ts.map +1 -1
- package/dist/agents/core/session/types.js +17 -1
- package/dist/agents/core/session/types.js.map +1 -1
- package/dist/agents/core/types.d.ts +1 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts +15 -35
- package/dist/agents/plugins/codex/codex.reconciliation.d.ts.map +1 -1
- package/dist/agents/plugins/codex/codex.reconciliation.js +8 -139
- package/dist/agents/plugins/codex/codex.reconciliation.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.d.ts +4 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.js +4 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.constants.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.models.d.ts +8 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.models.d.ts.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.models.js +195 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.models.js.map +1 -0
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.d.ts +4 -20
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js +237 -38
- package/dist/agents/plugins/copilot-cli/copilot-cli.plugin.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.js +14 -2
- package/dist/agents/plugins/copilot-cli/copilot-cli.session.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/index.d.ts +2 -1
- package/dist/agents/plugins/copilot-cli/index.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/index.js +2 -1
- package/dist/agents/plugins/copilot-cli/index.js.map +1 -1
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.d.ts +6 -3
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.js +298 -5
- package/dist/agents/plugins/copilot-cli/session/processors/copilot-cli.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/pi/__tests__/home-redirect.d.ts +12 -0
- package/dist/agents/plugins/pi/__tests__/home-redirect.d.ts.map +1 -0
- package/dist/agents/plugins/pi/__tests__/home-redirect.js +27 -0
- package/dist/agents/plugins/pi/__tests__/home-redirect.js.map +1 -0
- package/dist/agents/plugins/pi/extension/README.md +68 -0
- package/dist/agents/plugins/pi/extension/index.js +161 -0
- package/dist/agents/plugins/pi/extension/package.json +8 -0
- package/dist/agents/plugins/pi/index.d.ts +3 -0
- package/dist/agents/plugins/pi/index.d.ts.map +1 -0
- package/dist/agents/plugins/pi/index.js +3 -0
- package/dist/agents/plugins/pi/index.js.map +1 -0
- package/dist/agents/plugins/pi/pi.extension.d.ts +60 -0
- package/dist/agents/plugins/pi/pi.extension.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.extension.js +201 -0
- package/dist/agents/plugins/pi/pi.extension.js.map +1 -0
- package/dist/agents/plugins/pi/pi.incremental-sync.d.ts +63 -0
- package/dist/agents/plugins/pi/pi.incremental-sync.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.incremental-sync.js +266 -0
- package/dist/agents/plugins/pi/pi.incremental-sync.js.map +1 -0
- package/dist/agents/plugins/pi/pi.models.d.ts +20 -0
- package/dist/agents/plugins/pi/pi.models.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.models.js +201 -0
- package/dist/agents/plugins/pi/pi.models.js.map +1 -0
- package/dist/agents/plugins/pi/pi.packages.d.ts +11 -0
- package/dist/agents/plugins/pi/pi.packages.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.packages.js +35 -0
- package/dist/agents/plugins/pi/pi.packages.js.map +1 -0
- package/dist/agents/plugins/pi/pi.paths.d.ts +37 -0
- package/dist/agents/plugins/pi/pi.paths.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.paths.js +146 -0
- package/dist/agents/plugins/pi/pi.paths.js.map +1 -0
- package/dist/agents/plugins/pi/pi.plugin.d.ts +30 -0
- package/dist/agents/plugins/pi/pi.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.plugin.js +453 -0
- package/dist/agents/plugins/pi/pi.plugin.js.map +1 -0
- package/dist/agents/plugins/pi/pi.session.d.ts +114 -0
- package/dist/agents/plugins/pi/pi.session.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.session.js +388 -0
- package/dist/agents/plugins/pi/pi.session.js.map +1 -0
- package/dist/agents/plugins/pi/pi.setup.d.ts +2 -0
- package/dist/agents/plugins/pi/pi.setup.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.setup.js +33 -0
- package/dist/agents/plugins/pi/pi.setup.js.map +1 -0
- package/dist/agents/plugins/pi/pi.types.d.ts +143 -0
- package/dist/agents/plugins/pi/pi.types.d.ts.map +1 -0
- package/dist/agents/plugins/pi/pi.types.js +74 -0
- package/dist/agents/plugins/pi/pi.types.js.map +1 -0
- package/dist/agents/plugins/pi/session/pi-file-operations.d.ts +17 -0
- package/dist/agents/plugins/pi/session/pi-file-operations.d.ts.map +1 -0
- package/dist/agents/plugins/pi/session/pi-file-operations.js +98 -0
- package/dist/agents/plugins/pi/session/pi-file-operations.js.map +1 -0
- package/dist/agents/plugins/pi/session/pi-named-invocations.d.ts +52 -0
- package/dist/agents/plugins/pi/session/pi-named-invocations.d.ts.map +1 -0
- package/dist/agents/plugins/pi/session/pi-named-invocations.js +189 -0
- package/dist/agents/plugins/pi/session/pi-named-invocations.js.map +1 -0
- package/dist/agents/plugins/pi/session/pi-user-prompt.d.ts +14 -0
- package/dist/agents/plugins/pi/session/pi-user-prompt.d.ts.map +1 -0
- package/dist/agents/plugins/pi/session/pi-user-prompt.js +51 -0
- package/dist/agents/plugins/pi/session/pi-user-prompt.js.map +1 -0
- package/dist/agents/plugins/pi/session/processors/pi.conversations-processor.d.ts +52 -0
- package/dist/agents/plugins/pi/session/processors/pi.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/pi/session/processors/pi.conversations-processor.js +716 -0
- package/dist/agents/plugins/pi/session/processors/pi.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/pi/session/processors/pi.metrics-processor.d.ts +104 -0
- package/dist/agents/plugins/pi/session/processors/pi.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/pi/session/processors/pi.metrics-processor.js +595 -0
- package/dist/agents/plugins/pi/session/processors/pi.metrics-processor.js.map +1 -0
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +2 -2
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/analytics/agent-labels.d.ts.map +1 -1
- package/dist/cli/commands/analytics/agent-labels.js +1 -0
- package/dist/cli/commands/analytics/agent-labels.js.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts +24 -0
- package/dist/cli/commands/analytics/cost/usage-readers.d.ts.map +1 -1
- package/dist/cli/commands/analytics/cost/usage-readers.js +199 -54
- package/dist/cli/commands/analytics/cost/usage-readers.js.map +1 -1
- package/dist/cli/commands/analytics/index.js +1 -0
- package/dist/cli/commands/analytics/index.js.map +1 -1
- package/dist/cli/commands/analytics/native-loader.d.ts +21 -4
- package/dist/cli/commands/analytics/native-loader.d.ts.map +1 -1
- package/dist/cli/commands/analytics/native-loader.js +250 -96
- package/dist/cli/commands/analytics/native-loader.js.map +1 -1
- package/dist/cli/commands/analytics/report/client/app.js +47 -3
- package/dist/cli/commands/analytics/report/payload-builder.d.ts.map +1 -1
- package/dist/cli/commands/analytics/report/payload-builder.js +25 -2
- package/dist/cli/commands/analytics/report/payload-builder.js.map +1 -1
- package/dist/cli/commands/analytics/report/types.d.ts +1 -0
- package/dist/cli/commands/analytics/report/types.d.ts.map +1 -1
- package/dist/cli/commands/hook.d.ts.map +1 -1
- package/dist/cli/commands/hook.js +71 -29
- package/dist/cli/commands/hook.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +7 -5
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/list.js +3 -1
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.d.ts +94 -4
- package/dist/cli/commands/proxy/connectors/desktop.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/desktop.js +244 -17
- package/dist/cli/commands/proxy/connectors/desktop.js.map +1 -1
- package/dist/cli/commands/proxy/connectors/managed-mcp-remote.d.ts +25 -0
- package/dist/cli/commands/proxy/connectors/managed-mcp-remote.d.ts.map +1 -1
- package/dist/cli/commands/proxy/connectors/managed-mcp-remote.js +59 -1
- package/dist/cli/commands/proxy/connectors/managed-mcp-remote.js.map +1 -1
- package/dist/cli/commands/proxy/index.d.ts.map +1 -1
- package/dist/cli/commands/proxy/index.js +10 -1
- package/dist/cli/commands/proxy/index.js.map +1 -1
- package/dist/cli/commands/uninstall.d.ts.map +1 -1
- package/dist/cli/commands/uninstall.js +5 -3
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +5 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/first-time.d.ts.map +1 -1
- package/dist/cli/first-time.js +7 -6
- package/dist/cli/first-time.js.map +1 -1
- package/dist/providers/core/auth-validation.d.ts +7 -2
- package/dist/providers/core/auth-validation.d.ts.map +1 -1
- package/dist/providers/core/auth-validation.js +11 -5
- package/dist/providers/core/auth-validation.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts +8 -3
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js +46 -11
- package/dist/providers/plugins/sso/proxy/plugins/claude-request-normalizer.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts +23 -13
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js +75 -18
- package/dist/providers/plugins/sso/proxy/plugins/codex-encrypted-content-sanitizer.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/copilot-encrypted-content-sanitizer.plugin.d.ts +21 -0
- package/dist/providers/plugins/sso/proxy/plugins/copilot-encrypted-content-sanitizer.plugin.d.ts.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/copilot-encrypted-content-sanitizer.plugin.js +133 -0
- package/dist/providers/plugins/sso/proxy/plugins/copilot-encrypted-content-sanitizer.plugin.js.map +1 -0
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/header-injection.plugin.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts +2 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/index.js +4 -2
- package/dist/providers/plugins/sso/proxy/plugins/index.js.map +1 -1
- package/dist/providers/plugins/sso/proxy/plugins/types.d.ts +11 -0
- package/dist/providers/plugins/sso/proxy/plugins/types.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts +2 -0
- package/dist/providers/plugins/sso/proxy/sso.proxy.d.ts.map +1 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.js +37 -1
- package/dist/providers/plugins/sso/proxy/sso.proxy.js.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/SessionSyncer.js +13 -0
- package/dist/providers/plugins/sso/session/SessionSyncer.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js +6 -0
- package/dist/providers/plugins/sso/session/processors/conversations/syncProcessor.js.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts +0 -6
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.d.ts.map +1 -1
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.js +28 -19
- package/dist/providers/plugins/sso/session/processors/metrics/metrics-post-processor.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.js +13 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.discovery.js.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.d.ts +12 -0
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.d.ts.map +1 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js +28 -1
- package/dist/telemetry/clients/claude-desktop/claude-desktop.paths.js.map +1 -1
- package/dist/utils/interactive.d.ts +14 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +16 -0
- package/dist/utils/interactive.js.map +1 -0
- package/package.json +6 -4
- package/scripts/copy-plugins.js +6 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
[](https://www.typescriptlang.org/)
|
|
11
11
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
12
12
|
|
|
13
|
-
> **Unified AI Coding Assistant CLI** - Manage Claude Code, OpenAI Codex, Google Gemini, OpenCode, and custom AI agents from one powerful command-line interface. Multi-provider support (
|
|
13
|
+
> **Unified AI Coding Assistant CLI** - Manage Claude Code, OpenAI Codex, GitHub Copilot CLI, Google Gemini, OpenCode, Pi, Kimi Code, and custom AI agents from one powerful command-line interface. Multi-provider support (CodeMie SSO, Bearer Auth, LiteLLM, AWS Bedrock, Ollama, Anthropic Subscription, Moonshot Subscription). Built-in native agent with file operations, command execution, planning mode, and plugins. Cross-platform support for Windows, Linux, and macOS.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
CodeMie CLI is the all-in-one AI coding assistant for developers.
|
|
24
24
|
|
|
25
|
-
- ✨ **One CLI, Multiple AI Agents** - Switch between Claude Code, OpenAI Codex, Gemini, OpenCode, and built-in agent.
|
|
26
|
-
- 🔄 **Multi-Provider Support** -
|
|
27
|
-
- 🚀 **Built-in Agent** -
|
|
25
|
+
- ✨ **One CLI, Multiple AI Agents** - Switch between Claude Code, OpenAI Codex, GitHub Copilot CLI, Gemini, OpenCode, Pi, Kimi Code, and built-in agent.
|
|
26
|
+
- 🔄 **Multi-Provider Support** - CodeMie SSO, Bearer Authorization, LiteLLM, AWS Bedrock, Ollama, Anthropic Subscription, and Moonshot Subscription.
|
|
27
|
+
- 🚀 **Built-in Agent** - `codemie-code` ships with the CLI: file operations, command execution, planning mode, and native plugins.
|
|
28
28
|
- 🖥️ **Cross-Platform** - Full support for Windows, Linux, and macOS with platform-specific optimizations.
|
|
29
29
|
- 🔗 **MCP Proxy** - Connect to remote MCP servers with automatic OAuth authorization.
|
|
30
30
|
- 🔐 **Enterprise Ready** - SSO and JWT authentication, audit logging, and role-based access.
|
|
@@ -46,8 +46,10 @@ codemie setup
|
|
|
46
46
|
codemie doctor
|
|
47
47
|
codemie install claude --supported
|
|
48
48
|
codemie install codex --supported
|
|
49
|
+
codemie install copilot
|
|
49
50
|
codemie-claude "Review my API code"
|
|
50
51
|
codemie-codex "Refactor this service"
|
|
52
|
+
codemie-copilot --task "Summarize this module"
|
|
51
53
|
codemie --task "Generate unit tests"
|
|
52
54
|
codemie skills find pdf # discover agent skills (EPAM internal + skills.sh)
|
|
53
55
|
claude mcp add my-server -- codemie-mcp-proxy "https://mcp-server.example.com/sse"
|
|
@@ -149,7 +151,7 @@ npm install @codemieai/code
|
|
|
149
151
|
npx @codemieai/code --help
|
|
150
152
|
```
|
|
151
153
|
|
|
152
|
-
**Note:** Agent shortcuts (`codemie-claude`, `codemie-codex`, `codemie-code`, `codemie-opencode`, etc.) require global installation.
|
|
154
|
+
**Note:** Agent shortcuts (`codemie-claude`, `codemie-codex`, `codemie-code`, `codemie-opencode`, `codemie-pi`, `codemie-kimi`, etc.) require global installation.
|
|
153
155
|
|
|
154
156
|
### Installation Troubleshooting
|
|
155
157
|
|
|
@@ -183,56 +185,67 @@ The CodeMie CLI provides two ways to interact with AI agents:
|
|
|
183
185
|
|
|
184
186
|
### Built-in Agent (CodeMie Native)
|
|
185
187
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
**Available Tools:**
|
|
189
|
-
- `read_file` - Read file contents
|
|
190
|
-
- `write_file` - Write content to files
|
|
191
|
-
- `list_directory` - List files with intelligent filtering (auto-filters node_modules, .git, etc.)
|
|
192
|
-
- `execute_command` - Execute shell commands with progress tracking
|
|
193
|
-
- `write_todos` / `update_todo_status` / `append_todo` / `clear_todos` / `show_todos` - Planning and progress tracking tools
|
|
188
|
+
`codemie-code` ships with the CLI — no separate install. It is a native CodeMie binary (`@codemieai/codemie-opencode`, platform-specific), pre-wired to the CodeMie proxy, with file/shell tools, planning mode, and native plugin support.
|
|
194
189
|
|
|
195
190
|
```bash
|
|
196
|
-
#
|
|
197
|
-
codemie-code
|
|
198
|
-
|
|
199
|
-
# Start with an initial message
|
|
191
|
+
codemie-code # interactive session
|
|
200
192
|
codemie-code "Help me refactor this component"
|
|
193
|
+
codemie-code --task "Generate unit tests" # run once and exit
|
|
194
|
+
codemie-code --plan # planning mode
|
|
195
|
+
codemie-code --plan-only # plan without executing
|
|
196
|
+
codemie-code --plugin-dir ./my-plugins # load native plugins
|
|
197
|
+
codemie-code --debug # debug logging
|
|
201
198
|
```
|
|
202
199
|
|
|
200
|
+
Providers: CodeMie SSO, Bearer Auth, LiteLLM, AWS Bedrock, Ollama.
|
|
201
|
+
|
|
203
202
|
### External Agents
|
|
204
203
|
|
|
205
|
-
|
|
204
|
+
CodeMie installs external agents, routes them through the CodeMie proxy, and tracks their sessions.
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
| Agent | Install | Shortcut | Upstream package |
|
|
207
|
+
|---|---|---|---|
|
|
208
|
+
| Claude Code | `codemie install claude --supported` | `codemie-claude` | `@anthropic-ai/claude-code` |
|
|
209
|
+
| Claude Code ACP | `codemie install claude-acp` | `codemie-claude-acp` | `@zed-industries/claude-code-acp` |
|
|
210
|
+
| OpenAI Codex | `codemie install codex --supported` | `codemie-codex` | `@openai/codex` |
|
|
211
|
+
| Gemini CLI | `codemie install gemini` | `codemie-gemini` | `@google/gemini-cli` |
|
|
212
|
+
| OpenCode | `codemie install opencode` | `codemie-opencode` | `opencode-ai` |
|
|
213
|
+
| Pi | `codemie install pi` | `codemie-pi` | `@earendil-works/pi-coding-agent` |
|
|
214
|
+
| Kimi Code | `codemie install kimi` | `codemie-kimi` | `@moonshot-ai/kimi-code` |
|
|
215
|
+
| Kimi Code ACP | `codemie install kimi-acp` | `codemie-kimi-acp` | `@moonshot-ai/kimi-code` (`acp` mode) |
|
|
216
|
+
| GitHub Copilot CLI | `codemie install copilot` | `codemie-copilot` | `@github/copilot` |
|
|
217
|
+
|
|
218
|
+
ACP agents are launched by your IDE, not directly — see [ACP Agent usage](#acp-agent-usage-in-ides-and-editors) below.
|
|
213
219
|
|
|
214
220
|
```bash
|
|
215
|
-
|
|
216
|
-
codemie install
|
|
221
|
+
codemie install claude --supported # install
|
|
222
|
+
codemie install copilot # install GitHub Copilot CLI
|
|
223
|
+
codemie-claude "Review my API code" # one-shot task
|
|
224
|
+
codemie-claude # interactive session
|
|
225
|
+
codemie-copilot --task "Refactor this auth flow"
|
|
226
|
+
codemie uninstall copilot # uninstall GitHub Copilot CLI
|
|
227
|
+
codemie-codex --task "Refactor this auth flow" # same shape for every agent
|
|
228
|
+
```
|
|
217
229
|
|
|
218
|
-
|
|
219
|
-
codemie-claude "Review my API code"
|
|
230
|
+
#### GitHub Copilot CLI via CodeMie
|
|
220
231
|
|
|
221
|
-
|
|
222
|
-
codemie install codex --supported
|
|
223
|
-
codemie-codex "Refactor this authentication flow"
|
|
232
|
+
CodeMie can install and launch GitHub Copilot CLI as a managed agent while keeping the internal registry identity `copilot-cli`.
|
|
224
233
|
|
|
225
|
-
|
|
226
|
-
codemie install gemini
|
|
227
|
-
codemie-gemini "Implement a REST API"
|
|
234
|
+
Supported managed path for this release:
|
|
228
235
|
|
|
229
|
-
|
|
230
|
-
codemie
|
|
236
|
+
- **Install:** `codemie install copilot`
|
|
237
|
+
- **Uninstall:** `codemie uninstall copilot`
|
|
238
|
+
- **Launch:** `codemie-copilot`
|
|
239
|
+
- **One-shot task:** `codemie-copilot --task "Explain this service"`
|
|
240
|
+
- **Supported providers:** CodeMie SSO and LiteLLM
|
|
231
241
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
242
|
+
Requirements and behavior:
|
|
243
|
+
|
|
244
|
+
- Use an authenticated CodeMie profile (`codemie setup`).
|
|
245
|
+
- Managed Copilot runs are routed through CodeMie's provider/proxy path.
|
|
246
|
+
- The supported managed path does **not** require GitHub login, a GitHub Copilot subscription, or a GitHub personal access token.
|
|
247
|
+
- CodeMie blocks fallback to ambient GitHub credentials for this managed mode.
|
|
248
|
+
- Copilot conversation sync is attributed under `copilot-cli` in CodeMie.
|
|
236
249
|
|
|
237
250
|
#### ACP Agent usage in IDEs and Editors
|
|
238
251
|
|
|
@@ -269,28 +282,34 @@ codemie install claude-acp
|
|
|
269
282
|
|
|
270
283
|
**Version Management:**
|
|
271
284
|
|
|
272
|
-
CodeMie manages agent versions to ensure compatibility
|
|
285
|
+
CodeMie manages agent versions to ensure compatibility:
|
|
273
286
|
|
|
274
287
|
```bash
|
|
275
|
-
#
|
|
276
|
-
codemie install claude
|
|
277
|
-
|
|
278
|
-
# Install latest supported Codex version (recommended)
|
|
279
|
-
codemie install codex --supported
|
|
280
|
-
|
|
281
|
-
# Install specific version
|
|
282
|
-
codemie install claude 2.1.22
|
|
283
|
-
codemie install codex 0.129.0
|
|
284
|
-
|
|
285
|
-
# Install latest available version
|
|
286
|
-
codemie install claude
|
|
287
|
-
codemie install codex
|
|
288
|
+
codemie install claude --supported # latest supported version (recommended)
|
|
289
|
+
codemie install claude 2.1.22 # pin a specific version
|
|
290
|
+
codemie install claude # latest available version
|
|
288
291
|
```
|
|
289
292
|
|
|
290
293
|
Auto-updates are automatically disabled to maintain version control. CodeMie notifies you when running a different version than supported.
|
|
291
294
|
|
|
292
295
|
For more detailed information on the available agents, see the [Agents Documentation](docs/AGENTS.md).
|
|
293
296
|
|
|
297
|
+
### Providers
|
|
298
|
+
|
|
299
|
+
A profile binds an agent to a provider. Run `codemie setup` to create one, or `codemie profile` to manage several (work, personal, team).
|
|
300
|
+
|
|
301
|
+
| Provider | Auth | Use case |
|
|
302
|
+
|---|---|---|
|
|
303
|
+
| CodeMie SSO | enterprise SSO | Enterprise default — centralized model management, proxy routing, analytics |
|
|
304
|
+
| Bearer Authorization | JWT via CLI or env var | CI, service accounts, self-hosted gateways |
|
|
305
|
+
| LiteLLM | API key | Universal gateway to 100+ LLM providers (OpenAI, Azure, Vertex, …) |
|
|
306
|
+
| AWS Bedrock | AWS access key + secret | Claude, Llama, Mistral & more via Amazon Bedrock |
|
|
307
|
+
| Ollama | none | Local open-source models, offline work |
|
|
308
|
+
| Anthropic Subscription | native Claude Code login | Bring your own Claude subscription |
|
|
309
|
+
| Moonshot Subscription | native Kimi Code login | Bring your own Moonshot subscription (Kimi Code) |
|
|
310
|
+
|
|
311
|
+
See [Authentication](docs/AUTHENTICATION.md) and [Configuration](docs/CONFIGURATION.md) for setup details.
|
|
312
|
+
|
|
294
313
|
### CodeMie Assistants as Claude Skills or Subagents
|
|
295
314
|
|
|
296
315
|
CodeMie can connect assistants available in your CodeMie account directly into Claude Code. Register them as Claude subagents and call them with `@slug`, or register them as Claude skills and invoke them with `/slug`.
|
|
@@ -411,6 +430,29 @@ codemie opencode-metrics --discover --verbose
|
|
|
411
430
|
|
|
412
431
|
Metrics are automatically extracted at session end and synced to the analytics system. Use `codemie analytics` to view comprehensive usage statistics across all agents.
|
|
413
432
|
|
|
433
|
+
### Pi (`codemie-pi`)
|
|
434
|
+
|
|
435
|
+
Pi is an open-source coding agent harness ([`@earendil-works/pi-coding-agent`](https://www.npmjs.com/package/@earendil-works/pi-coding-agent)).
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
codemie install pi # also installs the required Pi packages
|
|
439
|
+
codemie-pi "Add retry logic to the HTTP client"
|
|
440
|
+
codemie-pi # interactive session
|
|
441
|
+
codemie-pi --continue # continue the latest session
|
|
442
|
+
codemie-pi --resume <session-id> # open a specific session
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
**What CodeMie configures for you:**
|
|
446
|
+
|
|
447
|
+
| What | How |
|
|
448
|
+
|---|---|
|
|
449
|
+
| **Managed agent dir** | `~/.pi/agent` is copied once to `<project>/.pi/codemie/agent`; Pi runs against the copy via `PI_CODING_AGENT_DIR`. Your skills, prompts, and extensions carry over — your Pi home is never modified. |
|
|
450
|
+
| **Live model catalogue** | `models.json` is regenerated each run with providers `codemie-proxy` (OpenAI-compatible) and `codemie-anthropic` (Claude). Model/provider come from your active profile. |
|
|
451
|
+
| **Required packages** | `pi-mcp-adapter` (Pi ships without built-in MCP), `pi-subagents`, `superpowers` — installed at setup. |
|
|
452
|
+
| **Session analytics** | An injected extension records tokens, tools, and models per session and syncs at session end; visible in `codemie analytics`. |
|
|
453
|
+
|
|
454
|
+
Providers: CodeMie SSO, Bearer Auth, LiteLLM.
|
|
455
|
+
|
|
414
456
|
## Claude Code Statusline
|
|
415
457
|
|
|
416
458
|
The CodeMie Statusline displays live budget usage, project name, git branch, model, context window percentage, and token counts at the bottom of every Claude Code session.
|
|
@@ -439,16 +481,24 @@ The CodeMie CLI has a rich set of commands for managing agents, configuration, a
|
|
|
439
481
|
codemie setup # Interactive configuration wizard
|
|
440
482
|
codemie list # List all available agents
|
|
441
483
|
codemie install <name> # Install an agent or add-on (e.g. statusline)
|
|
484
|
+
codemie uninstall <name> # Remove an agent or add-on
|
|
442
485
|
codemie update <agent> # Update installed agents
|
|
443
486
|
codemie self-update # Update CodeMie CLI itself
|
|
444
487
|
codemie profile # Manage provider profiles
|
|
488
|
+
codemie models list # List models available for the current provider
|
|
445
489
|
codemie analytics # View usage analytics (sessions, tokens, costs, tools)
|
|
446
490
|
codemie analytics --report --open # Self-contained HTML dashboard (7 views, cost, date range, light/dark, no server)
|
|
447
491
|
codemie analytics --report --report-format json # Same priced report data as JSON (--report-format html | json | both)
|
|
448
492
|
codemie workflow <cmd> # Manage CI/CD workflows
|
|
449
|
-
codemie
|
|
493
|
+
codemie sdk <resource> # Manage CodeMie platform assets (assistants, workflows, datasources, integrations, skills, users)
|
|
494
|
+
codemie skill <cmd> # Manage skills for CodeMie agents (list, validate, reload)
|
|
495
|
+
codemie skills <cmd> # Discover/install agent skills via skills.sh + EPAM catalog
|
|
496
|
+
codemie plugin <cmd> # Manage native plugins (Anthropic format)
|
|
497
|
+
codemie mcp add # Add an MCP server to an agent config
|
|
450
498
|
codemie mcp-proxy <url> # Stdio-to-HTTP MCP proxy with OAuth
|
|
499
|
+
codemie proxy <cmd> # Manage the local CodeMie proxy and its integrations
|
|
451
500
|
codemie codebase ui # Start and open Codebase Memory graph UI
|
|
501
|
+
codemie doctor # Health check and diagnostics
|
|
452
502
|
```
|
|
453
503
|
|
|
454
504
|
For a full command reference, see the [Commands Documentation](docs/COMMANDS.md).
|
|
@@ -485,7 +535,7 @@ Use Claude Desktop 3P through CodeMie proxy routing to capture `claude-desktop`
|
|
|
485
535
|
|
|
486
536
|
- `codemie` installed
|
|
487
537
|
- a valid CodeMie SSO profile
|
|
488
|
-
- Claude Desktop 3P installed
|
|
538
|
+
- Claude Desktop 3P installed — macOS, Windows, or Linux (Linux requires Claude Desktop's Ubuntu/Debian beta)
|
|
489
539
|
|
|
490
540
|
### 1. Connect Claude Desktop
|
|
491
541
|
|
|
@@ -505,6 +555,42 @@ codemie proxy inspect desktop --limit 5
|
|
|
505
555
|
codemie proxy stop
|
|
506
556
|
```
|
|
507
557
|
|
|
558
|
+
### Linux
|
|
559
|
+
|
|
560
|
+
Claude Desktop's Linux app is in beta: Ubuntu 22.04+ or Debian 12+, on x86_64 or arm64. Install it from Anthropic's apt repository first — that means registering their signing key and repo, not just `apt install`, so follow [Anthropic's Linux install guide](https://code.claude.com/docs/en/desktop-linux). Then connect exactly as on macOS and Windows:
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
codemie proxy connect desktop --verbose
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
`--verbose` prints the config path that was written, which is the fastest way to confirm where it landed.
|
|
567
|
+
|
|
568
|
+
**Where the config goes.** Claude Desktop is an Electron app, so its config root follows the XDG convention:
|
|
569
|
+
|
|
570
|
+
| Condition | Config library |
|
|
571
|
+
|---|---|
|
|
572
|
+
| `XDG_CONFIG_HOME` set to an absolute path | `$XDG_CONFIG_HOME/Claude-3p/configLibrary/` |
|
|
573
|
+
| otherwise (the common case) | `~/.config/Claude-3p/configLibrary/` |
|
|
574
|
+
|
|
575
|
+
An empty or relative `XDG_CONFIG_HOME` is ignored, per the XDG spec.
|
|
576
|
+
|
|
577
|
+
**Verify the write:**
|
|
578
|
+
|
|
579
|
+
```bash
|
|
580
|
+
echo "${XDG_CONFIG_HOME:-(unset)}"
|
|
581
|
+
ls -la ~/.config/Claude-3p/configLibrary/
|
|
582
|
+
cat ~/.config/Claude-3p/configLibrary/_meta.json # appliedId names the active config
|
|
583
|
+
codemie proxy inspect desktop --limit 5
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
Claude Desktop reads its configuration **once at launch**, so fully quit and reopen the app — not just close the window.
|
|
587
|
+
|
|
588
|
+
**If the app is launched from a desktop launcher**, it may not inherit the `XDG_CONFIG_HOME` you have exported in your shell. When that happens the CLI writes to one path and the app reads another, and the connect silently appears to do nothing. Compare the path from `--verbose` against `~/.config/Claude-3p/`.
|
|
589
|
+
|
|
590
|
+
**Managed (MDM) settings.** If `/etc/claude-desktop/managed-settings.json` exists, `codemie proxy connect desktop` warns you: Claude Desktop applies a managed source in preference to local configuration. This is not automatically fatal — a policy that sets only `disableAutoUpdates` and `autoUpdaterEnforcementHours` leaves everything else local, so the write still applies. If routing really is ignored, ask your administrator to carry the gateway settings in the managed source rather than deleting the file, which is root-owned and typically redeployed by MDM.
|
|
591
|
+
|
|
592
|
+
**WSL is not supported.** WSL reports its platform as Linux, so the config is written on the WSL side where a Windows Claude Desktop will not look for it. Run `codemie proxy connect desktop` from Windows instead.
|
|
593
|
+
|
|
508
594
|
### If Claude Desktop was already using Anthropic subscription or another Gateway
|
|
509
595
|
|
|
510
596
|
1. Quit Claude Desktop.
|
|
@@ -524,8 +610,11 @@ Comprehensive guides are available in the `docs/` directory:
|
|
|
524
610
|
- `CODEMIE_INSECURE=1` — disable SSL verification for self-signed certs or local dev environments (SSL is on by default)
|
|
525
611
|
- **[Commands](docs/COMMANDS.md)** - Complete command reference including analytics and workflow commands
|
|
526
612
|
- **[Analytics Report](docs/ANALYTICS-REPORT.md)** - HTML dashboard: all 8 views, filters, session drill-down, cost and efficiency metrics
|
|
527
|
-
- **[Agents](docs/AGENTS.md)** -
|
|
613
|
+
- **[Agents](docs/AGENTS.md)** - Per-agent detail (built-in, Claude Code, Claude Code ACP, Gemini, OpenCode; Pi and Kimi are documented in this README)
|
|
528
614
|
- **[Authentication](docs/AUTHENTICATION.md)** - SSO setup, token management, enterprise authentication
|
|
615
|
+
- **[Plugins](docs/PLUGINS.md)** - Reusable packages of skills, commands, agents, hooks, and MCP servers (`.claude-plugin/plugin.json` format)
|
|
616
|
+
- **[Skills](docs/SKILLS.md)** - Injecting custom knowledge into agents via markdown + YAML frontmatter
|
|
617
|
+
- **[Hooks](docs/HOOKS.md)** - Shell and LLM-based hooks at agent lifecycle points
|
|
529
618
|
- **[Examples](docs/EXAMPLES.md)** - Common workflows, multi-provider examples, CI/CD integration
|
|
530
619
|
- **[Configuration Architecture](docs/ARCHITECTURE-CONFIGURATION.md)** - How configuration flows through the system from CLI to proxy plugins
|
|
531
620
|
- **[Proxy Architecture](docs/ARCHITECTURE-PROXY.md)** - Proxy plugin system, MCP authorization flow
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* GitHub Copilot CLI Agent Entry Point
|
|
5
|
+
* Direct entry point for codemie-copilot command
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { mkdir, readFile, writeFile } from 'fs/promises';
|
|
9
|
+
import { dirname } from 'path';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import inquirer from 'inquirer';
|
|
12
|
+
import { AgentCLI } from '../dist/agents/core/AgentCLI.js';
|
|
13
|
+
import { AgentRegistry } from '../dist/agents/registry.js';
|
|
14
|
+
import { resolveCopilotModel } from '../dist/agents/plugins/copilot-cli/index.js';
|
|
15
|
+
import { ConfigLoader } from '../dist/utils/config.js';
|
|
16
|
+
import { getCodemiePath } from '../dist/utils/paths.js';
|
|
17
|
+
|
|
18
|
+
const SAVED_MODEL_PATH = getCodemiePath('agents', 'copilot-cli', 'model.json');
|
|
19
|
+
|
|
20
|
+
const OPTION_ALIASES = new Map([
|
|
21
|
+
['-m', 'model'],
|
|
22
|
+
['--model', 'model'],
|
|
23
|
+
['--model-list', 'modelList'],
|
|
24
|
+
['--profile', 'profile'],
|
|
25
|
+
['--provider', 'provider'],
|
|
26
|
+
['--api-key', 'apiKey'],
|
|
27
|
+
['--base-url', 'baseUrl'],
|
|
28
|
+
['--timeout', 'timeout'],
|
|
29
|
+
['--jwt-token', 'jwtToken'],
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
function parseOptionValue(argv, index) {
|
|
33
|
+
const arg = argv[index];
|
|
34
|
+
const equalsIndex = arg.indexOf('=');
|
|
35
|
+
if (equalsIndex !== -1) {
|
|
36
|
+
return { value: arg.slice(equalsIndex + 1), consumed: 0 };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const next = argv[index + 1];
|
|
40
|
+
if (!next || next.startsWith('-')) {
|
|
41
|
+
return { value: true, consumed: 0 };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return { value: next, consumed: 1 };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function parseCopilotOptions(argv) {
|
|
48
|
+
const options = {};
|
|
49
|
+
|
|
50
|
+
for (let i = 2; i < argv.length; i++) {
|
|
51
|
+
const arg = argv[i];
|
|
52
|
+
const optionName = OPTION_ALIASES.get(arg.split('=')[0]);
|
|
53
|
+
if (!optionName) continue;
|
|
54
|
+
|
|
55
|
+
if (optionName === 'modelList') {
|
|
56
|
+
options.modelList = true;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { value, consumed } = parseOptionValue(argv, i);
|
|
61
|
+
options[optionName] = value;
|
|
62
|
+
i += consumed;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return options;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function hasEnvModelOverride() {
|
|
69
|
+
return Boolean(process.env.CODEMIE_MODEL);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function loadSavedModel() {
|
|
73
|
+
try {
|
|
74
|
+
const raw = await readFile(SAVED_MODEL_PATH, 'utf-8');
|
|
75
|
+
const parsed = JSON.parse(raw);
|
|
76
|
+
return typeof parsed?.model === 'string' && parsed.model.trim() ? parsed.model.trim() : undefined;
|
|
77
|
+
} catch {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function saveSelectedModel(model) {
|
|
83
|
+
await mkdir(dirname(SAVED_MODEL_PATH), { recursive: true });
|
|
84
|
+
await writeFile(
|
|
85
|
+
SAVED_MODEL_PATH,
|
|
86
|
+
`${JSON.stringify({ model, updatedAt: new Date().toISOString() }, null, 2)}\n`,
|
|
87
|
+
'utf-8'
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function applySavedModelIfNeeded(options, savedModel) {
|
|
92
|
+
if (typeof options.model === 'string' || options.model === true || hasEnvModelOverride() || !savedModel) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
process.env.CODEMIE_MODEL = savedModel;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function resolveInitialModelSource(options) {
|
|
100
|
+
if (typeof options.model === 'string') return 'cli';
|
|
101
|
+
if (hasEnvModelOverride()) return 'env';
|
|
102
|
+
return 'default';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function buildConfigOverrides(options) {
|
|
106
|
+
return {
|
|
107
|
+
name: typeof options.profile === 'string' ? options.profile : undefined,
|
|
108
|
+
provider: typeof options.provider === 'string' ? options.provider : undefined,
|
|
109
|
+
model: typeof options.model === 'string' ? options.model : undefined,
|
|
110
|
+
apiKey: typeof options.apiKey === 'string' ? options.apiKey : undefined,
|
|
111
|
+
baseUrl: typeof options.baseUrl === 'string' ? options.baseUrl : undefined,
|
|
112
|
+
timeout: typeof options.timeout === 'string' ? Number.parseInt(options.timeout, 10) : undefined,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function getCopilotModels(options) {
|
|
117
|
+
const config = await ConfigLoader.load(process.cwd(), buildConfigOverrides(options));
|
|
118
|
+
if (typeof options.jwtToken === 'string') {
|
|
119
|
+
process.env.CODEMIE_JWT_TOKEN = options.jwtToken;
|
|
120
|
+
config.authMethod = 'jwt';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const env = ConfigLoader.exportProviderEnvVars(config);
|
|
124
|
+
env.CODEMIE_MODEL_SOURCE = resolveInitialModelSource(options);
|
|
125
|
+
if (typeof options.jwtToken === 'string') {
|
|
126
|
+
env.CODEMIE_AUTH_METHOD = 'jwt';
|
|
127
|
+
env.CODEMIE_JWT_TOKEN = options.jwtToken;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return resolveCopilotModel(env);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async function printModelList(options) {
|
|
134
|
+
const { selectedModel, availableModels } = await getCopilotModels(options);
|
|
135
|
+
const currentModel = typeof options.model === 'string' ? options.model : process.env.CODEMIE_MODEL;
|
|
136
|
+
|
|
137
|
+
console.log(chalk.bold('\nAvailable models for codemie-copilot:\n'));
|
|
138
|
+
for (const model of availableModels) {
|
|
139
|
+
const badges = [];
|
|
140
|
+
if (model === availableModels[0]) badges.push('recommended');
|
|
141
|
+
if (currentModel === model) badges.push('current');
|
|
142
|
+
const suffix = badges.length ? chalk.gray(` (${badges.join(', ')})`) : '';
|
|
143
|
+
console.log(` ${chalk.cyan(model)}${suffix}`);
|
|
144
|
+
}
|
|
145
|
+
console.log('');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function promptForModel(options) {
|
|
149
|
+
const { selectedModel, availableModels } = await getCopilotModels(options);
|
|
150
|
+
if (availableModels.length === 0) {
|
|
151
|
+
throw new Error('No CodeMie model compatible with codemie-copilot is available.');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const answer = await inquirer.prompt([
|
|
155
|
+
{
|
|
156
|
+
type: 'list',
|
|
157
|
+
name: 'model',
|
|
158
|
+
message: 'Select model for codemie-copilot:',
|
|
159
|
+
choices: availableModels.map((model) => {
|
|
160
|
+
const badges = [];
|
|
161
|
+
if (model === availableModels[0]) badges.push('recommended');
|
|
162
|
+
if (process.env.CODEMIE_MODEL === model) badges.push('current');
|
|
163
|
+
return {
|
|
164
|
+
name: badges.length ? `${model} (${badges.join(', ')})` : model,
|
|
165
|
+
value: model,
|
|
166
|
+
};
|
|
167
|
+
}),
|
|
168
|
+
default: selectedModel,
|
|
169
|
+
},
|
|
170
|
+
]);
|
|
171
|
+
|
|
172
|
+
return answer.model;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function replaceValuelessModelArg(argv, model) {
|
|
176
|
+
const rewritten = [];
|
|
177
|
+
for (let i = 0; i < argv.length; i++) {
|
|
178
|
+
const arg = argv[i];
|
|
179
|
+
if ((arg === '--model' || arg === '-m') && (!argv[i + 1] || argv[i + 1].startsWith('-'))) {
|
|
180
|
+
rewritten.push(arg, model);
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
rewritten.push(arg);
|
|
184
|
+
}
|
|
185
|
+
return rewritten;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
async function handleCopilotOnlyModelUx() {
|
|
189
|
+
const options = parseCopilotOptions(process.argv);
|
|
190
|
+
const savedModel = await loadSavedModel();
|
|
191
|
+
applySavedModelIfNeeded(options, savedModel);
|
|
192
|
+
process.env.CODEMIE_MODEL_SOURCE = resolveInitialModelSource(options);
|
|
193
|
+
|
|
194
|
+
if (options.modelList) {
|
|
195
|
+
await printModelList(options);
|
|
196
|
+
process.exit(0);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (options.model === true) {
|
|
200
|
+
const model = await promptForModel(options);
|
|
201
|
+
await saveSelectedModel(model);
|
|
202
|
+
process.argv = replaceValuelessModelArg(process.argv, model);
|
|
203
|
+
process.env.CODEMIE_MODEL_SOURCE = 'cli';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
try {
|
|
208
|
+
await handleCopilotOnlyModelUx();
|
|
209
|
+
} catch (error) {
|
|
210
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
211
|
+
console.error(chalk.red('\n✗ Failed to resolve codemie-copilot models\n'));
|
|
212
|
+
console.error(chalk.white(message));
|
|
213
|
+
console.error('');
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const agent = AgentRegistry.getAgent('copilot-cli');
|
|
218
|
+
if (!agent) {
|
|
219
|
+
console.error('✗ GitHub Copilot CLI agent not found in registry');
|
|
220
|
+
process.exit(1);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const cli = new AgentCLI(agent);
|
|
224
|
+
await cli.run(process.argv);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pi Agent Entry Point
|
|
5
|
+
* Direct entry point for codemie-pi command
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AgentCLI } from '../dist/agents/core/AgentCLI.js';
|
|
9
|
+
import { AgentRegistry } from '../dist/agents/registry.js';
|
|
10
|
+
|
|
11
|
+
const agent = AgentRegistry.getAgent('pi');
|
|
12
|
+
if (!agent) {
|
|
13
|
+
console.error('✗ Pi agent not found in registry');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const cli = new AgentCLI(agent);
|
|
18
|
+
await cli.run(process.argv);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCLI.d.ts","sourceRoot":"","sources":["../../../src/agents/core/AgentCLI.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentCLI.d.ts","sourceRoot":"","sources":["../../../src/agents/core/AgentCLI.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,YAAY,CAAC;AAwBtE;;;GAGG;AACH,qBAAa,QAAQ;IAIP,OAAO,CAAC,OAAO;IAH3B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,OAAO,CAAmB;gBAEd,OAAO,EAAE,YAAY;IASzC;;OAEG;IACH,OAAO,CAAC,WAAW;IAWnB;;OAEG;IACH,OAAO,CAAC,YAAY;IAgFpB;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAQlC;;OAEG;YACW,SAAS;IA6QvB;;OAEG;YACW,iBAAiB;IA8B/B;;OAEG;YACW,UAAU;IA8ExB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA4B9B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,qBAAqB;YAgDf,oBAAoB;IAwClC;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAElF;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAEzD"}
|
|
@@ -2,6 +2,7 @@ import { Command } from 'commander';
|
|
|
2
2
|
import { readFileSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
+
import { SESSION_ORIGIN, SESSION_ORIGIN_ENV_KEY } from './session/types.js';
|
|
5
6
|
import { ConfigLoader } from '../../utils/config.js';
|
|
6
7
|
import { ensureApiBase, DEFAULT_CODEMIE_BASE_URL } from '../../providers/core/codemie-auth-helpers.js';
|
|
7
8
|
import { AuthMethod, ProviderName } from '../../providers/core/types.js';
|
|
@@ -17,6 +18,9 @@ import { ClaudeAcpPluginMetadata } from "../plugins/claude/claude-acp.plugin.js"
|
|
|
17
18
|
import { CodexPluginMetadata } from '../plugins/codex/codex.plugin.js';
|
|
18
19
|
import { KimiPluginMetadata } from '../plugins/kimi/kimi.plugin.js';
|
|
19
20
|
import { KimiAcpPluginMetadata } from '../plugins/kimi/kimi-acp.plugin.js';
|
|
21
|
+
import { PiPluginMetadata } from '../plugins/pi/pi.plugin.js';
|
|
22
|
+
import { CopilotCliPluginMetadata } from '../plugins/copilot-cli/index.js';
|
|
23
|
+
import { getAgentInstallCommand, getAgentLauncherCommand } from './agent-aliases.js';
|
|
20
24
|
import { createAssistantsSetupCommand } from '../../cli/commands/assistants/setup/index.js';
|
|
21
25
|
import { createSkillsSetupCommand } from '../../cli/commands/skills/setup/index.js';
|
|
22
26
|
/**
|
|
@@ -144,7 +148,7 @@ export class AgentCLI {
|
|
|
144
148
|
if (!(await this.adapter.isInstalled())) {
|
|
145
149
|
console.log(chalk.red(`\n✗ ${this.adapter.displayName} is not installed\n`));
|
|
146
150
|
console.log(chalk.white('Install it with:\n'));
|
|
147
|
-
console.log(chalk.cyan(`
|
|
151
|
+
console.log(chalk.cyan(` ${getAgentInstallCommand(this.adapter.name)}\n`));
|
|
148
152
|
// Windows-specific guidance for PATH refresh issue
|
|
149
153
|
this.displayWindowsPathGuidance();
|
|
150
154
|
process.exit(1);
|
|
@@ -338,12 +342,14 @@ export class AgentCLI {
|
|
|
338
342
|
appendAuditEvent('resume_blocked', auditData);
|
|
339
343
|
process.exit(1);
|
|
340
344
|
}
|
|
341
|
-
// Inject into subprocess env
|
|
342
|
-
//
|
|
345
|
+
// Inject into subprocess env — the spawned agent (and, transitively, the
|
|
346
|
+
// `codemie hook` invocations it shells out to) reads this to persist the
|
|
347
|
+
// session's origin, which is what actually gates ingestion. No same-process
|
|
348
|
+
// env write is needed here: origin is persisted to the Session record before
|
|
349
|
+
// any upload is attempted.
|
|
343
350
|
Object.assign(providerEnv, buildResumeEnvOverride(true));
|
|
344
|
-
process.env.CODEMIE_CONV_SYNC_DISABLED = '1';
|
|
345
351
|
appendAuditEvent('resume_external_confirmed', auditData);
|
|
346
|
-
logger.info(`[AgentCLI] External resume confirmed for agent ${this.adapter.name};
|
|
352
|
+
logger.info(`[AgentCLI] External resume confirmed for agent ${this.adapter.name}; session will not be synced`);
|
|
347
353
|
}
|
|
348
354
|
}
|
|
349
355
|
}
|
|
@@ -355,8 +361,6 @@ export class AgentCLI {
|
|
|
355
361
|
logger.debug(`[AgentCLI] collected agentArgs: ${JSON.stringify(agentArgs)}`);
|
|
356
362
|
// Run the agent (welcome message will be shown inside)
|
|
357
363
|
await this.adapter.run(agentArgs, providerEnv, options.printConfig ? { dryRun: true } : undefined);
|
|
358
|
-
// Clean up the process-level flag set for same-process conversation sync consumers.
|
|
359
|
-
delete process.env.CODEMIE_CONV_SYNC_DISABLED;
|
|
360
364
|
}
|
|
361
365
|
catch (error) {
|
|
362
366
|
// Show user-friendly error message in console first
|
|
@@ -385,7 +389,7 @@ export class AgentCLI {
|
|
|
385
389
|
const isWindows = process.platform === 'win32';
|
|
386
390
|
console.log(chalk.red(`\n✗ ${this.adapter.displayName} is not installed\n`));
|
|
387
391
|
console.log(chalk.white('Install it with:\n'));
|
|
388
|
-
console.log(chalk.cyan(`
|
|
392
|
+
console.log(chalk.cyan(` ${getAgentInstallCommand(this.adapter.name)}\n`));
|
|
389
393
|
// Windows-specific guidance for PATH refresh issue
|
|
390
394
|
if (isWindows) {
|
|
391
395
|
console.log(chalk.yellow(`⚠️ Windows users: If you just installed ${this.adapter.displayName},`));
|
|
@@ -508,6 +512,8 @@ export class AgentCLI {
|
|
|
508
512
|
'codex': CodexPluginMetadata,
|
|
509
513
|
'kimi': KimiPluginMetadata,
|
|
510
514
|
'kimi-acp': KimiAcpPluginMetadata,
|
|
515
|
+
'pi': PiPluginMetadata,
|
|
516
|
+
'copilot-cli': CopilotCliPluginMetadata,
|
|
511
517
|
};
|
|
512
518
|
return metadataMap[this.adapter.name];
|
|
513
519
|
}
|
|
@@ -544,7 +550,7 @@ export class AgentCLI {
|
|
|
544
550
|
if (recommendedModels && recommendedModels.length > 0) {
|
|
545
551
|
const modelExamples = recommendedModels.slice(0, 3).join(', ');
|
|
546
552
|
const suggestedModel = recommendedModels[0];
|
|
547
|
-
const command = this.adapter.name
|
|
553
|
+
const command = getAgentLauncherCommand(this.adapter.name);
|
|
548
554
|
console.log(chalk.white(` 1. ${this.adapter.displayName} requires compatible models (e.g., ${modelExamples})`));
|
|
549
555
|
console.log(chalk.white(' 2. Update profile: ') + chalk.cyan('codemie setup'));
|
|
550
556
|
console.log(chalk.white(` 3. Override for this session: ${command} --model ${suggestedModel}`));
|
|
@@ -593,7 +599,7 @@ export class AgentCLI {
|
|
|
593
599
|
}
|
|
594
600
|
}
|
|
595
601
|
export function buildResumeEnvOverride(isExternal) {
|
|
596
|
-
return isExternal ? {
|
|
602
|
+
return isExternal ? { [SESSION_ORIGIN_ENV_KEY]: SESSION_ORIGIN.EXTERNAL_RESUME } : {};
|
|
597
603
|
}
|
|
598
604
|
export function shouldBlockNonInteractiveResume() {
|
|
599
605
|
return !process.stdin.isTTY || process.env.CODEMIE_NO_PROMPTS === '1';
|