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> [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| `VERTEXAI_PROJECT` | Google Cloud VertexAI (Gemini) |
197| `VERTEXAI_LOCATION` | Google Cloud VertexAI (Gemini) |
198| `AWS_ACCESS_KEY_ID` | Amazon Bedrock (Claude) |
199| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock (Claude) |
200| `AWS_REGION` | Amazon Bedrock (Claude) |
201| `AWS_PROFILE` | Amazon Bedrock (Custom Profile) |
202| `AWS_BEARER_TOKEN_BEDROCK` | Amazon Bedrock |
203| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models |
204| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
205| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
209If you prefer subscription-based usage, here are some plans that work well in
212- [Synthetic](https://synthetic.new/pricing)
213- [GLM Coding Plan](https://z.ai/subscribe)
214- [Kimi Code](https://www.kimi.com/membership/pricing)
215- [MiniMax Coding Plan](https://platform.minimax.io/subscribe/coding-plan)
219Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
221Crush’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.
223<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>
227Crush runs great with no configuration. That said, if you do need or want to
228customize Crush, configuration can be added either local to the project itself,
229or globally, with the following priority:
2333. `$HOME/.config/crush/crush.json`
235Configuration itself is stored as a JSON object:
239 "this-setting": { "this": "that" },
240 "that-setting": ["ceci", "cela"]
244As an additional note, Crush also stores ephemeral data, such as application state, in one additional location:
248$HOME/.local/share/crush/crush.json
251%LOCALAPPDATA%\crush\crush.json
255> You can override the user and data config locations by setting:
256> * `CRUSH_GLOBAL_CONFIG`
257> * `CRUSH_GLOBAL_DATA`
261Crush can use LSPs for additional context to help inform its decisions, just
262like you would. LSPs can be added manually like so:
266 "$schema": "https://charm.land/crush.json",
271 "GOTOOLCHAIN": "go1.24.5"
275 "command": "typescript-language-server",
287Crush also supports Model Context Protocol (MCP) servers through three
288transport types: `stdio` for command-line servers, `http` for HTTP endpoints,
289and `sse` for Server-Sent Events. Environment variable expansion is supported
290using `$(echo $VAR)` syntax.
294 "$schema": "https://charm.land/crush.json",
299 "args": ["/path/to/mcp-server.js"],
302 "disabled_tools": ["some-tool-name"],
304 "NODE_ENV": "production"
309 "url": "https://api.githubcopilot.com/mcp/",
312 "disabled_tools": ["create_issue", "create_pull_request"],
314 "Authorization": "Bearer $GH_PAT"
317 "streaming-service": {
319 "url": "https://example.com/mcp/sse",
323 "API-Key": "$(echo $API_KEY)"
332Crush respects `.gitignore` files by default, but you can also create a
333`.crushignore` file to specify additional files and directories that Crush
334should ignore. This is useful for excluding files that you want in version
335control but don't want Crush to consider when providing context.
337The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
338in the root of your project or in subdirectories.
342By default, Crush will ask you for permission before running tool calls. If
343you'd like, you can allow tools to be executed without prompting you for
344permissions. Use this with care.
348 "$schema": "https://charm.land/crush.json",
355 "mcp_context7_get-library-doc"
361You can also skip all permission prompts entirely by running Crush with the
362`--yolo` flag. Be very, very careful with this feature.
364### Disabling Built-In Tools
366If you'd like to prevent Crush from using certain built-in tools entirely, you
367can disable them via the `options.disabled_tools` list. Disabled tools are
368completely hidden from the agent.
372 "$schema": "https://charm.land/crush.json",
382To disable tools from MCP servers, see the [MCP config section](#mcps).
386Crush supports the [Agent Skills](https://agentskills.io) open standard for
387extending agent capabilities with reusable skill packages. Skills are folders
388containing a `SKILL.md` file with instructions that Crush can discover and
391Skills are discovered from:
393- `~/.config/crush/skills/` on Unix (default, can be overridden with `CRUSH_SKILLS_DIR`)
394- `%LOCALAPPDATA%\crush\skills\` on Windows (default, can be overridden with `CRUSH_SKILLS_DIR`)
395- Additional paths configured via `options.skills_paths`
399 "$schema": "https://charm.land/crush.json",
402 "~/.config/crush/skills", // Windows: "%LOCALAPPDATA%\\crush\\skills",
409You can get started with example skills from [anthropics/skills](https://github.com/anthropics/skills):
413mkdir -p ~/.config/crush/skills
414cd ~/.config/crush/skills
415git clone https://github.com/anthropics/skills.git _temp
416mv _temp/skills/* . && rm -rf _temp
420# Windows (PowerShell)
421mkdir -Force "$env:LOCALAPPDATA\crush\skills"
422cd "$env:LOCALAPPDATA\crush\skills"
423git clone https://github.com/anthropics/skills.git _temp
424mv _temp/skills/* . ; rm -r -force _temp
429When you initialize a project, Crush analyzes your codebase and creates
430a context file that helps it work more effectively in future sessions.
431By default, this file is named `AGENTS.md`, but you can customize the
432name and location with the `initialize_as` option:
436 "$schema": "https://charm.land/crush.json",
438 "initialize_as": "AGENTS.md"
443This is useful if you prefer a different naming convention or want to
444place the file in a specific directory (e.g., `CRUSH.md` or
445`docs/LLMs.md`). Crush will fill the file with project-specific context
446like build commands, code patterns, and conventions it discovered during
449### Attribution Settings
451By default, Crush adds attribution information to Git commits and pull requests
452it creates. You can customize this behavior with the `attribution` option:
456 "$schema": "https://charm.land/crush.json",
459 "trailer_style": "co-authored-by",
460 "generated_with": true
466- `trailer_style`: Controls the attribution trailer added to commit messages
467 (default: `assisted-by`)
468 - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
469 (includes the model name)
470 - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
471 - `none`: No attribution trailer
472- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
473 commit messages and PR descriptions
477Crush supports custom provider configurations for both OpenAI-compatible and
478Anthropic-compatible APIs.
481> Note that we support two "types" for OpenAI. Make sure to choose the right one
482> to ensure the best experience!
483> * `openai` should be used when proxying or routing requests through OpenAI.
484> * `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
486#### OpenAI-Compatible APIs
488Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
489API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
493 "$schema": "https://charm.land/crush.json",
496 "type": "openai-compat",
497 "base_url": "https://api.deepseek.com/v1",
498 "api_key": "$DEEPSEEK_API_KEY",
501 "id": "deepseek-chat",
502 "name": "Deepseek V3",
503 "cost_per_1m_in": 0.27,
504 "cost_per_1m_out": 1.1,
505 "cost_per_1m_in_cached": 0.07,
506 "cost_per_1m_out_cached": 1.1,
507 "context_window": 64000,
508 "default_max_tokens": 5000
516#### Anthropic-Compatible APIs
518Custom Anthropic-compatible providers follow this format:
522 "$schema": "https://charm.land/crush.json",
524 "custom-anthropic": {
526 "base_url": "https://api.anthropic.com/v1",
527 "api_key": "$ANTHROPIC_API_KEY",
529 "anthropic-version": "2023-06-01"
533 "id": "claude-sonnet-4-20250514",
534 "name": "Claude Sonnet 4",
536 "cost_per_1m_out": 15,
537 "cost_per_1m_in_cached": 3.75,
538 "cost_per_1m_out_cached": 0.3,
539 "context_window": 200000,
540 "default_max_tokens": 50000,
542 "supports_attachments": true
552Crush currently supports running Anthropic models through Bedrock, with caching disabled.
554- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
555- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
556- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
557- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
559### Vertex AI Platform
561Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
564gcloud auth application-default login
567To add specific models to the configuration, configure as such:
571 "$schema": "https://charm.land/crush.json",
576 "id": "claude-sonnet-4@20250514",
577 "name": "VertexAI Sonnet 4",
579 "cost_per_1m_out": 15,
580 "cost_per_1m_in_cached": 3.75,
581 "cost_per_1m_out_cached": 0.3,
582 "context_window": 200000,
583 "default_max_tokens": 50000,
585 "supports_attachments": true
595Local models can also be configured via OpenAI-compatible API. Here are two common examples:
604 "base_url": "http://localhost:11434/v1/",
605 "type": "openai-compat",
608 "name": "Qwen 3 30B",
610 "context_window": 256000,
611 "default_max_tokens": 20000
626 "base_url": "http://localhost:1234/v1/",
627 "type": "openai-compat",
630 "name": "Qwen 3 30B",
631 "id": "qwen/qwen3-30b-a3b-2507",
632 "context_window": 256000,
633 "default_max_tokens": 20000
643Sometimes you need to look at logs. Luckily, Crush logs all sorts of
644stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
646The CLI also contains some helper commands to make perusing recent logs easier:
649# Print the last 1000 lines
652# Print the last 500 lines
655# Follow logs in real time
659Want more logging? Run `crush` with the `--debug` flag, or enable it in the
664 "$schema": "https://charm.land/crush.json",
672## Provider Auto-Updates
674By default, Crush automatically checks for the latest and greatest list of
675providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
676the open source Crush provider database. This means that when new providers and
677models are available, or when model metadata changes, Crush automatically
678updates your local configuration.
680### Disabling automatic provider updates
682For those with restricted internet access, or those who prefer to work in
683air-gapped environments, this might not be want you want, and this feature can
686To disable automatic provider updates, set `disable_provider_auto_update` into
687your `crush.json` config:
691 "$schema": "https://charm.land/crush.json",
693 "disable_provider_auto_update": true
698Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
701export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
704### Manually updating providers
706Manually updating providers is possible with the `crush update-providers`
710# Update providers remotely from Catwalk.
711crush update-providers
713# Update providers from a custom Catwalk base URL.
714crush update-providers https://example.com/
716# Update providers from a local file.
717crush update-providers /path/to/local-providers.json
719# Reset providers to the embedded version, embedded at crush at build time.
720crush update-providers embedded
723crush update-providers --help
728Crush records pseudonymous usage metrics (tied to a device-specific hash),
729which maintainers rely on to inform development and support priorities. The
730metrics include solely usage metadata; prompts and responses are NEVER
733Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
734and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
736You can opt out of metrics collection at any time by setting the environment
737variable by setting the following in your environment:
740export CRUSH_DISABLE_METRICS=1
743Or by setting the following in your config:
748 "disable_metrics": true
753Crush also respects the `DO_NOT_TRACK` convention which can be enabled via
754`export DO_NOT_TRACK=1`.
758See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
762We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
764- [Twitter](https://twitter.com/charmcli)
765- [Slack](https://charm.land/slack)
767- [The Fediverse](https://mastodon.social/@charmcli)
768- [Bluesky](https://bsky.app/profile/charm.land)
770[discord]: https://charm.land/discord
774[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
778Part of [Charm](https://charm.land).
780<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
782<!--prettier-ignore-->
783Charm热爱开源 • 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