Crush
Crush tutorial — Open-source terminal AI coding agent by Charm, with multi-model switching, LSP integration and MCP servers. Configure EasyRouter via crush.json.
Project Introduction
Crush is an open-source AI coding agent by Charm, running inside your terminal. It supports multi-model switching, LSP integration, MCP servers and agentic coding workflows — and ships with a polished, responsive TUI.
📦 Prerequisites
What you'll need
- Node.js installed
- An EasyRouter endpoint (must end with
/v1) - An EasyRouter API key (generated in the console)
- A model ID exactly matching one exposed by your EasyRouter console (e.g.
claude-sonnet-4-6,gemini-2.5-flash)
🚀 Step 1: Install Crush
npm install -g @charmland/crushmacOS users can also install via Homebrew:
brew install charmbracelet/tap/crushVerify:
crush --version🔧 Step 2: Edit the config file
Config file location:
- Linux / macOS:
~/.config/crush/crush.json - Windows:
%USERPROFILE%\.config\crush\crush.json
Create it if it doesn't exist, and paste in:
{
"$schema": "https://charm.land/crush.json",
"providers": {
"easyrouter": {
"type": "openai-compat",
"base_url": "https://easyrouter.io/v1",
"api_key": "$EASYROUTER_API_KEY",
"models": [
{
"id": "claude-sonnet-4-6",
"name": "Claude Sonnet 4.6",
"context_window": 200000,
"default_max_tokens": 32768,
"can_reason": true
},
{
"id": "gemini-2.5-flash",
"name": "Gemini 2.5 Flash",
"context_window": 1000000,
"default_max_tokens": 32768,
"can_reason": false
}
]
}
}
}Field notes
typemust beopenai-compatbase_urlmust end with/v1api_keyuses the$EASYROUTER_API_KEYvariable reference so you don't commit the keymodels[].idmust exactly match your EasyRouter console
🔑 Step 3: Set the API key env var
Linux / macOS
export EASYROUTER_API_KEY="your-easyrouter-api-key"Windows (PowerShell)
$env:EASYROUTER_API_KEY="your-easyrouter-api-key"Persist it in your shell profile for convenience.
✅ Step 4: Launch & pick a model
cd /path/to/my-project
crushPress Ctrl+L (or type /model) to open the model switcher. Choose the easyrouter provider, then pick your target model. Send a test message to verify.
❓ Troubleshooting
| Issue | Fix |
|---|---|
| easyrouter doesn't appear in the model switcher | Check the path and JSON format of crush.json |
| 401 Unauthorized | Make sure EASYROUTER_API_KEY is exported in the current shell |
| Model not found | Confirm models[].id matches your EasyRouter console |
| Config changes don't apply | Restart Crush |