Package Exports
- @codemieai/code
- @codemieai/code/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@codemieai/code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
AI/Run CodeMie CLI
Professional CLI wrapper for managing multiple AI coding agents
Table of Contents
- Synopsis
- Quick Start
- Installation
- Usage
- Commands
- Configuration
- Authentication & SSO Management
- Examples
- Agents
- Troubleshooting
- Development
- License
- Links
Synopsis
codemie [COMMAND] [OPTIONS]
codemie-code [MESSAGE|--task TASK] [OPTIONS]
codemie-claude [-p MESSAGE] [OPTIONS]
codemie-codex [MESSAGE|--task TASK] [OPTIONS]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 and Codex.
Quick Start
# 1. Install
npm install -g @codemieai/code
# 2. Setup (interactive wizard)
codemie setup
# 3. Start coding with built-in agent
codemie-code "Review my code for bugs"Installation
From npm (Recommended)
npm install -g @codemieai/codeFrom Source (Development)
git clone https://github.com/codemie-ai/codemie-code.git
cd codemie-code
npm install && npm run build && npm linkVerify Installation
codemie --help
codemie doctorUsage
Built-in Agent (CodeMie Native)
Ready to use immediately - no installation required:
# Interactive conversation
codemie-code
# Execute single task
codemie-code --task "fix bugs in src/utils"
# Start with initial message
codemie-code "Help me refactor this component"
# Debug mode
codemie-code --debugExternal Agents
Install and run external agents:
# Install agents
codemie install claude
codemie install codex
# Run via shortcuts (recommended)
codemie-claude -p "Review my API code"
codemie-codex --task "Generate unit tests"
# Or run through main CLI
codemie run claude --task "Fix security issues"Commands
Core Commands
codemie setup # Interactive configuration wizard
codemie auth <command> # Manage SSO authentication
codemie list # List all available agents
codemie install <agent> # Install an agent
codemie uninstall <agent> # Uninstall an agent
codemie run <agent> [args...] # Run an agent
codemie doctor # Health check and diagnostics
codemie config <action> # Manage configuration
codemie version # Show version informationAgent Shortcuts
Direct access to agents with automatic configuration:
# Built-in agent
codemie-code [message] # Interactive or with initial message
codemie-code --task "task" # Single task execution
codemie-code health # Health check
# External agents
codemie-claude # Claude Code agent (interactive)
codemie-claude -p "message" # Claude Code agent (print mode)
codemie-codex [message] # Codex agent
# Configuration overrides
codemie-claude --model claude-4-5-sonnet --api-key your-key
codemie-codex --model gpt-4o --provider openaiConfiguration Commands
codemie config list # Show all configuration
codemie config get <key> # Get specific value
codemie config set <key> <value> # Set configuration value
codemie config reset # Reset to defaultsConfiguration
Setup Wizard (Recommended)
Run the interactive setup wizard:
codemie setupThe wizard will:
- Guide you through provider selection
- Test your credentials via health endpoints
- Fetch available models in real-time
- Save configuration to
~/.codemie/config.json
Supported Providers
- ai-run-sso - AI/Run CodeMie SSO (unified enterprise gateway)
- openai - OpenAI API
- azure - Azure OpenAI
- bedrock - AWS Bedrock
- litellm - LiteLLM Proxy
Manual Configuration
Environment Variables (Highest Priority)
# Generic (works with any provider)
export CODEMIE_BASE_URL="https://your-proxy.com"
export CODEMIE_API_KEY="your-api-key"
export CODEMIE_MODEL="your-model"
export CODEMIE_PROVIDER="litellm"
# Provider-specific
export OPENAI_API_KEY="your-openai-key"
export OPENAI_BASE_URL="https://api.openai.com/v1"Configuration File
Location: ~/.codemie/config.json
{
"provider": "litellm",
"model": "claude-4-5-sonnet",
"baseUrl": "https://litellm.codemie.example.com",
"apiKey": "your-api-key",
"timeout": 300
}Model Compatibility
AI/Run CodeMie CLI automatically validates model compatibility:
- Codex: OpenAI models only (gpt-4, gpt-4o, gpt-5, etc.)
- Claude: Both Claude and GPT models
- CodeMie Native: All supported models
When incompatible models are detected, AI/Run CodeMie CLI will:
- Fetch available models from your provider's API
- Filter to compatible models
- Offer to switch automatically
Authentication & SSO Management
AI/Run CodeMie SSO Setup
For enterprise environments with AI/Run CodeMie SSO (Single Sign-On):
Initial Setup via Wizard
The setup wizard automatically detects and configures AI/Run CodeMie SSO:
codemie setupThe wizard will:
- Detect if you have access to AI/Run CodeMie SSO
- Guide you through the authentication flow
- Test the connection with health checks
- Fetch and display available models
- Save secure credentials to
~/.codemie/config.json
Manual SSO Authentication
If you need to authenticate separately or refresh your credentials:
# Authenticate with AI/Run CodeMie SSO
codemie auth login --url https://your-airun-codemie-instance.com
# Check authentication status
codemie auth status
# Refresh expired tokens
codemie auth refresh
# Logout and clear credentials
codemie auth logoutToken Management
SSO tokens are automatically managed but you can control them manually:
Token Refresh
AI/Run CodeMie CLI automatically refreshes tokens when they expire. For manual refresh:
# Refresh SSO credentials (extends session)
codemie auth refreshWhen to refresh manually:
- Before long-running tasks
- After extended periods of inactivity
- When you receive authentication errors
- Before important demonstrations
Authentication Status
Check your current authentication state:
codemie auth statusStatus information includes:
- Connection status to AI/Run CodeMie SSO
- Token validity and expiration
- Available models for your account
- Provider configuration details
Token Troubleshooting
Common authentication issues and solutions:
# Token expired
codemie auth refresh
# Connection issues
codemie doctor # Full system diagnostics
codemie auth status # Check auth-specific issues
# Complete re-authentication
codemie auth logout
codemie auth login --url https://your-airun-codemie-instance.com
# Reset all configuration
codemie config reset
codemie setup # Run wizard againEnterprise SSO Features
AI/Run CodeMie SSO provides enterprise-grade features:
- Secure Token Storage: Credentials stored in system keychain
- Automatic Refresh: Seamless token renewal without interruption
- Multi-Model Access: Access to Claude, GPT, and other models through unified gateway
- Audit Logging: Enterprise audit trails for security compliance
- Role-Based Access: Model access based on organizational permissions
Examples
Common Workflows
# Code review workflow
codemie-code "Review this PR for security issues and performance"
# Bug fixing
codemie-claude -p "Fix the authentication bug in src/auth.ts"
# Test generation
codemie-codex --task "Generate comprehensive tests for the API endpoints"
# Documentation
codemie-code "Document the functions in utils/helpers.js"
# Refactoring
codemie-claude -p "Refactor this component to use React hooks"Configuration Examples
# Setup with different providers
codemie config set provider openai
codemie config set model gpt-4o
codemie config set apiKey sk-your-key
# Temporary model override
codemie-claude --model claude-4-5-sonnet -p "Explain this algorithm"
# Debug mode for troubleshooting
codemie-code --debug --task "analyze performance issues"Advanced Usage
# Run specific agent versions
codemie run claude --version latest
# Pass custom arguments
codemie-codex --temperature 0.1 --max-tokens 2000 "Generate clean code"
# Health checks
codemie doctor # Full system check
codemie-code health # Built-in agent check
codemie-claude health # Claude agent checkAgents
CodeMie Native (Built-in)
LangGraph-based coding assistant with no installation required.
Features:
- Modern terminal UI with streaming responses
- File operations, git integration, command execution
- Clipboard support with automatic image detection
- Interactive conversations with context memory
- Task-focused execution mode
- Debug mode with comprehensive logging
Usage:
codemie-code # Interactive mode
codemie-code --task "task" # Single task
codemie-code --debug # Debug modeClaude Code
Anthropic's official CLI with advanced code understanding.
Installation: codemie install claude
Features:
- Advanced code understanding and generation
- Multi-file editing capabilities
- Project-aware context
- Interactive conversations
Codex
OpenAI's code generation assistant optimized for completion tasks.
Installation: codemie install codex
Features:
- Code completion and generation
- Function generation and bug fixing
- Code explanation and documentation
- Requires OpenAI-compatible models only
Troubleshooting
Command Not Found
# Re-link the package
npm link
which codemie
# Check installation
npm list -g @codemieai/codeConfiguration Issues
# Run setup wizard
codemie setup
# Check current config
codemie config list
# Reset if needed
codemie config resetConnection Problems
# Run diagnostics
codemie doctor
# Test specific agent
codemie-code health
codemie-claude health
# Debug mode for detailed logs
codemie-code --debugAgent Installation Failures
# Check internet connection
curl -I https://api.github.com
# Clear npm cache
npm cache clean --force
# Retry installation
codemie install claudeModel Compatibility Errors
When you see "Model not compatible" errors:
- Check your configured model:
codemie config get model - Run the agent to see compatible options
- Set a compatible model:
codemie config set model gpt-4o - Or override temporarily:
codemie-codex --model gpt-4o
Development
Project Structure
codemie-code/
├── bin/ # Executable entry points
│ ├── codemie.js # Main CLI
│ ├── codemie-code.js # Built-in agent
│ ├── codemie-claude.js # Claude shortcut
│ └── codemie-codex.js # Codex shortcut
├── src/
│ ├── agents/ # Agent registry and adapters
│ ├── cli/ # CLI command implementations
│ ├── env/ # Environment and config management
│ ├── workflows/ # Workflow management
│ ├── tools/ # VCS tools management
│ └── utils/ # Shared utilities
└── tests/ # Test filesBuilding
npm run build # Compile TypeScript
npm run dev # Watch mode
npm run lint # Check code style
npm run test # Run tests
npm run ci # Full CI pipelineTesting
npm run build && npm link
codemie --help
codemie doctor
codemie-code healthLicense
Apache-2.0