Crush CLI: Free AI Coding Agent for Terminal Code Editing and Debugging

An open-source command-line AI agent supporting multiple language models for code generation. Switch between OpenAI, Claude, and Gemini in your terminal.

Crush is an open-source AI coding agent from Charm that runs in your terminal. It can inspect and change code, run project commands, debug errors, keep multiple coding sessions, and delegate work to background subagents.

Charm Hyper is the official model provider for Crush. Crush also works with Anthropic, OpenAI, Google Gemini, OpenRouter, Amazon Bedrock, Azure OpenAI, Vertex AI, local model servers, and many others.

OpenAI users can sign in with a ChatGPT account and use the GPT models available through their subscription. API key access is also available.

Features

  • Connect Charm Hyper, API-key providers, local models, custom endpoints, or ChatGPT through OpenAI OAuth.
  • Switch models during an active session and preserve its conversation context.
  • Run interactive TUI sessions, Plan Mode, or one-off tasks.
  • Delegate parallel coding tasks to background subagents and monitor their progress.
  • Use LSP connections for code context, symbol renaming, and whole-symbol replacement.
  • Connect MCP servers over stdio, HTTP, or SSE with OAuth.
  • Run Crush on macOS, Linux, Windows, Android, FreeBSD, OpenBSD, NetBSD, and illumos.
  • Configure project and global settings through Bash-based crushrc files.
  • Use lifecycle hooks for tool calls, sessions, turns, permission events, and context compaction.
  • Load Agent Skills from global, project, or configured directories.
  • Customize the TUI with built-in or user-edited themes.
  • Set tool and shell-command permissions, including Yolo Mode and Sysadmin Mode.

Crush CLI Quick Reference

TaskCommand
Open an interactive coding sessioncrush
Run a one-off coding taskcrush run "Review this repository"
Sign in with a ChatGPT accountcrush login openai
Follow the latest log outputcrush logs --follow
Refresh the provider catalogcrush update-providers
Start with debug outputcrush --debug

See It In Action

Crush CLI

Installation

Quick Install Commands

PlatformCommand
Homebrewbrew install charmbracelet/tap/crush
npmnpm install -g @charmland/crush
Windows Wingetwinget install charmbracelet.crush
Windows Scoopscoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
scoop install crush
Arch Linuxyay -S crush-bin
Nixnix run github:numtide/nix-ai-tools#crush
FreeBSDpkg install crush
Gogo install github.com/charmbracelet/crush@latest
Nix users can also install the current NUR package at nur.repos.charmbracelet.crush. The official NUR module configures Crush for NixOS or Home Manager.

Debian / Ubuntu

On a Debian-based system, add the Charm package repository and install Crush through apt:

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

On Fedora, RHEL, or CentOS, add the Charm yum repository:

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

Manual Download

Prebuilt packages and binaries are available from the Crush GitHub releases page. Release assets include Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD builds, plus Debian and RPM packages. The Go installation command also works on illumos.

How to Use Crush CLI

Open a terminal in your project directory and run crush to open the TUI. On first launch, choose a Charm Hyper model and complete authentication, or press Ctrl+L to select another provider and enter its API key.

Once a model is available, ask Crush to inspect files, explain code, write a patch, run project commands, or debug an error.

crush

Use your ChatGPT subscription

Crush can authenticate the OpenAI provider through your ChatGPT account. Complete the browser sign-in to load the GPT models available through your subscription. The chatgpt alias opens this authentication flow. Use -f to replace an existing OpenAI login.

crush login openai
# Alias
crush login chatgpt
# Replace an existing OpenAI login
crush login -f openai

Set provider API keys

Environment variables supply credentials before launch and work well for scripts or provider-specific project setups. Crush also supports xAI/Grok OAuth sign-in from the provider authentication flow.

Crush can discover models from Ollama, llama.cpp, OMLX, LM Studio, and LiteLLM. Add the local provider in crushrc and leave its model list empty when you want automatic discovery.

ProviderEnvironment variable
Charm HyperHYPER_API_KEY
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
Google GeminiGEMINI_API_KEY
OpenRouterOPENROUTER_API_KEY
Vercel AI GatewayVERCEL_API_KEY
Z.aiZAI_API_KEY
MiniMaxMINIMAX_API_KEY
SyntheticSYNTHETIC_API_KEY
Hugging Face InferenceHF_TOKEN
CerebrasCEREBRAS_API_KEY
GroqGROQ_API_KEY
io.netIONET_API_KEY
AlibabaALIBABA_SINGAPORE_API_KEY or ALIBABA_US_API_KEY
AvianAVIAN_API_KEY
OpenCode Zen & GoOPENCODE_API_KEY
MoonshotMOONSHOT_API_KEY
xAI (Grok)XAI_API_KEY
Google Vertex AIVERTEXAI_PROJECT, VERTEXAI_LOCATION
Amazon BedrockAWS_BEARER_TOKEN_BEDROCK, or AWS profile and credential variables
Azure OpenAIAZURE_OPENAI_API_ENDPOINT, AZURE_OPENAI_API_KEY, AZURE_OPENAI_API_VERSION

