跳轉到主要內容
Crush 是 Charm 的開源終端 AI 編碼代理。
協定:OpenAI 相容
  • Base URL: https://api.orcarouter.ai/v1包含 /v1 後綴)

安裝

npm install -g @charmland/crush
該 npm 套件是一個啟動器;首次執行時會自動下載對應平台的二進位檔(需要網路存取)。

設定

設定檔:~/.config/crush/crush.json(Windows:%USERPROFILE%\.config\crush\crush.json)。
{
  "$schema": "https://charm.land/crush.json",
  "providers": {
    "orcarouter": {
      "type": "openai",
      "base_url": "https://api.orcarouter.ai/v1",
      "api_key": "sk-orca-...",
      "models": [
        { "id": "orcarouter/auto", "name": "OrcaRouter Auto", "context_window": 200000, "default_max_tokens": 4096 }
      ]
    }
  }
}
若你偏好,可將 orcarouter/auto 換成特定模型,例如 anthropic/claude-opus-4.8google/gemini-2.5-flash。模型 ID 一律使用 vendor/model 格式。

執行

crush run "Reply with exactly: OK"
預期輸出:OK

注意事項

  • base_url 必須包含 /v1
  • 首次執行會下載二進位檔,因此初始啟動需要網路存取。
  • models[].id 使用 vendor/model 格式(例如 orcarouter/autoanthropic/claude-opus-4.8)。

啟用思考/推理

crush.json 中按模型設定:
  • OpenAI 風格模型——"reasoning_effort": "high"(值為 lowmediumhigh),並將模型標記為 "can_reason": true
  • Anthropic 模型——"think": true(擴展思考的布林開關)。
"models": [
  { "id": "anthropic/claude-sonnet-4.6", "name": "Sonnet 4.6", "context_window": 200000, "default_max_tokens": 4096, "can_reason": true, "reasoning_effort": "high" }
]
已驗證:reasoning_effort: "high" 對 OrcaRouter 有效。