百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

crush

> AI 编程
开源

为所有人提供时尚的代理编码

27.0K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

为所有人提供时尚的代理编码

Crush


Your new coding bestie, now available in your favourite terminal.
Your tools, your code, and your workflows, wired into your LLM of choice.

终端里的编程新搭档,
无缝接入你的工具、代码与工作流,全面兼容主流 LLM 模型。

Features

  • Multi-Model: choose from a wide range of LLMs or add your own via OpenAI- or Anthropic-compatible APIs
  • Flexible: switch LLMs mid-session while preserving context
  • Session-Based: maintain multiple work sessions and contexts per project
  • LSP-Enhanced: Crush uses LSPs for additional context, just like you do
  • Extensible: add capabilities via MCPs (http, stdio, and sse)
  • Works Everywhere: first-class support in every terminal on macOS, Linux, Windows (PowerShell and WSL), Android, FreeBSD, OpenBSD, and NetBSD
  • Industrial Grade: built on the Charm ecosystem, powering 25k+ applications, from leading open source projects to business-critical infrastructure

Installation

Use a package manager:

bash
# Homebrew
brew install charmbracelet/tap/crush

# NPM
npm install -g @charmland/crush

# Arch Linux (btw)
yay -S crush-bin

# Nix
nix run github:numtide/nix-ai-tools#crush

# FreeBSD
pkg install crush

Windows users:

bash
# Winget
winget install charmbracelet.crush

# Scoop
scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crush
Nix (NUR)

Crush is available via the official Charm NUR in nur.repos.charmbracelet.crush, which is the most up-to-date way to get Crush in Nix.

You can also try out Crush via the NUR with nix-shell:

bash
# Add the NUR channel.
nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
nix-channel --update

# Get Crush in a Nix shell.
nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'

NixOS & Home Manager Module Usage via NUR

Crush provides NixOS and Home Manager modules via NUR. You can use these modules directly in your flake by importing them from NUR. Since it auto detects whether its a home manager or nixos context you can use the import the exact same way :)

…
Debian/Ubuntu
bash
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install crush
Fedora/RHEL
bash
echo '[charm]
name=Charm
baseurl=https://repo.charm.sh/yum/
enabled=1
gpgcheck=1
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
sudo yum install crush

Or, download it:

  • Packages are available in Debian and RPM formats
  • Binaries are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD

Or just install it with Go:

go install github.com/charmbracelet/crush@latest

On illumos (OpenIndiana, OmniOS), the command above works as-is. Only native OS notifications are unavailable there; terminal-based notifications (OSC) and the terminal bell still work. On Oracle Solaris, add -tags sqlite3_dotlk so the local database uses dot-file locking:

go install -tags sqlite3_dotlk github.com/charmbracelet/crush@latest

[!WARNING] Productivity may increase when using Crush and you may find yourself nerd sniped when first using the application. If the symptoms persist, join the [Slack][slack] or [Discord][discord] and nerd snipe the rest of us.

Getting Started

The quickest way to get started is to choose a Hyper model from model picker. Follow the steps to authenticate and you'll be good to go.

Hyper, from Charm, is the official Crush provider. It’s subscription-based, with a free tier, and optimized for Crush. It’s privacy focused, with zero data retention (ZDR) is and designed to comply with GDPR. More on Hyper.

API Keys

You can also use Crush with many other providers such as Anthopic, OpenAI, Gemini, OpenRouter and so on. Press ctrl+l to open the model picker, choose the provider of your choice, and paste your API key.

That said, you can also set environment variables for preferred providers:

Environment Variable Provider
HYPER_API_KEY Charm Hyper
ANTHROPIC_API_KEY Anthropic
OPENAI_API_KEY OpenAI
VERCEL_API_KEY Vercel AI Gateway
GEMINI_API_KEY Google Gemini
ZAI_API_KEY Z.ai
MINIMAX_API_KEY MiniMax
SYNTHETIC_API_KEY Synthetic
HF_TOKEN Hugging Face Inference
CEREBRAS_API_KEY Cerebras
OPENROUTER_API_KEY OpenRouter
IONET_API_KEY io.net
ALIBABA_SINGAPORE_API_KEY Alibaba (Singapore)
ALIBABA_US_API_KEY Alibaba (United States)
GROQ_API_KEY Groq
AVIAN_API_KEY Avian
OPENCODE_API_KEY OpenCode Zen & Go
VERTEXAI_PROJECT Google Cloud VertexAI (Gemini)
VERTEXAI_LOCATION Google Cloud VertexAI (Gemini)
AWS_ACCESS_KEY_ID Amazon Bedrock (Claude)
AWS_SECRET_ACCESS_KEY Amazon Bedrock (Claude)
AWS_REGION Amazon Bedrock (Claude)
AWS_PROFILE Amazon Bedrock (Custom Profile)
AWS_BEARER_TOKEN_BEDROCK Amazon Bedrock
AZURE_OPENAI_API_ENDPOINT Azure OpenAI models
AZURE_OPENAI_API_KEY Azure OpenAI models (optional when using Entra ID)
AZURE_OPENAI_API_VERSION Azure OpenAI models
MOONSHOT_API_KEY Moonshot

