Crush
<p align="center">
<a href="https://stuff.charm.sh/crush/charm-crush.png"><img width="450" alt="Charm Crush Logo" src="https://github.com/user-attachments/assets/cf8ca3ce-8b02-43f0-9d0f-5a331488da4b" /></a><br />
<a href="https://github.com/charmbracelet/crush/releases"><img src="https://img.shields.io/github/release/charmbracelet/crush" alt="Latest Release"></a>
<a href="https://github.com/charmbracelet/crush/actions"><img src="https://github.com/charmbracelet/crush/actions/workflows/build.yml/badge.svg" alt="Build Status"></a>
</p>
<p align="center">Your new coding bestie, now available in your favourite terminal.<br />Your tools, your code, and your workflows, wired into your LLM of choice.</p>
<p align="center">终端里的编程新搭档,<br />无缝接入你的工具、代码与工作流,全面兼容主流 LLM 模型。</p>
<p align="center"><img width="800" alt="Crush Demo" src="https://github.com/user-attachments/assets/58280caf-851b-470a-b6f7-d5c4ea8a1968" /></p>
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) - Channel-Ready: MCP servers can push real-time events into your session via Claude Channels — CI failures, webhooks, and more, acting on them without you typing a thing
- 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:
# Homebrew
brew install charmbracelet/tap/crush
# NPM (macOS, Linux, and Windows)
npm install -g @charmland/crush
# Arch Linux (btw)
yay -S crush
# Nix
nix run github:numtide/nix-ai-tools#crush
# FreeBSD
pkg install crush
Windows users:
# Winget
winget install charmbracelet.crush
# Scoop
scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crush
<details>
<summary><strong>Nix (NUR)</strong></summary>
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:
# 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 it's a home manager or nixos context you can use the import the exact same way :)
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nur.url = "github:nix-community/NUR";
};
outputs = { self, nixpkgs, nur, ... }: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
nur.modules.nixos.default
nur.repos.charmbracelet.modules.crush
{
programs.crush = {
enable = true;
settings = {
providers = {
openai = {
id = "openai";
name = "OpenAI";
base_url = "https://api.openai.com/v1";
type = "openai";
api_key = "sk-fake123456789abcdef...";
models = [
{
id = "gpt-5.6-sol";
name = "GPT-5.6 Sol";
}
];
};
};
lsp = {
go = { command = "gopls"; enabled = true; };
nix = { command = "nil"; enabled = true; };
};
options = {
context_paths = [ "/etc/nixos/configuration.nix" ];
tui = { compact_mode = true; };
debug = false;
};
};
};
}
];
};
};
}
</details>
<details>
<summary><strong>Debian/Ubuntu</strong></summary>
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
</details>
<details>
<summary><strong>Fedora/RHEL</strong></summary>
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
</details>
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 the
little model picker. Follow the steps to authenticate and you're ready to go.
<p><a href="https://hyper.charm.land"><img width="340" height="200" alt="Charm Hyper" src="https://github.com/user-attachments/assets/50875289-7992-454d-9f14-9f790413fb5e" /></a></p>
Hyper, from Charm, is the official model provider for Crush. It’s
built on open-weight models and is optimized for Crush, with an emphasis
on high-quality inference. There are subscription and prepaid options, including zero data retention
(ZDR). It's also GDPR compliant!
More on Hyper.
API Keys
You can also use Crush with many other providers such as Anthopic, OpenAI,
Gemini, OpenRouter and so on. Press <kbd>ctrl+l</kbd> 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:
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.
<a href="https://github.com/charmbracelet/catwalk"><img width="174" height="174" alt="Catwalk Badge" src="https://github.com/user-attachments/assets/95b49515-fe82-4409-b10d-5beb0873787d" /></a>
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:
# 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:
(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_CONFIGCRUSH_GLOBAL_DATACRUSH_DATA_DIR (overrides the per-project .crush directory)
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.
# 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:
{
"$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.
Themes
Crush ships with built-in color themes.
Switching Themes
Open the command palette with ctrl+p, select Themes, and browse the
list. The UI previews each theme as you navigate, and pressing enter
confirms the selection. Press esc to cancel and revert.
Editing Themes
Open Themes, highlight the theme to customize, and press ctrl+e.
Changes preview live as you type. Press enter or ctrl+s to save, or esc
to cancel and revert. User themes are stored globally in the Crush config
directory under themes/.
You can also select a theme directly in your config with active_theme:
{
"$schema": "https://charm.land/crush.json",
"options": {
"tui": {
"active_theme": "gruvbox-dark"
}
}
}
Custom theme palettes are stored as JSON files in the global theme directory.
For example, ~/.config/crush/themes/my-theme.json:
{
"base": "gruvbox-dark",
"primary": "#ff6b6b",
"bg_base": "#1a1a2e"
}
Select it by setting active_theme to my-theme or from the Themes
dialog.
Built-In Themes
LSPs
Crush can use LSPs for additional context to help inform its decisions, just
like you would. LSPs can be added manually like so:
# 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.
# crushrc
# Add a local MCP server that runs a Node.js script.
mcp add filesystem --command node --args /path/to/mcp-server.js \
--timeout 10 --disabled-tools some-tool-name --env NODE_ENV production
# Add a GitHub MCP server that uses an API token.
mcp add github --type http --url https://api.github.com/mcp/ \
--timeout 10 --header Authorization "Bearer $GH_PAT" \
--disabled-tools create_issue --disabled-tools create_pull_request
# Add a streaming MCP server that uses SSE.
mcp add streaming-service --type sse --url "https://example.com/mcp/sse" \
--timeout 10 --header API-Key "$API_KEY"
MCP OAuth
HTTP and SSE MCP servers that require OAuth can use Crush's built-in
authorization-code flow instead of a static Authorization header. Set
"oauth": true to enable it:
{
"mcp": {
"linear": {
"type": "http",
"url": "https://mcp.linear.app/mcp",
"oauth": true
}
}
}
Pre-registered clients
Some servers (GitHub, Slack) don't support dynamic client registration.
For those, register an OAuth app with the provider and supply the
credentials directly. All values support shell expansion:
{
"mcp": {
"github": {
"type": "http",
"url": "https://api.github.com/mcp/",
"oauth": true,
"oauth_client_id": "Iv1.abc123def456",
"oauth_client_secret": "$GITHUB_MCP_SECRET",
"oauth_callback_port": 40704
}
}
}
When oauth_client_id is set, Crush skips dynamic client registration
and authenticates as the specified client. When omitted, Crush attempts
dynamic registration automatically (works with Linear, Notion, and other
servers that support RFC 7591).
Sessionless servers
Some HTTP MCP servers are sessionless — they never issue a
Mcp-Session-Id and reject the subscriptions/listen stream Crush opens
for list-changed notifications, which would otherwise break the
connection. Crush auto-detects known sessionless servers (GitHub MCP,
api.githubcopilot.com/mcp), so those need no extra configuration.
For other sessionless servers, mark them explicitly with
"sessionless": true (or --sessionless true in crushrc); set it to
false to force the default behavior for an auto-detected URL. The
tradeoff is that a sessionless server won't push live
tool/prompt/resource list-changed notifications.
Channels (experimental)
An MCP server can also act as a channel: instead of only exposing tools it
calls, it pushes events straight into your session so Crush reacts to things
happening outside the terminal — a webhook, a CI failure, a chat message. See
the channels reference
for the protocol.
A server becomes a channel by declaring the claude/channel capability in its
initialize result (capabilities.experimental["claude/channel"] = {}) and
emitting notifications/claude/channel events with a content body and an
optional meta map. Crush injects each event into the active session as a
<channel> element:
<channel source="webhook" severity="high" run_id="1234">
build failed on main: https://ci.example.com/run/1234
</channel>
Listing a channel server in mcp is not enough to enable it — pushing is
gated behind an explicit opt-in, so a server present in config stays silent
until you ask for it. Opt in per launch with the --channels flag:
# Enable one or more configured MCP servers as channels for this session.
crush --channels server:webhook
crush --channels server:webhook --channels server:signal
Or persistently, with channel_enabled on the server's mcp entry — no CLI
flag needed on each launch:
{
"mcp": {
"webhook": {
"type": "http",
"url": "https://example.com/mcp",
"channel_enabled": true
},
"signal": {
"type": "stdio",
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/signal-mcp",
"python",
"signal_mcp/main.py",
"--user-id",
"+15551234567",
"--channel"
]
}
}
}
In crushrc, use --channel true:
mcp add webhook --type http --url "https://example.com/mcp" --channel true
Once a server is opted in, a Channels section on the landing page and in
the sidebar shows its state, and the Channels command lists every opted-in
server along with channel-capable servers that are not enabled yet.
The source attribute is always the (trusted) server name. Payloads are
untrusted, server-initiated input: Crush validates their structure, caps the
body and attribute sizes, restricts meta keys to identifiers
([A-Za-z0-9_]), escapes all content so a payload cannot break out of the
<channel> element or forge attributes, and drops malformed payloads. A
server that has not been opted in via --channels or channel_enabled, or
that never declared the capability, cannot inject anything.
Channel delivery works in the default in-process crush and against a shared
crush serve backend. In-process, an event routes into the session you have
open, or starts one if none is open, so it is never dropped. Against a
crush serve backend the server routes each event exactly once — into the
session an attached client is viewing (the most recently updated one when
clients are viewing different sessions), otherwise into the workspace's most
recent session, creating one only when none exists. That holds even with no
clients connected, so a headless server still processes channel pushes;
attached clients see the injected turn arrive through the normal event
stream. Servers that are live channels are marked channel in the MCP list
so you can confirm the opt-in took effect.
Two-way channels. A channel can also be interactive. Because a channel is a
regular MCP server, any tool it exposes (a reply tool, say) is available to
the agent through the normal MCP tool path — nothing channel-specific is
required. Declare tools in the server's capabilities, register the tool, and
use the server's instructions string (injected into the system prompt) to
tell Crush when to call it and which <channel> attribute to pass back (like a
chat_id).
For example, Signal MCP lets Crush
send and receive Signal messages through a
signal-cli daemon:
- Start the daemon:
signal-cli -a +15551234567 daemon --tcp 127.0.0.1:7583 --receive-mode on-start --no-receive-stdout - Add to
crush.json: Use the example in the MCPs section above. - Launch with channel:
crush --channels server:signal
Incoming messages arrive as <channel> tags; use the send_message_to_user tool to reply.
Channel reply routing
By default a channel-originated turn only produces terminal output, so a
person messaging you on Signal never sees the answer unless the model decides
to call a send tool itself. Adding a channel_reply block to a channel
server's MCP config makes the routing deterministic: when a turn that
originated from that channel finishes without the model having replied through
the channel, Crush sends the final assistant response back through the
configured tool — to the sender for direct messages, or to the group for group
messages.
{
"mcp": {
"signal": {
"type": "stdio",
"command": "uv",
"args": ["run", "signal_mcp/main.py", "--operator", "+15551234567", "--channel"],
"channel_reply": {
"user": { "tool": "send_message_to_user", "target_param": "user_id" },
"group": { "tool": "send_message_to_group", "target_param": "group_id" },
"suppress_tools": ["send"]
}
}
}
}
In crushrc, pass the same object to --channel-reply:
mcp add signal --command uv \
--args run --args signal_mcp/main.py --args --operator --args +15551234567 --args --channel \
--channel true \
--channel-reply '{
"user": {"tool": "send_message_to_user", "target_param": "user_id"},
"group": {"tool": "send_message_to_group", "target_param": "group_id"},
"suppress_tools": ["send"]
}'
How it routes:
- Group pushes (meta carries
group) go through the group route;
direct pushes (meta carries sender) go through the user route.
target_meta overrides which meta attribute supplies the target;
message_param (default message) names the tool argument that receives
the reply text. - If the model already called a route tool — or any tool listed in
suppress_tools — during the turn, the automatic reply is skipped, so
richer model-driven replies aren't duplicated. - Local (non-channel) turns and channels without a
channel_reply block are
unaffected.
The same shape works for any messaging channel (Discord, Slack, …): point the
routes at that server's send tools and the matching meta attributes.
Hooks
Crush has preliminary support for hooks. For details, see
the hook guide.
Sharing a workspace across clients
When Crush is run against a shared backend (for example two TUIs talking to
the same crush serve), clients are grouped into workspaces keyed by
their resolved --cwd. Two clients with the same --cwd join the same
underlying workspace, so they share the session list, message history,
permission queue, LSP, and MCP state.
Joining is implicit: pointing a second client at the same working directory
attaches it to the existing workspace. Each new invocation, however, starts
in its own fresh session by default. To pick up the conversation another
client already has open, use the session manager (the session picker) and
select it. Sessions surface two signals there:
IsBusy is set while an agent turn is in flight for that session.AttachedClients reports how many clients are currently viewing it.
A non-zero AttachedClients (often combined with IsBusy) is the cue that a
session is "in progress" on another client and joining it will mirror that
view live.
The first client to create a workspace fixes its process-wide flags. In
particular, --yolo and --debug follow a first-wins rule: later
clients that arrive at the same --cwd with different values for those
flags do not change the running workspace. A debug log line is emitted
recording the mismatch, and the workspace keeps the flags it was created
with.
A workspace lives as long as at least one client has an SSE event stream
open against it. When the last stream disconnects, the workspace is torn
down. There is a short grace window right after POST /v1/workspaces so a
client that has created the workspace but not yet opened its event stream
does not get reaped before it can attach.
Global context files
Crush automatically includes two files for cross-project instructions. Think of
these are personal additions to the system prompt.
~/.config/crush/CRUSH.md: Crush-specific rules that would confuse other
agentic coding tools. If you only use Crush, this is the only one you need to
edit.~/.config/AGENTS.md: generic instructions that other coding tools might
read. Avoid referring to Crush-specific features or workflows here. You
probably only care about this if you use multiple agentic coding tools and
want to share instructions between them.
You can customize these paths with option global-context-path. Repeat the
command to add multiple paths:
# Load a single markdown file.
option global-context-path "~/path/to/custom/context/file.md"
# Recursively load all Markdown files in the folder.
option global-context-path "/full/path/to/folder/of/files/"
Ignoring Files
Crush respects .gitignore files by default, but you can also create a
.crushignore file to specify additional files and directories that Crush
should ignore. This is useful for excluding files that you want in version
control but don't want Crush to consider when providing context.
The .crushignore file uses the same syntax as .gitignore and can be placed
in the root of your project or in subdirectories.
Allowing Tools
By default, Crush will ask you for permission before running tool calls. If
you'd like, you can allow tools to be executed without prompting you for
permissions. Use this with care.
permissions allow view ls grep edit mcp_context7_get-library-doc
The bash tool additionally runs a small set of read-only commands (ls,
pwd, git status, git log, …) without prompting. Crush parses the command
to decide, so it applies only when the whole command is provably inert: a
redirection, a variable assignment, a command substitution, a pipeline, or an
argument that mutates state (git branch -D, git remote set-url) all fall
back to the normal permission prompt.
Disabling Built-In Tools
You can also deny tools, hiding then from the agent entirely:
permissions deny bash sourcegraph
To disable tools from MCP servers, see the MCP config section.
You only live once
You can also skip all permission prompts completely by running Crush with the
--yolo flag. Be very, very careful with this feature.
Disabling Skills
You can prevent Crush from using certain skills entirely. Disabled skills are
hidden from the agent, including builtin skills and skills discovered from
disk.
option disable-skill crush-config
Agent Skills
Crush supports the Agent Skills open standard for
extending agent capabilities with reusable skill packages. Skills are folders
containing a SKILL.md file with instructions that Crush can discover and
activate on demand.
The global paths we looks for skills are:
$CRUSH_SKILLS_DIR$XDG_CONFIG_HOME/agents/skills or ~/.config/agents/skills/$XDG_CONFIG_HOME/crush/skills or ~/.config/crush/skills/- `~/.agents/s
…(truncated)