Connect Agent Tools

Crush

**Project Introduction**

Crush

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 AutoRouter endpoint (must end with /v1)
  • An AutoRouter API key (generated in the console)
  • A model ID exactly matching one exposed by your AutoRouter console (e.g. claude-sonnet-4-6, gemini-2.5-flash)

🚀 Step 1: Install Crush

npm install -g @charmland/crush

macOS users can also install via Homebrew:

brew install charmbracelet/tap/crush

Verify:

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": {
    "autorouter": {
      "type": "openai-compat",
      "base_url": "https://autorouter.top/v1",
      "api_key": "$AUTOROUTER_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

  • type must be openai-compat
  • base_url must end with /v1
  • api_key uses the $AUTOROUTER_API_KEY variable reference so you don't commit the key
  • models[].id must exactly match your AutoRouter console

🔑 Step 3: Set the API key env var

Linux / macOS

export AUTOROUTER_API_KEY="your-autorouter-api-key"

Windows (PowerShell)

$env:AUTOROUTER_API_KEY="your-autorouter-api-key"

Persist it in your shell profile for convenience.

✅ Step 4: Launch & pick a model

cd /path/to/my-project
crush

Press Ctrl+L (or type /model) to open the model switcher. Choose the autorouter provider, then pick your target model. Send a test message to verify.

❓ Troubleshooting

IssueFix
autorouter doesn't appear in the model switcherCheck the path and JSON format of crush.json
401 UnauthorizedMake sure AUTOROUTER_API_KEY is exported in the current shell
Model not foundConfirm models[].id matches your AutoRouter console
Config changes don't applyRestart Crush

On this page