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/adc1a6f4-b284-4603-836c-59038caa2e8b" /></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), FreeBSD, OpenBSD, and NetBSD
29brew install charmbracelet/tap/crush
32npm install -g @charmland/crush
38nix run github:numtide/nix-ai-tools#crush
45winget install charmbracelet.crush
48scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
53<summary><strong>Nix (NUR)</strong></summary>
55Crush is available via [NUR](https://github.com/nix-community/NUR) in `nur.repos.charmbracelet.crush`.
57You can also try out Crush via `nix-shell`:
61nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
64# Get Crush in a Nix shell.
65nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
68### NixOS & Home Manager Module Usage via NUR
70Crush provides NixOS and Home Manager modules via NUR.
71You 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 :)
76 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
77 nur.url = "github:nix-community/NUR";
80 outputs = { self, nixpkgs, nur, ... }: {
81 nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
82 system = "x86_64-linux";
84 nur.modules.nixos.default
85 nur.repos.charmbracelet.modules.crush
94 base_url = "https://api.openai.com/v1";
96 api_key = "sk-fake123456789abcdef...";
106 go = { command = "gopls"; enabled = true; };
107 nix = { command = "nil"; enabled = true; };
110 context_paths = [ "/etc/nixos/configuration.nix" ];
111 tui = { compact_mode = true; };
126<summary><strong>Debian/Ubuntu</strong></summary>
129sudo mkdir -p /etc/apt/keyrings
130curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
131echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
132sudo apt update && sudo apt install crush
138<summary><strong>Fedora/RHEL</strong></summary>
143baseurl=https://repo.charm.sh/yum/
146gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
147sudo yum install crush
154- [Packages][releases] are available in Debian and RPM formats
155- [Binaries][releases] are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD
157[releases]: https://github.com/charmbracelet/crush/releases
159Or just install it with Go:
162go install github.com/charmbracelet/crush@latest
166> Productivity may increase when using Crush and you may find yourself nerd
167> sniped when first using the application. If the symptoms persist, join the
168> [Discord][discord] and nerd snipe the rest of us.
172The quickest way to get started is to grab an API key for your preferred
173provider such as Anthropic, OpenAI, Groq, or OpenRouter and just start
174Crush. You'll be prompted to enter your API key.
176That said, you can also set environment variables for preferred providers.
178| Environment Variable | Provider |
179| --------------------------- | -------------------------------------------------- |
180| `ANTHROPIC_API_KEY` | Anthropic |
181| `OPENAI_API_KEY` | OpenAI |
182| `OPENROUTER_API_KEY` | OpenRouter |
183| `GEMINI_API_KEY` | Google Gemini |
184| `CEREBRAS_API_KEY` | Cerebras |
185| `HF_TOKEN` | Huggingface Inference |
186| `VERTEXAI_PROJECT` | Google Cloud VertexAI (Gemini) |
187| `VERTEXAI_LOCATION` | Google Cloud VertexAI (Gemini) |
188| `GROQ_API_KEY` | Groq |
189| `AWS_ACCESS_KEY_ID` | Amazon Bedrock (Claude) |
190| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock (Claude) |
191| `AWS_REGION` | Amazon Bedrock (Claude) |
192| `AWS_PROFILE` | Amazon Bedrock (Custom Profile) |
193| `AWS_BEARER_TOKEN_BEDROCK` | Amazon Bedrock |
194| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models |
195| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
196| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
200Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
202Crush’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.
204<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>
208Crush runs great with no configuration. That said, if you do need or want to
209customize Crush, configuration can be added either local to the project itself,
210or globally, with the following priority:
2143. `$HOME/.config/crush/crush.json`
216Configuration itself is stored as a JSON object:
220 "this-setting": { "this": "that" },
221 "that-setting": ["ceci", "cela"]
225As an additional note, Crush also stores ephemeral data, such as application state, in one additional location:
229$HOME/.local/share/crush/crush.json
232%LOCALAPPDATA%\crush\crush.json
237Crush can use LSPs for additional context to help inform its decisions, just
238like you would. LSPs can be added manually like so:
242 "$schema": "https://charm.land/crush.json",
247 "GOTOOLCHAIN": "go1.24.5"
251 "command": "typescript-language-server",
263Crush also supports Model Context Protocol (MCP) servers through three
264transport types: `stdio` for command-line servers, `http` for HTTP endpoints,
265and `sse` for Server-Sent Events. Environment variable expansion is supported
266using `$(echo $VAR)` syntax.
270 "$schema": "https://charm.land/crush.json",
275 "args": ["/path/to/mcp-server.js"],
279 "NODE_ENV": "production"
284 "url": "https://api.githubcopilot.com/mcp/",
288 "Authorization": "Bearer $GH_PAT"
291 "streaming-service": {
293 "url": "https://example.com/mcp/sse",
297 "API-Key": "$(echo $API_KEY)"
306Crush respects `.gitignore` files by default, but you can also create a
307`.crushignore` file to specify additional files and directories that Crush
308should ignore. This is useful for excluding files that you want in version
309control but don't want Crush to consider when providing context.
311The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
312in the root of your project or in subdirectories.
316By default, Crush will ask you for permission before running tool calls. If
317you'd like, you can allow tools to be executed without prompting you for
318permissions. Use this with care.
322 "$schema": "https://charm.land/crush.json",
329 "mcp_context7_get-library-doc"
335You can also skip all permission prompts entirely by running Crush with the
336`--yolo` flag. Be very, very careful with this feature.
340When you initialize a project, Crush analyzes your codebase and creates
341a context file that helps it work more effectively in future sessions.
342By default, this file is named `AGENTS.md`, but you can customize the
343name and location with the `initialize_as` option:
347 "$schema": "https://charm.land/crush.json",
349 "initialize_as": "AGENTS.md"
354This is useful if you prefer a different naming convention or want to
355place the file in a specific directory (e.g., `CRUSH.md` or
356`docs/LLMs.md`). Crush will fill the file with project-specific context
357like build commands, code patterns, and conventions it discovered during
360### Attribution Settings
362By default, Crush adds attribution information to Git commits and pull requests
363it creates. You can customize this behavior with the `attribution` option:
367 "$schema": "https://charm.land/crush.json",
370 "trailer_style": "co-authored-by",
371 "generated_with": true
377- `trailer_style`: Controls the attribution trailer added to commit messages
378 (default: `assisted-by`)
379 - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
380 (includes the model name)
381 - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
382 - `none`: No attribution trailer
383- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
384 commit messages and PR descriptions
388Crush supports custom provider configurations for both OpenAI-compatible and
389Anthropic-compatible APIs.
392> Note that we support two "types" for OpenAI. Make sure to choose the right one
393> to ensure the best experience!
394> * `openai` should be used when proxying or routing requests through OpenAI.
395> * `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
397#### OpenAI-Compatible APIs
399Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
400API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
404 "$schema": "https://charm.land/crush.json",
407 "type": "openai-compat",
408 "base_url": "https://api.deepseek.com/v1",
409 "api_key": "$DEEPSEEK_API_KEY",
412 "id": "deepseek-chat",
413 "name": "Deepseek V3",
414 "cost_per_1m_in": 0.27,
415 "cost_per_1m_out": 1.1,
416 "cost_per_1m_in_cached": 0.07,
417 "cost_per_1m_out_cached": 1.1,
418 "context_window": 64000,
419 "default_max_tokens": 5000
427#### Anthropic-Compatible APIs
429Custom Anthropic-compatible providers follow this format:
433 "$schema": "https://charm.land/crush.json",
435 "custom-anthropic": {
437 "base_url": "https://api.anthropic.com/v1",
438 "api_key": "$ANTHROPIC_API_KEY",
440 "anthropic-version": "2023-06-01"
444 "id": "claude-sonnet-4-20250514",
445 "name": "Claude Sonnet 4",
447 "cost_per_1m_out": 15,
448 "cost_per_1m_in_cached": 3.75,
449 "cost_per_1m_out_cached": 0.3,
450 "context_window": 200000,
451 "default_max_tokens": 50000,
453 "supports_attachments": true
463Crush currently supports running Anthropic models through Bedrock, with caching disabled.
465- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
466- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
467- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
468- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
470### Vertex AI Platform
472Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
475gcloud auth application-default login
478To add specific models to the configuration, configure as such:
482 "$schema": "https://charm.land/crush.json",
487 "id": "claude-sonnet-4@20250514",
488 "name": "VertexAI Sonnet 4",
490 "cost_per_1m_out": 15,
491 "cost_per_1m_in_cached": 3.75,
492 "cost_per_1m_out_cached": 0.3,
493 "context_window": 200000,
494 "default_max_tokens": 50000,
496 "supports_attachments": true
506Local models can also be configured via OpenAI-compatible API. Here are two common examples:
515 "base_url": "http://localhost:11434/v1/",
516 "type": "openai-compat",
519 "name": "Qwen 3 30B",
521 "context_window": 256000,
522 "default_max_tokens": 20000
537 "base_url": "http://localhost:1234/v1/",
538 "type": "openai-compat",
541 "name": "Qwen 3 30B",
542 "id": "qwen/qwen3-30b-a3b-2507",
543 "context_window": 256000,
544 "default_max_tokens": 20000
554Sometimes you need to look at logs. Luckily, Crush logs all sorts of
555stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
557The CLI also contains some helper commands to make perusing recent logs easier:
560# Print the last 1000 lines
563# Print the last 500 lines
566# Follow logs in real time
570Want more logging? Run `crush` with the `--debug` flag, or enable it in the
575 "$schema": "https://charm.land/crush.json",
583## Provider Auto-Updates
585By default, Crush automatically checks for the latest and greatest list of
586providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
587the open source Crush provider database. This means that when new providers and
588models are available, or when model metadata changes, Crush automatically
589updates your local configuration.
591### Disabling automatic provider updates
593For those with restricted internet access, or those who prefer to work in
594air-gapped environments, this might not be want you want, and this feature can
597To disable automatic provider updates, set `disable_provider_auto_update` into
598your `crush.json` config:
602 "$schema": "https://charm.land/crush.json",
604 "disable_provider_auto_update": true
609Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
612export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
615### Manually updating providers
617Manually updating providers is possible with the `crush update-providers`
621# Update providers remotely from Catwalk.
622crush update-providers
624# Update providers from a custom Catwalk base URL.
625crush update-providers https://example.com/
627# Update providers from a local file.
628crush update-providers /path/to/local-providers.json
630# Reset providers to the embedded version, embedded at crush at build time.
631crush update-providers embedded
634crush update-providers --help
639Crush records pseudonymous usage metrics (tied to a device-specific hash),
640which maintainers rely on to inform development and support priorities. The
641metrics include solely usage metadata; prompts and responses are NEVER
644Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
645and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
647You can opt out of metrics collection at any time by setting the environment
648variable by setting the following in your environment:
651export CRUSH_DISABLE_METRICS=1
654Or by setting the following in your config:
659 "disable_metrics": true
664Crush also respects the [`DO_NOT_TRACK`](https://consoledonottrack.com)
665convention which can be enabled via `export DO_NOT_TRACK=1`.
669See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
673We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
675- [Twitter](https://twitter.com/charmcli)
676- [Slack](https://charm.land/slack)
678- [The Fediverse](https://mastodon.social/@charmcli)
679- [Bluesky](https://bsky.app/profile/charm.land)
681[discord]: https://charm.land/discord
685[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
689Part of [Charm](https://charm.land).
691<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
693<!--prettier-ignore-->
694Charm热爱开源 • 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