Also note that Crush can support nearly any provider, including Local Models. For more info see Custom Providers below.

By the Way

Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?

Crush’s default model listing is managed in Catwalk, a community-supported, open source repository of Crush-compatible models, and you’re welcome to contribute.

Configuration

[!TIP] Crush ships with a builtin skill for configuring itself. Most of the time you can just tell what you want it to configure and it will get the job done.

Crush runs great with no configuration. That said, if you do need or want to customize Crush, you can, with a crushrc.

A crushrc is just Bash with some Crush-specific builtins. It’s a lot like a .bashrc, just for your Crush. Because Crush has a native, built-in Bash interpreter, Bash-based config works identically across all platforms, including Windows.

For example:

bash
# Add Ollama.
provider add ollama --type ollama --base-url "http://localhost:11434/v1"

# Register a model on Ollama.
model add ollama/llama3.3 --name "Llama 3.3" --context-window 128000

# Auto-approve some tools.
permissions allow view edit

# Include some other file on a specific machine.
if [[ $HOSTNAME == "babysquid" ]]; then
    source ~/my-stuff/babysquid.sh
fi

# Add an MCP server, with a GitHub API token stored in 1Password.
mcp add github \
  --type http \
  --url "https://api.github.com/mcp/" \
  --header Authorization "Bearer $(op read 'op://my-secret-key')"

Configuration can be added either local to the project itself, or globally, with the following priority:

Priority Unix-like Windows
1 ./.crushrc .\.crushrc
2 ./crushrc .\crushrc
3 ~/.config/crush/crushrc %USERPROFILE%\.config\crush\crushrc

(Crush respects the XDG Base Directory Specification, so your paths may differ depending on your XDG_CONFIG_HOME value. Data directories such as ~/.local/share/crush and %LOCALAPPDATA%\crush contain JSON state only; Crush does not execute a crushrc from them.)

What about the old JSON format? It’s still supported, but it should be considered deprecated. See: the config docs for details.

[!TIP] You can override the user and data config locations by setting:

  • CRUSH_GLOBAL_CONFIG
  • CRUSH_GLOBAL_DATA

As an additional note, Crush also stores ephemeral data, such as application state, in one additional location. This is state and should not be edited by hand, nor should it be considered configuration.

bash
# Unix
$HOME/.local/share/crush/crush.json

# Windows
%LOCALAPPDATA%\crush\crush.json

A note on security

Both crushrc and crush.json are trusted code; crushrc runs in a full shell, and any $(...) in crush.json runs at load time. Don't launch Crush in a directory whose config you haven't reviewed, and don't randomly source files from the internet into your config.

Environment Variables

The top-level env field sets environment variables at startup, before providers are configured. This is useful for variables that affect provider authentication (e.g. the AWS SDK credential chain) without wrapping the crush command in a shell script or exporting them in your shell profile:

json
{
  "$schema": "https://charm.land/crush.json",
  "env": {
    "AWS_PROFILE": "my-sso-profile"
  }
}

Values support the same $VAR and $(command) expansion as other config fields, so you can reference existing environment variables or shell out for a value.

LSPs

Crush can use LSPs for additional context to help inform its decisions, just like you would. LSPs can be added manually like so:

bash
# crushrc

lsp add go --command "gopls" --env "GOTOOLCHAIN go1.24.5"
lsp add typescript --command "typescript-language-server" --args --stdio
lsp add nix --command "nil"

MCPs

Crush also supports Model Context Protocol (MCP) servers through three transport types: stdio for command-line servers, http for HTTP endpoints, and sse for Server-Sent Events.

…

MCP OAuth

HTTP

Issues· 828 开放

查看全部 Issues在 GitHub 打开
  • #4002

    以 Document DemonRoute 作为自定义提供程序的示例吗?

    更新于 2026年9月30日
  • #3865

    外部编辑器: 退出时缓冲区为空,不会清空作曲器

    更新于 2026年9月30日
  • #3840

    请求超时可能导致无限错误,循环运行且 CPU 使用率为 100%

    更新于 2026年9月30日
  • #3991

    在 Crush 会话之间为选定上下文设置 MemCode MCP

    更新于 2026年9月29日
  • #3996

    在使用 ollama 并超出上下文窗口时进行会话锁定

    area: sessionprovider: ollama更新于 2026年9月29日
  • #3989

    # 二进制输出会绕过 bash 工具的输出截断: 30,000 的预算以显示列为单位进行测量,因此工具结果可以达到数十 MB

    area: tools更新于 2026年9月29日
  • #3943

    在尝试写代码时,计划模式捕获了 `[` 作为标签更改

    更新于 2026年9月28日
  • #3972

    kill 从未到达外部二进制文件

    更新于 2026年9月28日
  • #3978

    压碎统计数据的时间序列以随机顺序显示

    更新于 2026年9月28日
  • #3976

    crush logs 未解析项目目录

    更新于 2026年9月28日

> 标签

Goagentic-aiaillmsravishing

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月30日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.