4 <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 />
5 <a href="https://github.com/charmbracelet/crush/releases"><img src="https://img.shields.io/github/release/charmbracelet/crush" alt="Latest Release"></a>
6 <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>
9<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>
10<p align="center">终端里的编程新搭档,<br />无缝接入你的工具、代码与工作流,全面兼容主流 LLM 模型。</p>
12<p align="center"><img width="800" alt="Crush Demo" src="https://github.com/user-attachments/assets/58280caf-851b-470a-b6f7-d5c4ea8a1968" /></p>
16- **Multi-Model:** choose from a wide range of LLMs or add your own via OpenAI- or Anthropic-compatible APIs
17- **Flexible:** switch LLMs mid-session while preserving context
18- **Session-Based:** maintain multiple work sessions and contexts per project
19- **LSP-Enhanced:** Crush uses LSPs for additional context, just like you do
20- **Extensible:** add capabilities via MCPs (`http`, `stdio`, and `sse`)
21- **Works Everywhere:** first-class support in every terminal on macOS, Linux, Windows (PowerShell and WSL), Android, FreeBSD, OpenBSD, and NetBSD
22- **Industrial Grade:** built on the Charm ecosystem, powering 25k+ applications, from leading open source projects to business-critical infrastructure
30brew install charmbracelet/tap/crush
33npm install -g @charmland/crush
39nix run github:numtide/nix-ai-tools#crush
49winget install charmbracelet.crush
52scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
57<summary><strong>Nix (NUR)</strong></summary>
59Crush is available via the official Charm [NUR](https://github.com/nix-community/NUR) in `nur.repos.charmbracelet.crush`, which is the most up-to-date way to get Crush in Nix.
61You can also try out Crush via the NUR with `nix-shell`:
65nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
68# Get Crush in a Nix shell.
69nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
72### NixOS & Home Manager Module Usage via NUR
74Crush provides NixOS and Home Manager modules via NUR.
75You 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 :)
80 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
81 nur.url = "github:nix-community/NUR";
84 outputs = { self, nixpkgs, nur, ... }: {
85 nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
86 system = "x86_64-linux";
88 nur.modules.nixos.default
89 nur.repos.charmbracelet.modules.crush
98 base_url = "https://api.openai.com/v1";
100 api_key = "sk-fake123456789abcdef...";
110 go = { command = "gopls"; enabled = true; };
111 nix = { command = "nil"; enabled = true; };
114 context_paths = [ "/etc/nixos/configuration.nix" ];
115 tui = { compact_mode = true; };
130<summary><strong>Debian/Ubuntu</strong></summary>
133sudo mkdir -p /etc/apt/keyrings
134curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
135echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
136sudo apt update && sudo apt install crush
142<summary><strong>Fedora/RHEL</strong></summary>
147baseurl=https://repo.charm.sh/yum/
150gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
151sudo yum install crush
158- [Packages][releases] are available in Debian and RPM formats
159- [Binaries][releases] are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD
161[releases]: https://github.com/charmbracelet/crush/releases
163Or just install it with Go:
166go install github.com/charmbracelet/crush@latest
170> Productivity may increase when using Crush and you may find yourself nerd
171> sniped when first using the application. If the symptoms persist, join the
172> [Slack][slack] or [Discord][discord] and nerd snipe the rest of us.
176The quickest way to get started is to grab an API key for your preferred
177provider such as Anthropic, OpenAI, Groq, OpenRouter, or Vercel AI Gateway and just start
178Crush. You'll be prompted to enter your API key.
180That said, you can also set environment variables for preferred providers.
182| Environment Variable | Provider |
183| --------------------------- | -------------------------------------------------- |
184| `ANTHROPIC_API_KEY` | Anthropic |
185| `OPENAI_API_KEY` | OpenAI |
186| `VERCEL_API_KEY` | Vercel AI Gateway |
187| `GEMINI_API_KEY` | Google Gemini |
188| `SYNTHETIC_API_KEY` | Synthetic |
189| `ZAI_API_KEY` | Z.ai |
190| `MINIMAX_API_KEY` | MiniMax |
191| `HF_TOKEN` | Hugging Face Inference |
192| `CEREBRAS_API_KEY` | Cerebras |
193| `OPENROUTER_API_KEY` | OpenRouter |
194| `IONET_API_KEY` | io.net |
195| `GROQ_API_KEY` | Groq |
196| `AVIAN_API_KEY` | Avian |
197| `OPENCODE_API_KEY` | OpenCode Zen & Go |
198| `VERTEXAI_PROJECT` | Google Cloud VertexAI (Gemini) |
199| `VERTEXAI_LOCATION` | Google Cloud VertexAI (Gemini) |
200| `AWS_ACCESS_KEY_ID` | Amazon Bedrock (Claude) |
201| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock (Claude) |
202| `AWS_REGION` | Amazon Bedrock (Claude) |
203| `AWS_PROFILE` | Amazon Bedrock (Custom Profile) |
204| `AWS_BEARER_TOKEN_BEDROCK` | Amazon Bedrock |
205| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models |
206| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
207| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
211If you prefer subscription-based usage, here are some plans that work well in
214- [Synthetic](https://synthetic.new/pricing)
215- [GLM Coding Plan](https://z.ai/subscribe)
216- [Kimi Code](https://www.kimi.com/membership/pricing)
217- [MiniMax Coding Plan](https://platform.minimax.io/subscribe/coding-plan)
221Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
223Crush’s default model listing is managed in [Catwalk](https://github.com/charmbracelet/catwalk), a community-supported, open source repository of Crush-compatible models, and you’re welcome to contribute.
225<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>
230> Crush ships with a builtin `crush-config` skill for configuring itself. In
231> many cases you can simply ask Crush to configure itself.
233Crush runs great with no configuration. That said, if you do need or want to
234customize Crush, configuration can be added either local to the project itself,
235or globally, with the following priority:
2393. `$HOME/.config/crush/crush.json`
241Configuration itself is stored as a JSON object:
245 "this-setting": { "this": "that" },
246 "that-setting": ["ceci", "cela"]
250As an additional note, Crush also stores ephemeral data, such as application
251state, in one additional location:
255$HOME/.local/share/crush/crush.json
258%LOCALAPPDATA%\crush\crush.json
262> You can override the user and data config locations by setting:
264> - `CRUSH_GLOBAL_CONFIG`
265> - `CRUSH_GLOBAL_DATA`
269Crush can use LSPs for additional context to help inform its decisions, just
270like you would. LSPs can be added manually like so:
274 "$schema": "https://charm.land/crush.json",
279 "GOTOOLCHAIN": "go1.24.5"
283 "command": "typescript-language-server",
295Crush also supports Model Context Protocol (MCP) servers through three
296transport types: `stdio` for command-line servers, `http` for HTTP endpoints,
297and `sse` for Server-Sent Events. Environment variable expansion is supported
298using `$(echo $VAR)` syntax.
302 "$schema": "https://charm.land/crush.json",
307 "args": ["/path/to/mcp-server.js"],
310 "disabled_tools": ["some-tool-name"],
312 "NODE_ENV": "production"
317 "url": "https://api.githubcopilot.com/mcp/",
320 "disabled_tools": ["create_issue", "create_pull_request"],
322 "Authorization": "Bearer $GH_PAT"
325 "streaming-service": {
327 "url": "https://example.com/mcp/sse",
331 "API-Key": "$(echo $API_KEY)"
340Crush has preliminary support for hooks. For details, see
341[the hook guide](./docs/hooks/).
345Crush respects `.gitignore` files by default, but you can also create a
346`.crushignore` file to specify additional files and directories that Crush
347should ignore. This is useful for excluding files that you want in version
348control but don't want Crush to consider when providing context.
350The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
351in the root of your project or in subdirectories.
355By default, Crush will ask you for permission before running tool calls. If
356you'd like, you can allow tools to be executed without prompting you for
357permissions. Use this with care.
361 "$schema": "https://charm.land/crush.json",
368 "mcp_context7_get-library-doc"
374You can also skip all permission prompts entirely by running Crush with the
375`--yolo` flag. Be very, very careful with this feature.
377### Disabling Built-In Tools
379If you'd like to prevent Crush from using certain built-in tools entirely, you
380can disable them via the `options.disabled_tools` list. Disabled tools are
381completely hidden from the agent.
385 "$schema": "https://charm.land/crush.json",
387 "disabled_tools": ["bash", "sourcegraph"]
392To disable tools from MCP servers, see the [MCP config section](#mcps).
396If you'd like to prevent Crush from using certain skills entirely, you can
397disable them via the `options.disabled_skills` list. Disabled skills are hidden
398from the agent, including builtin skills and skills discovered from disk.
402 "$schema": "https://charm.land/crush.json",
404 "disabled_skills": ["crush-config"]
411Crush supports the [Agent Skills](https://agentskills.io) open standard for
412extending agent capabilities with reusable skill packages. Skills are folders
413containing a `SKILL.md` file with instructions that Crush can discover and
416The global paths we looks for skills are:
419* `$XDG_CONFIG_HOME/agents/skills` or `~/.config/agents/skills/`
420* `$XDG_CONFIG_HOME/crush/skills` or `~/.config/crush/skills/`
421* On Windows, we _also_ look at
422 * `%LOCALAPPDATA%\agents\skills\` or `%USERPROFILE%\AppData\Local\agents\skills\`
423 * `%LOCALAPPDATA%\crush\skills\` or `%USERPROFILE%\AppData\Local\crush\skills\`
424* Additional paths configured via `options.skills_paths`
426On top of that, we _also_ load skills in your project from the following
436 "$schema": "https://charm.land/crush.json",
439 "~/.config/crush/skills", // Windows: "%LOCALAPPDATA%\\crush\\skills",
446You can get started with example skills from [anthropics/skills](https://github.com/anthropics/skills):
450mkdir -p ~/.config/crush/skills
451cd ~/.config/crush/skills
452git clone https://github.com/anthropics/skills.git _temp
453mv _temp/skills/* . && rm -rf _temp
457# Windows (PowerShell)
458mkdir -Force "$env:LOCALAPPDATA\crush\skills"
459cd "$env:LOCALAPPDATA\crush\skills"
460git clone https://github.com/anthropics/skills.git _temp
461mv _temp/skills/* . ; rm -r -force _temp
464### Desktop notifications
466Crush sends desktop notifications when a tool call requires permission and when
467the agent finishes its turn. They're only sent when the terminal window isn't
468focused _and_ your terminal supports reporting the focus state.
472 "$schema": "https://charm.land/crush.json",
474 "disable_notifications": false, // default
479To disable desktop notifications, set `disable_notifications` to `true` in your
480configuration. On macOS, notifications currently lack icons due to platform
485When you initialize a project, Crush analyzes your codebase and creates
486a context file that helps it work more effectively in future sessions.
487By default, this file is named `AGENTS.md`, but you can customize the
488name and location with the `initialize_as` option:
492 "$schema": "https://charm.land/crush.json",
494 "initialize_as": "AGENTS.md"
499This is useful if you prefer a different naming convention or want to
500place the file in a specific directory (e.g., `CRUSH.md` or
501`docs/LLMs.md`). Crush will fill the file with project-specific context
502like build commands, code patterns, and conventions it discovered during
505### Attribution Settings
507By default, Crush adds attribution information to Git commits and pull requests
508it creates. You can customize this behavior with the `attribution` option:
512 "$schema": "https://charm.land/crush.json",
515 "trailer_style": "co-authored-by",
516 "generated_with": true
522- `trailer_style`: Controls the attribution trailer added to commit messages
523 (default: `assisted-by`)
524 - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
525 (includes the model name)
526 - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
527 - `none`: No attribution trailer
528- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
529 commit messages and PR descriptions
533Crush supports custom provider configurations for both OpenAI-compatible and
534Anthropic-compatible APIs.
537> Note that we support two "types" for OpenAI. Make sure to choose the right one
538> to ensure the best experience!
540> - `openai` should be used when proxying or routing requests through OpenAI.
541> - `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
543#### OpenAI-Compatible APIs
545Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
546API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
550 "$schema": "https://charm.land/crush.json",
553 "type": "openai-compat",
554 "base_url": "https://api.deepseek.com/v1",
555 "api_key": "$DEEPSEEK_API_KEY",
558 "id": "deepseek-chat",
559 "name": "Deepseek V3",
560 "cost_per_1m_in": 0.27,
561 "cost_per_1m_out": 1.1,
562 "cost_per_1m_in_cached": 0.07,
563 "cost_per_1m_out_cached": 1.1,
564 "context_window": 64000,
565 "default_max_tokens": 5000
573#### Anthropic-Compatible APIs
575Custom Anthropic-compatible providers follow this format:
579 "$schema": "https://charm.land/crush.json",
581 "custom-anthropic": {
583 "base_url": "https://api.anthropic.com/v1",
584 "api_key": "$ANTHROPIC_API_KEY",
586 "anthropic-version": "2023-06-01"
590 "id": "claude-sonnet-4-20250514",
591 "name": "Claude Sonnet 4",
593 "cost_per_1m_out": 15,
594 "cost_per_1m_in_cached": 3.75,
595 "cost_per_1m_out_cached": 0.3,
596 "context_window": 200000,
597 "default_max_tokens": 50000,
599 "supports_attachments": true
609Crush currently supports running Anthropic models through Bedrock, with caching disabled.
611- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
612- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
613- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
614- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
616### Vertex AI Platform
618Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
621gcloud auth application-default login
624To add specific models to the configuration, configure as such:
628 "$schema": "https://charm.land/crush.json",
633 "id": "claude-sonnet-4@20250514",
634 "name": "VertexAI Sonnet 4",
636 "cost_per_1m_out": 15,
637 "cost_per_1m_in_cached": 3.75,
638 "cost_per_1m_out_cached": 0.3,
639 "context_window": 200000,
640 "default_max_tokens": 50000,
642 "supports_attachments": true
652Local models can also be configured via OpenAI-compatible API. Here are two common examples:
661 "base_url": "http://localhost:11434/v1/",
662 "type": "openai-compat",
665 "name": "Qwen 3 30B",
667 "context_window": 256000,
668 "default_max_tokens": 20000
683 "base_url": "http://localhost:1234/v1/",
684 "type": "openai-compat",
687 "name": "Qwen 3 30B",
688 "id": "qwen/qwen3-30b-a3b-2507",
689 "context_window": 256000,
690 "default_max_tokens": 20000
700Sometimes you need to look at logs. Luckily, Crush logs all sorts of
701stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
703The CLI also contains some helper commands to make perusing recent logs easier:
706# Print the last 1000 lines
709# Print the last 500 lines
712# Follow logs in real time
716Want more logging? Run `crush` with the `--debug` flag, or enable it in the
721 "$schema": "https://charm.land/crush.json",
729## Provider Auto-Updates
731By default, Crush automatically checks for the latest and greatest list of
732providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
733the open source Crush provider database. This means that when new providers and
734models are available, or when model metadata changes, Crush automatically
735updates your local configuration.
737### Disabling automatic provider updates
739For those with restricted internet access, or those who prefer to work in
740air-gapped environments, this might not be want you want, and this feature can
743To disable automatic provider updates, set `disable_provider_auto_update` into
744your `crush.json` config:
748 "$schema": "https://charm.land/crush.json",
750 "disable_provider_auto_update": true
755Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
758export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
761### Manually updating providers
763Manually updating providers is possible with the `crush update-providers`
767# Update providers remotely from Catwalk.
768crush update-providers
770# Update providers from a custom Catwalk base URL.
771crush update-providers https://example.com/
773# Update providers from a local file.
774crush update-providers /path/to/local-providers.json
776# Reset providers to the embedded version, embedded at crush at build time.
777crush update-providers embedded
780crush update-providers --help
785Crush records pseudonymous usage metrics (tied to a device-specific hash),
786which maintainers rely on to inform development and support priorities. The
787metrics include solely usage metadata; prompts and responses are NEVER
790Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
791and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
793You can opt out of metrics collection at any time by setting the environment
794variable by setting the following in your environment:
797export CRUSH_DISABLE_METRICS=1
800Or by setting the following in your config:
805 "disable_metrics": true
810Crush also respects the [`DO_NOT_TRACK`](https://donottrack.sh/) convention
811which can be enabled via `export DO_NOT_TRACK=1`.
815### Why is clipboard copy and paste not working?
817Installing an extra tool might be needed on Unix-like environments.
819| Environment | Tool |
820| ------------------- | ------------------------ |
821| Windows | Native support |
822| macOS | Native support |
823| Linux/BSD + Wayland | `wl-copy` and `wl-paste` |
824| Linux/BSD + X11 | `xclip` or `xsel` |
828See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
832We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
834- [Twitter](https://twitter.com/charmcli)
837- [The Fediverse](https://mastodon.social/@charmcli)
838- [Bluesky](https://bsky.app/profile/charm.land)
840[slack]: https://charm.land/slack
841[discord]: https://charm.land/discord
845[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
849Part of [Charm](https://charm.land).
851<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-softy.jpg" /></a>
853<!--prettier-ignore-->
854Charm热爱开源 • Charm loves open source
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list