on 2faa467 help sign in
crush/README.md
914 lines 28 kB history raw
1# Crush
3<p align="center">
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>
7</p>
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>
14## Features
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
24## Installation
26Use a package manager:
28```bash
29# Homebrew
30brew install charmbracelet/tap/crush
32# NPM
33npm install -g @charmland/crush
35# Arch Linux (btw)
36yay -S crush-bin
38# Nix
39nix run github:numtide/nix-ai-tools#crush
41# FreeBSD
42pkg install crush
43```
45Windows users:
47```bash
48# Winget
49winget install charmbracelet.crush
51# Scoop
52scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
53scoop install crush
54```
56<details>
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`:
63```bash
64# Add the NUR channel.
65nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
66nix-channel --update
68# Get Crush in a Nix shell.
69nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
70```
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 :)
77```nix
79 inputs = {
80 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
81 nur.url = "github:nix-community/NUR";
82 };
84 outputs = { self, nixpkgs, nur, ... }: {
85 nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
86 system = "x86_64-linux";
87 modules = [
88 nur.modules.nixos.default
89 nur.repos.charmbracelet.modules.crush
90 {
91 programs.crush = {
92 enable = true;
93 settings = {
94 providers = {
95 openai = {
96 id = "openai";
97 name = "OpenAI";
98 base_url = "https://api.openai.com/v1";
99 type = "openai";
100 api_key = "sk-fake123456789abcdef...";
101 models = [
102 {
103 id = "gpt-4";
104 name = "GPT-4";
105 }
106 ];
107 };
108 };
109 lsp = {
110 go = { command = "gopls"; enabled = true; };
111 nix = { command = "nil"; enabled = true; };
112 };
113 options = {
114 context_paths = [ "/etc/nixos/configuration.nix" ];
115 tui = { compact_mode = true; };
116 debug = false;
117 };
118 };
119 };
120 }
121 ];
122 };
123 };
125```
127</details>
129<details>
130<summary><strong>Debian/Ubuntu</strong></summary>
132```bash
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
137```
139</details>
141<details>
142<summary><strong>Fedora/RHEL</strong></summary>
144```bash
145echo '[charm]
146name=Charm
147baseurl=https://repo.charm.sh/yum/
148enabled=1
149gpgcheck=1
150gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
151sudo yum install crush
152```
154</details>
156Or, download it:
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:
165```
166go install github.com/charmbracelet/crush@latest
167```
169> [!WARNING]
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.
174## Getting Started
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| `HYPER_API_KEY` | Charm Hyper |
185| `ANTHROPIC_API_KEY` | Anthropic |
186| `OPENAI_API_KEY` | OpenAI |
187| `VERCEL_API_KEY` | Vercel AI Gateway |
188| `GEMINI_API_KEY` | Google Gemini |
189| `SYNTHETIC_API_KEY` | Synthetic |
190| `ZAI_API_KEY` | Z.ai |
191| `MINIMAX_API_KEY` | MiniMax |
192| `HF_TOKEN` | Hugging Face Inference |
193| `CEREBRAS_API_KEY` | Cerebras |
194| `OPENROUTER_API_KEY` | OpenRouter |
195| `IONET_API_KEY` | io.net |
196| `ALIBABA_SINGAPORE_API_KEY` | Alibaba (Singapore) |
197| `GROQ_API_KEY` | Groq |
198| `AVIAN_API_KEY` | Avian |
199| `OPENCODE_API_KEY` | OpenCode Zen & Go |
200| `VERTEXAI_PROJECT` | Google Cloud VertexAI (Gemini) |
201| `VERTEXAI_LOCATION` | Google Cloud VertexAI (Gemini) |
202| `AWS_ACCESS_KEY_ID` | Amazon Bedrock (Claude) |
203| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock (Claude) |
204| `AWS_REGION` | Amazon Bedrock (Claude) |
205| `AWS_PROFILE` | Amazon Bedrock (Custom Profile) |
206| `AWS_BEARER_TOKEN_BEDROCK` | Amazon Bedrock |
207| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models |
208| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
209| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
211### Subscriptions
213If you prefer subscription-based usage, here are some plans that work well in
214Crush:
216- [Synthetic](https://synthetic.new/pricing)
217- [GLM Coding Plan](https://z.ai/subscribe)
218- [Kimi Code](https://www.kimi.com/membership/pricing)
219- [MiniMax Coding Plan](https://platform.minimax.io/subscribe/coding-plan)
221### By the Way
223Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
225Crush’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.
227<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>
229## Configuration
231> [!TIP]
232> Crush ships with a builtin `crush-config` skill for configuring itself. In
233> many cases you can simply ask Crush to configure itself.
235Crush runs great with no configuration. That said, if you do need or want to
236customize Crush, configuration can be added either local to the project itself,
237or globally, with the following priority:
2391. `.crush.json`
2402. `crush.json`
2413. `$HOME/.config/crush/crush.json`
243Configuration itself is stored as a JSON object:
245```json
247 "this-setting": { "this": "that" },
248 "that-setting": ["ceci", "cela"]
250```
252As an additional note, Crush also stores ephemeral data, such as application
253state, in one additional location:
255```bash
256# Unix
257$HOME/.local/share/crush/crush.json
259# Windows
260%LOCALAPPDATA%\crush\crush.json
261```
263> [!TIP]
264> You can override the user and data config locations by setting:
266> - `CRUSH_GLOBAL_CONFIG`
267> - `CRUSH_GLOBAL_DATA`
269### LSPs
271Crush can use LSPs for additional context to help inform its decisions, just
272like you would. LSPs can be added manually like so:
274```json
276 "$schema": "https://charm.land/crush.json",
277 "lsp": {
278 "go": {
279 "command": "gopls",
280 "env": {
281 "GOTOOLCHAIN": "go1.24.5"
282 }
283 },
284 "typescript": {
285 "command": "typescript-language-server",
286 "args": ["--stdio"]
287 },
288 "nix": {
289 "command": "nil"
290 }
291 }
293```
295### MCPs
297Crush also supports Model Context Protocol (MCP) servers through three transport
298types: `stdio` for command-line servers, `http` for HTTP endpoints, and `sse`
299for Server-Sent Events.
301Shell-style value expansion (`$VAR`, `${VAR:-default}`, `$(command)`, quoting,
302nesting) works in `command`, `args`, `env`, `headers`, and `url`, so
303file-based secrets work out of the box. You can use values like `"$TOKEN"`
304or `"$(cat /path/to/secret/token)"`. Expansion runs through Crush's embedded
305shell, so the same syntax works on every supported system, Windows included.
307Unset variables expand to the empty string by default, matching bash. For
308required credentials, use `${VAR:?message}` so an unset variable fails loudly
309at load time with `message` instead of silently resolving to empty:
311```json
312{ "api_key": "${CODEBERG_TOKEN:?set CODEBERG_TOKEN}" }
313```
315Headers (both MCP `headers` and provider `extra_headers`) whose value
316resolves to the empty string are dropped from the outgoing request rather
317than sent as `Header:`. That keeps optional env-gated headers like
318`"OpenAI-Organization": "$OPENAI_ORG_ID"` clean when the variable is unset.
320Provider `extra_body` is a non-expanding JSON passthrough; put env-driven
321values in `extra_headers` or the provider's `api_key` / `base_url`, all of
322which do expand.
324> **Security note:** `crush.json` is trusted code. Any `$(...)` in it runs at
325> load time with your shell's privileges, before the UI appears. Don't launch
326> Crush in a directory whose `crush.json` you haven't reviewed.
328```json
330 "$schema": "https://charm.land/crush.json",
331 "mcp": {
332 "filesystem": {
333 "type": "stdio",
334 "command": "node",
335 "args": ["/path/to/mcp-server.js"],
336 "timeout": 120,
337 "disabled": false,
338 "disabled_tools": ["some-tool-name"],
339 "env": {
340 "NODE_ENV": "production"
341 }
342 },
343 "github": {
344 "type": "http",
345 "url": "https://api.githubcopilot.com/mcp/",
346 "timeout": 120,
347 "disabled": false,
348 "disabled_tools": ["create_issue", "create_pull_request"],
349 "headers": {
350 "Authorization": "Bearer $GH_PAT"
351 }
352 },
353 "streaming-service": {
354 "type": "sse",
355 "url": "https://example.com/mcp/sse",
356 "timeout": 120,
357 "disabled": false,
358 "headers": {
359 "API-Key": "$(echo $API_KEY)"
360 }
361 }
362 }
364```
366### Hooks
368Crush has preliminary support for hooks. For details, see
369[the hook guide](./docs/hooks/).
371### Ignoring Files
373Crush respects `.gitignore` files by default, but you can also create a
374`.crushignore` file to specify additional files and directories that Crush
375should ignore. This is useful for excluding files that you want in version
376control but don't want Crush to consider when providing context.
378The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
379in the root of your project or in subdirectories.
381### Allowing Tools
383By default, Crush will ask you for permission before running tool calls. If
384you'd like, you can allow tools to be executed without prompting you for
385permissions. Use this with care.
387```json
389 "$schema": "https://charm.land/crush.json",
390 "permissions": {
391 "allowed_tools": [
392 "view",
393 "ls",
394 "grep",
395 "edit",
396 "mcp_context7_get-library-doc"
397 ]
398 }
400```
402You can also skip all permission prompts entirely by running Crush with the
403`--yolo` flag. Be very, very careful with this feature.
405### Disabling Built-In Tools
407If you'd like to prevent Crush from using certain built-in tools entirely, you
408can disable them via the `options.disabled_tools` list. Disabled tools are
409completely hidden from the agent.
411```json
413 "$schema": "https://charm.land/crush.json",
414 "options": {
415 "disabled_tools": ["bash", "sourcegraph"]
416 }
418```
420To disable tools from MCP servers, see the [MCP config section](#mcps).
422### Disabling Skills
424If you'd like to prevent Crush from using certain skills entirely, you can
425disable them via the `options.disabled_skills` list. Disabled skills are hidden
426from the agent, including builtin skills and skills discovered from disk.
428```json
430 "$schema": "https://charm.land/crush.json",
431 "options": {
432 "disabled_skills": ["crush-config"]
433 }
435```
437### Agent Skills
439Crush supports the [Agent Skills](https://agentskills.io) open standard for
440extending agent capabilities with reusable skill packages. Skills are folders
441containing a `SKILL.md` file with instructions that Crush can discover and
442activate on demand.
444The global paths we looks for skills are:
446* `$CRUSH_SKILLS_DIR`
447* `$XDG_CONFIG_HOME/agents/skills` or `~/.config/agents/skills/`
448* `$XDG_CONFIG_HOME/crush/skills` or `~/.config/crush/skills/`
449* `~/.agents/skills/`
450* `~/.claude/skills/`
451* On Windows, we _also_ look at
452 * `%LOCALAPPDATA%\agents\skills\` or `%USERPROFILE%\AppData\Local\agents\skills\`
453 * `%LOCALAPPDATA%\crush\skills\` or `%USERPROFILE%\AppData\Local\crush\skills\`
454* Additional paths configured via `options.skills_paths`
456On top of that, we _also_ load skills in your project from the following
457relative paths:
459* `.agents/skills`
460* `.crush/skills`
461* `.claude/skills`
462* `.cursor/skills`
464```jsonc
466 "$schema": "https://charm.land/crush.json",
467 "options": {
468 "skills_paths": [
469 "~/.config/crush/skills", // Windows: "%LOCALAPPDATA%\\crush\\skills",
470 "./project-skills",
471 ],
472 },
474```
476You can get started with example skills from [anthropics/skills](https://github.com/anthropics/skills):
478```bash
479# Unix
480mkdir -p ~/.config/crush/skills
481cd ~/.config/crush/skills
482git clone https://github.com/anthropics/skills.git _temp
483mv _temp/skills/* . && rm -rf _temp
484```
486```powershell
487# Windows (PowerShell)
488mkdir -Force "$env:LOCALAPPDATA\crush\skills"
489cd "$env:LOCALAPPDATA\crush\skills"
490git clone https://github.com/anthropics/skills.git _temp
491mv _temp/skills/* . ; rm -r -force _temp
492```
494#### User-Invocable Skills
496Skills can be made invocable as commands from the commands palette (Ctrl+P). Add `user-invocable: true` to the skill's YAML frontmatter:
498```yaml
499---
500name: my-skill
501description: A skill that can be invoked as a command.
502user-invocable: true
503---
504```
506User-invocable skills appear in the commands palette with a `user:` or `project:` prefix:
507- Skills from global directories show as `user:skill-name`
508- Skills from project directories show as `project:skill-name`
510When invoked, the skill's instructions are loaded into the conversation context.
512To prevent the model from auto-triggering a skill (while still allowing user invocation), add `disable-model-invocation: true`:
514```yaml
515---
516name: my-skill
517description: Only invocable by users, not the model.
518user-invocable: true
519disable-model-invocation: true
520---
521```
523Skills with `disable-model-invocation` won't appear in the model's available skills list but can still be invoked manually by users.
525### Desktop notifications
527Crush sends desktop notifications when a tool call requires permission and when
528the agent finishes its turn. They're only sent when the terminal window isn't
529focused _and_ your terminal supports reporting the focus state.
531```jsonc
533 "$schema": "https://charm.land/crush.json",
534 "options": {
535 "disable_notifications": false, // default
536 },
538```
540To disable desktop notifications, set `disable_notifications` to `true` in your
541configuration. On macOS, notifications currently lack icons due to platform
542limitations.
544### Initialization
546When you initialize a project, Crush analyzes your codebase and creates
547a context file that helps it work more effectively in future sessions.
548By default, this file is named `AGENTS.md`, but you can customize the
549name and location with the `initialize_as` option:
551```json
553 "$schema": "https://charm.land/crush.json",
554 "options": {
555 "initialize_as": "AGENTS.md"
556 }
558```
560This is useful if you prefer a different naming convention or want to
561place the file in a specific directory (e.g., `CRUSH.md` or
562`docs/LLMs.md`). Crush will fill the file with project-specific context
563like build commands, code patterns, and conventions it discovered during
564initialization.
566### Attribution Settings
568By default, Crush adds attribution information to Git commits and pull requests
569it creates. You can customize this behavior with the `attribution` option:
571```json
573 "$schema": "https://charm.land/crush.json",
574 "options": {
575 "attribution": {
576 "trailer_style": "co-authored-by",
577 "generated_with": true
578 }
579 }
581```
583- `trailer_style`: Controls the attribution trailer added to commit messages
584 (default: `assisted-by`)
585 - `assisted-by`: Adds `Assisted-by: Crush:[ModelID]` as specified in [the convention](https://docs.kernel.org/process/coding-assistants.html#attribution)
586 - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
587 - `none`: No attribution trailer
588- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
589 commit messages and PR descriptions
591### Custom Providers
593Crush supports custom provider configurations for both OpenAI-compatible and
594Anthropic-compatible APIs.
596> [!NOTE]
597> Note that we support two "types" for OpenAI. Make sure to choose the right one
598> to ensure the best experience!
600> - `openai` should be used when proxying or routing requests through OpenAI.
601> - `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
603#### OpenAI-Compatible APIs
605Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
606API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
608```json
610 "$schema": "https://charm.land/crush.json",
611 "providers": {
612 "deepseek": {
613 "type": "openai-compat",
614 "base_url": "https://api.deepseek.com/v1",
615 "api_key": "$DEEPSEEK_API_KEY",
616 "models": [
617 {
618 "id": "deepseek-chat",
619 "name": "Deepseek V3",
620 "cost_per_1m_in": 0.27,
621 "cost_per_1m_out": 1.1,
622 "cost_per_1m_in_cached": 0.07,
623 "cost_per_1m_out_cached": 1.1,
624 "context_window": 64000,
625 "default_max_tokens": 5000
626 }
627 ]
628 }
629 }
631```
633#### Anthropic-Compatible APIs
635Custom Anthropic-compatible providers follow this format:
637```json
639 "$schema": "https://charm.land/crush.json",
640 "providers": {
641 "custom-anthropic": {
642 "type": "anthropic",
643 "base_url": "https://api.anthropic.com/v1",
644 "api_key": "$ANTHROPIC_API_KEY",
645 "extra_headers": {
646 "anthropic-version": "2023-06-01"
647 },
648 "models": [
649 {
650 "id": "claude-sonnet-4-20250514",
651 "name": "Claude Sonnet 4",
652 "cost_per_1m_in": 3,
653 "cost_per_1m_out": 15,
654 "cost_per_1m_in_cached": 3.75,
655 "cost_per_1m_out_cached": 0.3,
656 "context_window": 200000,
657 "default_max_tokens": 50000,
658 "can_reason": true,
659 "supports_attachments": true
660 }
661 ]
662 }
663 }
665```
667### Amazon Bedrock
669Crush currently supports running Anthropic models through Bedrock, with caching disabled.
671- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
672- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
673- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
674- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
676### Vertex AI Platform
678Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
680```bash
681gcloud auth application-default login
682```
684To add specific models to the configuration, configure as such:
686```json
688 "$schema": "https://charm.land/crush.json",
689 "providers": {
690 "vertexai": {
691 "models": [
692 {
693 "id": "claude-sonnet-4@20250514",
694 "name": "VertexAI Sonnet 4",
695 "cost_per_1m_in": 3,
696 "cost_per_1m_out": 15,
697 "cost_per_1m_in_cached": 3.75,
698 "cost_per_1m_out_cached": 0.3,
699 "context_window": 200000,
700 "default_max_tokens": 50000,
701 "can_reason": true,
702 "supports_attachments": true
703 }
704 ]
705 }
706 }
708```
710### Local Models
712Local models can also be configured via OpenAI-compatible API. Here are two common examples:
714#### Ollama
716```json
718 "providers": {
719 "ollama": {
720 "name": "Ollama",
721 "base_url": "http://localhost:11434/v1/",
722 "type": "openai-compat",
723 "models": [
724 {
725 "name": "Qwen 3 30B",
726 "id": "qwen3:30b",
727 "context_window": 256000,
728 "default_max_tokens": 20000
729 }
730 ]
731 }
732 }
734```
736#### LM Studio
738```json
740 "providers": {
741 "lmstudio": {
742 "name": "LM Studio",
743 "base_url": "http://localhost:1234/v1/",
744 "type": "openai-compat",
745 "models": [
746 {
747 "name": "Qwen 3 30B",
748 "id": "qwen/qwen3-30b-a3b-2507",
749 "context_window": 256000,
750 "default_max_tokens": 20000
751 }
752 ]
753 }
754 }
756```
758## Logging
760Sometimes you need to look at logs. Luckily, Crush logs all sorts of
761stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
763The CLI also contains some helper commands to make perusing recent logs easier:
765```bash
766# Print the last 1000 lines
767crush logs
769# Print the last 500 lines
770crush logs --tail 500
772# Follow logs in real time
773crush logs --follow
774```
776Want more logging? Run `crush` with the `--debug` flag, or enable it in the
777config:
779```json
781 "$schema": "https://charm.land/crush.json",
782 "options": {
783 "debug": true,
784 "debug_lsp": true
785 }
787```
789## Provider Auto-Updates
791By default, Crush automatically checks for the latest and greatest list of
792providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
793the open source Crush provider database. This means that when new providers and
794models are available, or when model metadata changes, Crush automatically
795updates your local configuration.
797### Disabling automatic provider updates
799For those with restricted internet access, or those who prefer to work in
800air-gapped environments, this might not be want you want, and this feature can
801be disabled.
803To disable automatic provider updates, set `disable_provider_auto_update` into
804your `crush.json` config:
806```json
808 "$schema": "https://charm.land/crush.json",
809 "options": {
810 "disable_provider_auto_update": true
811 }
813```
815Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
817```bash
818export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
819```
821### Manually updating providers
823Manually updating providers is possible with the `crush update-providers`
824command:
826```bash
827# Update providers remotely from Catwalk.
828crush update-providers
830# Update providers from a custom Catwalk base URL.
831crush update-providers https://example.com/
833# Update providers from a local file.
834crush update-providers /path/to/local-providers.json
836# Reset providers to the embedded version, embedded at crush at build time.
837crush update-providers embedded
839# For more info:
840crush update-providers --help
841```
843## Metrics
845Crush records pseudonymous usage metrics (tied to a device-specific hash),
846which maintainers rely on to inform development and support priorities. The
847metrics include solely usage metadata; prompts and responses are NEVER
848collected.
850Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
851and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
853You can opt out of metrics collection at any time by setting the environment
854variable by setting the following in your environment:
856```bash
857export CRUSH_DISABLE_METRICS=1
858```
860Or by setting the following in your config:
862```json
864 "options": {
865 "disable_metrics": true
866 }
868```
870Crush also respects the [`DO_NOT_TRACK`](https://donottrack.sh/) convention
871which can be enabled via `export DO_NOT_TRACK=1`.
873## Q&A
875### Why is clipboard copy and paste not working?
877Installing an extra tool might be needed on Unix-like environments.
879| Environment | Tool |
880| ------------------- | ------------------------ |
881| Windows | Native support |
882| macOS | Native support |
883| Linux/BSD + Wayland | `wl-copy` and `wl-paste` |
884| Linux/BSD + X11 | `xclip` or `xsel` |
886## Contributing
888See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
890## Whatcha think?
892We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
894- [Twitter](https://twitter.com/charmcli)
895- [Slack][slack]
896- [Discord][discord]
897- [The Fediverse](https://mastodon.social/@charmcli)
898- [Bluesky](https://bsky.app/profile/charm.land)
900[slack]: https://charm.land/slack
901[discord]: https://charm.land/discord
903## License
905[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
907---
909Part of [Charm](https://charm.land).
911<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-softy.jpg" /></a>
913<!--prettier-ignore-->
914Charm热爱开源 • Charm loves open source