Run Crush non-interactively

crush run executes one prompt and exits. It works for one-off repository tasks, shell pipelines, redirected output, and scripted tasks.

Use --model to select a model, --continue to resume the most recent session, or --session to continue a specific session.

crush run "Review this repository for failing tests"
git diff | crush run "Summarize these changes"
crush run --reasoning-effort high "Find the cause of this failing test"

Work with project sessions

Each session stores its conversation, project context, tool activity, and coding task history. Open the session manager when you want to continue an earlier task. The TUI shows the current Git branch, and Ctrl+B toggles the sidebar.

Clients that share a backend and resolved working directory join one workspace. A new client opens a fresh session by default. Select an active session in the session manager to mirror another client’s conversation. The first client sets workspace-wide --yolo and --debug values until the workspace closes. Apps embedding Crush through its server API can supply open-file context, customize the TUI theme, and handle permission prompts.

Delegate tasks to background subagents

Crush now can dispatch several subagents to investigate different parts of a coding task. For example, the main agent can ask one subagent to inspect authentication code and another to trace failing tests. Their work continues in the background, and reports return to the parent conversation.

Subagent activity appears in the transcript, sidebar, and header. You can ask for status, send follow-up instructions, stop a subagent, or move one to a different available model during its run. Crush identifies subagents by name when you refer to them in the conversation.

Use Plan Mode and Sysadmin Mode

Press Shift+Tab to cycle through modes. Plan Mode helps you discuss requirements, answer clarifying questions, and prepare a coding plan before making changes. In normal operation, Crush applies configured tool and command permissions. Sysadmin Mode permits commands that would otherwise be blocked as dangerous, including system administration and database operations. Open Sysadmin Mode from the Ctrl+P command palette.

Configuration

Crush uses crushrc, a Bash-based configuration format with Crush-specific commands. Its built-in Bash interpreter runs the configuration syntax on Unix-like systems and Windows.

Crush checks project configuration before the global file. The load order is ./.crushrc, ./crushrc, and ~/.config/crush/crushrc on Unix-like systems or %USERPROFILE%\.config\crush\crushrc on Windows.

Store repository rules in a project file and personal defaults in the global file. Application state remains under the platform data directory and is not executable configuration.

To set a custom system prompt for the main agent, add option prompt coder .crush/coder.md.tpl to your project’s crushrc. Use task for the subagent prompt or summary for the compaction prompt. Crush resolves relative paths from the directory containing the config file.

Every crushrc and legacy crush.json file is trusted code. A crushrc runs in a full shell, and command substitution in JSON runs when Crush loads the file. Review project configuration before launching Crush in an unfamiliar repository.

Register a custom API provider

Crush uses Catwalk v3 provider types: completions for OpenAI-compatible Chat Completions APIs, responses for the Responses API, and messages for Anthropic-compatible APIs. Existing openai, openai-compat, and anthropic configurations migrate automatically.

Register a compatible endpoint with crush provider add. For example, a DeepSeek API key can be supplied through an environment variable:

crush provider add deepseek \
  --type completions \
  --base-url "https://api.deepseek.com/v1" \
  --api-key "$DEEPSEEK_API_KEY"

Model registrations use crush model add. Model options include --thinking always|never|toggleable and --max-attachments N where the model supports them.

Add LSP context

Language Server Protocol connections provide code context and power the lsp_rename and lsp_replace_symbol tools. Register only language servers that are installed for your project.

# crushrc
lsp add go --command "gopls"
lsp add typescript --command "typescript-language-server" --args --stdio
lsp add nix --command "nil"

Connect MCP servers

Crush connects to MCP servers through stdio, HTTP, and SSE. HTTP and SSE servers can use OAuth. Services with pre-registered OAuth clients require a client ID, client secret, and callback port. You can enable or disable MCP servers from the TUI at either the project or global level.

# crushrc
mcp add filesystem --command node --args /path/to/mcp-server.js \
  --timeout 120 --env NODE_ENV production
mcp add github \
  --type http \
  --url "https://api.githubcopilot.com/mcp/" \
  --timeout 120 \
  --header Authorization "Bearer $GH_PAT"

MCP OAuth

The JSON example below enables OAuth for an MCP server in an existing crush.json file. In a new Bash-based crushrc, use mcp add with the --oauth true flag.

{
  "mcp": {
    "linear": {
      "type": "http",
      "url": "https://mcp.linear.app/mcp",
      "oauth": true
    }
  }
}

Customize the terminal theme

Press Ctrl+P, select Themes, and browse the built-in themes with a live preview. Press Ctrl+E on a selected theme to edit its colors, then save the changes. Custom themes are stored in the global Crush configuration directory.

