Open-source AI coding assistant for the terminal
An open-source AI coding assistant for the terminal built with Go. Multi-provider LLM support, event-driven multi-agent orchestration, and full compatibility with Claude Code extensions, plugins, and project instructions.
- Multi-provider — Anthropic, OpenAI, Google, Moonshot, Alibaba, MiniMax — switch with
/model - Tools & MCP — Built-in tools (Edit, Bash, Glob, Grep, WebSearch, etc.) + MCP integration
- Skills, Subagents & Plugins — Claude Code compatible format, marketplace install
- Event-driven multi-agent — Parallel agent execution with decoupled event-based coordination
- Hooks — Lifecycle extensibility via shell, LLM, agent, or HTTP hooks
- Session — Auto-persist, resume, fork, auto-compact
- Performance — Minimal context injection, fast response, low token consumption
- Other — Prompt prediction, configurable thinking effort, scheduled loops, permission control, etc.
| Provider | Models | Environment Variables |
|---|---|---|
| Anthropic | Claude Opus 4.6, Sonnet 4.6 | ANTHROPIC_API_KEY or Vertex AI |
| OpenAI | GPT-5.2, GPT-5, o3, o4-mini, Codex | OPENAI_API_KEY |
| Gemini 3 Pro/Flash, 2.5 Pro/Flash | GOOGLE_API_KEY |
|
| Moonshot | Kimi K2.5, K2 Thinking | MOONSHOT_API_KEY |
| Alibaba | Qwen3.5 Plus, Qwen3 Max/Plus/Flash, QwQ, DeepSeek-V3/R1 | DASHSCOPE_API_KEY |
| MiniMax | M2.7, M2.7 Highspeed, M2.5, M2.5 Highspeed, M2.1, M2.1 Highspeed, M2 | MINIMAX_API_KEY |
curl -fsSL https://raw.githubusercontent.com/yanmxa/gencode/main/install.sh | bashRe-run to upgrade. To uninstall:
curl -fsSL https://raw.githubusercontent.com/yanmxa/gencode/main/install.sh | bash -s uninstallOther methods
Go Install
go install github.com/yanmxa/gencode/cmd/gen@latestBuild from Source
git clone https://github.com/yanmxa/gencode.git
cd gencode
go build -o gen ./cmd/gen
mkdir -p ~/.local/bin && mv gen ~/.local/bin/# Interactive mode
gen
# Non-interactive mode
gen "explain this function"
cat main.go | gen "review this code"
# Resume previous session
gen --continue # Resume most recent
gen --resume # Select from list- Run
gento start interactive mode - Use
/modelto connect a provider and select a model - Start chatting!
/model /tools /skills /agents /mcp /plugin /compact /think /search /loop /resume /fork /clear /init /memory — type /help for details.
Keyboard: Shift+Tab toggle permission mode, Ctrl+O expand tool details, Ctrl+C cancel, Ctrl+D exit.
GenCode stores configuration in ~/.gen/:
~/.gen/
├── providers.json # Provider connections and current model
├── settings.json # User settings (permissions, hooks, env)
├── skills.json # Skill states
├── projects/ # Project-scoped session transcripts + indexes
├── skills/ # Custom skill definitions
├── agents/ # Custom agent definitions
├── commands/ # Custom slash commands
└── plugins/ # Installed plugins
Place a GEN.md (or CLAUDE.md) in your project root to provide project-specific instructions. These are automatically loaded into the system prompt. Project-level settings can also be placed in .gen/settings.json.
Compared with Claude Code v2.1.112 on Apple Silicon, same model (claude-sonnet-4-6):
| Metric | GenCode | Claude Code | Advantage |
|---|---|---|---|
| Download size | 12 MB | 63 MB (+ Node.js 112 MB) | 5x smaller |
| Disk footprint | 38 MB | 175 MB | 4.6x smaller |
| Startup time | ~0.01s | ~0.20s | 20x faster |
| Startup memory | ~32 MB | ~189 MB | 5.8x less |
| Simple task | ~2.4s / 39 MB | ~10.4s / 286 MB | 4.3x faster, 7.3x less memory |
| Tool-use task | ~3.3s / 39 MB | ~26.0s / 285 MB | 7.9x faster, 7.2x less memory |
Both tools have comparable features (hooks, skills, plugins, session, MCP, etc.). The performance gap comes from Go's native compilation, minimal architecture design, and lean prompt engineering — vs Node.js V8/JIT/GC runtime overhead.
See full details: docs/benchmark-gencode-vs-claudecode.md
- Claude Code — Anthropic's AI coding assistant
- Aider — AI pair programming in terminal
- Continue — Open-source AI code assistant
Contributions welcome! See CONTRIBUTING.md for guidelines.
Apache License 2.0 - see LICENSE for details.