Package Exports
- codemate-ai
- codemate-ai/dist/cli.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 (codemate-ai) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CodeMate AI - Enterprise AI Coding Assistant ๐ค
Your AI pair programmer in the terminal
CodeMate AI is an enterprise-grade AI coding assistant that brings the power of large language models directly to your terminal. Built with TypeScript and powered by OpenAI, Anthropic, and DeepSeek, it transforms natural language into working code.
โจ Features
- ๐ Natural Language to Code - Describe what you want, get working code
- ๐ง Intelligent Code Editing - AST-based code modifications with context awareness
- ๐งช AI-Powered Testing - Automatic test generation and validation
- ๐ Performance Optimization - Prompt caching, context compression, intelligent pruning
- ๐ HTTP Server Mode - Browser-based UI with WebSocket support
- ๐ MCP Protocol Support - Extensible tool system via Model Context Protocol
- ๐ Multiple AI Providers - OpenAI, Anthropic, DeepSeek, OpenRouter, and custom APIs
- ๐จ Multiple Output Styles - Customizable output formatting and themes
- ๐พ Session Management - Resume conversations and track file changes
- ๐ Multi-Agent System - Specialized agents for different tasks
- ๐ฏ Slash Commands - Quick actions with
/help,/clear,/sessions, etc.
๐ฆ Installation
npm install -g codemate-aiRequirements:
- Node.js 18.0.0 or higher
- OpenAI, Anthropic, or DeepSeek API key
๐ Quick Start
First Run
On first run, CodeMate AI will guide you through interactive setup:
$ codemate
ๆฌข่ฟไฝฟ็จ CodeMate AI! ๐
ๆฃๆตๅฐ่ฟๆฏ้ฆๆฌก่ฟ่ก๏ผ้่ฆ่ฟ่กๅๅง้
็ฝฎใ
่ฏท้ๆฉ AI ๆไพๅ:
1. OpenAI (GPT-4, GPT-3.5)
2. Anthropic (Claude)
3. DeepSeek (ๅฝๅ
ๅฏ็จ๏ผๆงไปทๆฏ้ซ)
4. OpenRouter (ๅคๆจกๅ่ๅ)
5. ่ชๅฎไน (OpenAI ๅ
ผๅฎน API)
่ฏท่พๅ
ฅ้้กน (1-5): 3
่ฏท่พๅ
ฅ API Key: sk-...
่ฏท่พๅ
ฅๆจกๅๅ็งฐ (็ดๆฅๅ่ฝฆไฝฟ็จ้ป่ฎค: deepseek-chat):
โ
้
็ฝฎๅทฒไฟๅญๅฐ: ~/.aiclirc.json
ๆไพๅ: DeepSeek
ๆจกๅ: deepseek-chat
Base URL: https://api.deepseek.com
้
็ฝฎๅฎๆ๏ผ็ฐๅจๅฏไปฅๅผๅงไฝฟ็จไบใ
่ฏ่ฏ๏ผcodemate "ๅๅปบไธไธช Hello World ็จๅบ"Basic Usage
# One-shot command
codemate "create a REST API with Express and TypeScript"
# Interactive mode
codemate
# Server mode (browser UI)
codemate --server --port 3000๐ Usage Examples
Create a New Project
codemate "create a React app with TypeScript and Tailwind CSS"Refactor Code
codemate "refactor the UserService class to use dependency injection"Generate Tests
codemate "write unit tests for the authentication module"Debug Issues
codemate "fix the memory leak in the WebSocket server"โ๏ธ Configuration
Configuration file: ~/.aiclirc.json
Supported AI Providers
| Provider | Features | Best For |
|---|---|---|
| OpenAI | GPT-4, GPT-3.5 | International users, best ecosystem |
| Anthropic | Claude series | Long context, high safety |
| DeepSeek | ๅฝๅ ๅฏ็จ | China users, cost-effective |
| OpenRouter | Multi-model | Access multiple models |
| Custom | OpenAI-compatible | Self-hosted, special needs |
Configuration Examples
OpenAI:
{
"provider": "openai",
"apiKey": "sk-...",
"model": "gpt-4",
"performance": {
"enableCaching": true,
"enableCompression": true
}
}DeepSeek:
{
"provider": "deepseek",
"apiKey": "sk-...",
"model": "deepseek-chat",
"baseURL": "https://api.deepseek.com",
"performance": {
"enableCaching": true,
"enableCompression": true
}
}Custom API:
{
"provider": "custom",
"apiKey": "your-key",
"model": "your-model",
"baseURL": "https://api.example.com/v1",
"performance": {
"enableCaching": true,
"enableCompression": true
}
}Supported Models
OpenAI:
gpt-4gpt-4-turbogpt-3.5-turbo
Anthropic:
claude-3-5-sonnet-20241022claude-3-opus-20240229claude-3-sonnet-20240229
DeepSeek:
deepseek-chatdeepseek-coder
OpenRouter:
anthropic/claude-3.5-sonnetopenai/gpt-4- And many more...
๐ฎ Commands
Slash Commands
/help- Show available commands/clear- Clear current session/sessions- List all sessions/model- Change AI model/style- Change output style/snapshots- View file history/rewind- Revert file changes/exit- Exit AICLI
CLI Options
codemate [options] [prompt]
Options:
-v, --version Output version number
-h, --help Display help
-s, --server Start HTTP server mode
-p, --port <port> Server port (default: 3000)
-m, --model <model> AI model to use
--no-cache Disable prompt caching
--no-compression Disable context compression๐๏ธ Architecture
CodeMate AI is built with a modular architecture:
- Application Layer - Dependency injection and lifecycle management
- Service Layer - Core services (Model, Config, Session, EventBus)
- Manager Layer - Tool, Plugin, Agent, Command managers
- Tool System - File operations, search, bash execution, code editing
- Agent System - General, Plan, and Explore agents
- UI Layer - Ink-based terminal UI with React components
- Server Layer - HTTP server with WebSocket for browser UI
๐ Extensibility
Custom Plugins
Create custom plugins in ~/.codemate/plugins/:
import { Plugin } from 'codemate-ai';
export class MyPlugin extends Plugin {
name = 'my-plugin';
async onInit() {
console.log('Plugin initialized');
}
async onToolCall(tool: string, args: any) {
// Custom logic
}
}MCP Integration
CodeMate AI supports the Model Context Protocol for extending tool capabilities. Configure MCP servers in your config file.
๐ Documentation
- Complete Tutorial - 25-chapter tutorial series
- Architecture Design
- API Documentation
- Tool System
- Performance Optimization
๐งช Development
# Clone repository
git clone https://github.com/your-org/codemate-ai.git
cd codemate-ai
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run tests
npm test
# Type checking
npm run typecheck
# Format code
npm run format
# Run full CI
npm run ci
# Build for production
npm run build
# Test local installation
npm run test:install๐ค Contributing
Contributions are welcome! Please read our Contributing Guide for details.
๐ License
MIT ยฉ Your Name
๐ Acknowledgments
- Built with AI SDK
- UI powered by Ink
- Inspired by Neovate Code
๐ฎ Support
- ๐ Report Issues
- ๐ฌ Discussions
- ๐ง Email: support@codemate-ai.com
Made with โค๏ธ by developers, for developers