Add lifecycle hooks

Crush hooks run shell commands at specific points in the agent lifecycle. PreToolUse runs before a tool call and can deny the call, rewrite its input, inject context, or approve an action. Hooks also handle PostToolUse, PostToolUseFailure, session and turn events, permission events, and context compaction. A PostToolUse hook can replace tool output before the model reads it or return feedback after a command completes. Hook commands can use Bash, Python, Node, Rust, or another executable available on the system.

# crushrc
hook add PreToolUse --matcher "^bash$" \
  --command "./hooks/check-command.sh" \
  --name check-command

Use Agent Skills

Crush follows the Agent Skills open standard and discovers folders that contain a SKILL.md file.

Project skills can live in .agents/skills, .crush/skills, .claude/skills, or .cursor/skills. Global skill locations include the Crush and Agent Skills config folders. A skill with user-invocable: true is listed in the command palette. Use the palette to turn skills on or off.

option skill-path "$HOME/squid-skills" "./project-skills"

Read More About 470+ Most Popular Agent Skills on GitHub for Coding Agents.

Add context and ignore files

Crush reads ~/.config/crush/CRUSH.md for product-specific instructions and ~/.config/AGENTS.md for rules shared with other coding agents. Add another file or a directory of Markdown context through option global-context-path.

Crush reads .gitignore and .crushignore as it scans the project tree. Use .crushignore for tracked files or directories that should stay outside Crush context. Put it in the repository root for project-wide exclusions, or place one in a subdirectory for rules that apply from that directory. It follows .gitignore pattern syntax.

Control permissions

Crush asks before running tool calls by default. permissions allow skips approval prompts for chosen tools, and permissions deny hides tools from the agent. --yolo skips ordinary approval prompts, but Crush still blocks commands it classifies as dangerous. Sysadmin Mode permits those commands and should be used only for explicitly authorized administration tasks.

# crushrc
permissions allow view ls grep edit
permissions deny bash sourcegraph

Shell-command rules are also configurable in crushrc. permissions safe marks specific commands safe in Yolo Mode, permissions block prohibits commands, and permissions unblock removes commands from the restricted list:

# crushrc
# Allow common build checks in Yolo Mode
permissions safe "go build" "cargo check"
# Block infrastructure commands
permissions block kubectl terraform
# Unblock a command from the restricted list
permissions unblock curl

Crush can also handle interactive SSH password and GPG pinentry prompts inside the terminal when a command requests authentication.

Check logs and debug output

Crush writes project logs to ./.crush/logs/crush.log. Use crush logs to read or follow recent output. Run crush --debug for more detail, or enable debug output in crushrc.

# Print the last 1000 lines
crush logs
# Print the last 500 lines
crush logs --tail 500
# Follow logs in real time
crush logs --follow
option debug true
option debug-lsp true

Manage provider updates and metrics

Crush checks Catwalk, Charm’s public provider database, for updated provider and model metadata. Disable the check in crushrc with option provider-auto-update false or set CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1 in a restricted environment. The crush update-providers command can load Catwalk data from the network, a custom URL, a local file, or the embedded copy.

Crush records pseudonymous usage metadata tied to a device-specific hash. Prompts and responses are excluded. Set CRUSH_DISABLE_METRICS=1 or DO_NOT_TRACK=1 to opt out.

Alternatives & Related Resources

Pros

  • Free CLI installation
  • Wide model-provider choice
  • Terminal-native coding sessions
  • LSP and MCP integrations
  • macOS, Linux, Windows, Android, and BSD builds

Cons

  • Model access can cost extra
  • Project configuration executes trusted code
  • Metrics require manual opt-out

FAQs

Do I need a paid AI account after installing Crush?

The CLI is free to install. Charm Hyper provides free access, paid plans, and prepaid Hypercredits. Other hosted models require API credits or a subscription. Local models require compatible hardware and a running model server.

Is Crush open source?

Crush CLI is released under FSL-1.1-MIT. The license permits use, modification, and redistribution for non-competing purposes.

What should I check before using Crush in a private repository?

Review your provider’s data-handling terms and the project’s crushrc, MCP commands, permission rules, and ignored paths. The selected model provider receives the code context submitted through Crush. With Hyper, use a ZDR plan or independently purchased prepaid credits for confidential code. Keep secrets out of tracked configuration files.

Why does clipboard copy and paste fail on Linux or BSD?

Wayland environments need wl-copy and wl-paste. X11 environments need xclip or xsel. Windows and macOS use native clipboard APIs.

How should I choose between Crush, Gemini CLI, Claude Code, and Codex CLI?

Crush connects multiple model providers in one terminal agent with persistent sessions, LSP context, Agent Skills, and configurable MCP servers. Gemini CLI, Claude Code, and Codex CLI each use their provider’s model ecosystem and account authentication.

Last Updated: November 23, 2026

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!