README.md

  1**NOTE:** This is a personal fork of
  2[Crush](https://github.com/charmbracelet/crush) where I'm experimenting with
  3things. You'll also find my patches merged here before they're merged into
  4upstream. I've also unconditionally disabled metrics and yote the CLA; devs
  5shouldn't assign their copyrights to maintainers and hand them the rug they'll
  6yank from under you later.
  7
  8Pre-built binaries are available at
  9[releases.secluded.site/crush/latest][bin-latest].
 10
 11[bin-latest]: https://releases.secluded.site/crush/latest
 12
 13- Using [mise](https://mise.jdx.dev/) (recommended), copy the snippet
 14  from the releases page into your `mise.toml` or global
 15`~/.config/mise/config.toml` to automate updates.
 16- Without mise, or a similar tool, download the binary for your platform
 17  from the releases page and place it somewhere in your `$PATH`.
 18
 19I pull upstream changes into the `upstream` branch here, break my
 20branches off that, then merge them into my `dev` branch, which gets
 21rebased on `upstream` fairly often. `dev` history will get rewritten
 22frequently.
 23
 24Contributions are welcome (see following section) and I'll try to
 25maintain anything I accept here.
 26
 27## Contributions
 28
 29Patch requests are in [amolith/llm-projects] on [pr.pico.sh]. You don't
 30need a new account to contribute, you don't need to fork this repo, you
 31don't need to fiddle with `git send-email`, you don't need to faff with
 32your email client to get `git request-pull` working...
 33
 34You just need:
 35
 36- Git
 37- SSH
 38- An SSH key
 39
 40```sh
 41# Clone this repo, make your changes, and commit them
 42# Create a new patch request with
 43git format-patch origin/main --stdout | ssh pr.pico.sh pr create amolith/llm-projects
 44# After potential feedback, submit a revision to an existing patch request with
 45git format-patch origin/main --stdout | ssh pr.pico.sh pr add {prID}
 46# List patch requests
 47ssh pr.pico.sh pr ls amolith/llm-projects
 48```
 49
 50See "How do Patch Requests work?" on [pr.pico.sh]'s home page for a more
 51complete example workflow.
 52
 53[amolith/llm-projects]: https://pr.pico.sh/r/amolith/llm-projects
 54[pr.pico.sh]: https://pr.pico.sh
 55
 56---
 57
 58_Everything from here on is from the original Crush README._
 59
 60---
 61
 62# Crush
 63
 64<p align="center">
 65    <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 />
 66    <a href="https://github.com/charmbracelet/crush/releases"><img src="https://img.shields.io/github/release/charmbracelet/crush" alt="Latest Release"></a>
 67    <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>
 68</p>
 69
 70<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>
 71<p align="center">终端里的编程新搭档,<br />无缝接入你的工具、代码与工作流,全面兼容主流 LLM 模型。</p>
 72
 73<p align="center"><img width="800" alt="Crush Demo" src="https://github.com/user-attachments/assets/58280caf-851b-470a-b6f7-d5c4ea8a1968" /></p>
 74
 75## Features
 76
 77- **Multi-Model:** choose from a wide range of LLMs or add your own via OpenAI- or Anthropic-compatible APIs
 78- **Flexible:** switch LLMs mid-session while preserving context
 79- **Session-Based:** maintain multiple work sessions and contexts per project
 80- **LSP-Enhanced:** Crush uses LSPs for additional context, just like you do
 81- **Extensible:** add capabilities via MCPs (`http`, `stdio`, and `sse`)
 82- **Works Everywhere:** first-class support in every terminal on macOS, Linux, Windows (PowerShell and WSL), Android, FreeBSD, OpenBSD, and NetBSD
 83- **Industrial Grade:** built on the Charm ecosystem, powering 25k+ applications, from leading open source projects to business-critical infrastructure
 84
 85## Installation
 86
 87Use a package manager:
 88
 89```bash
 90# Homebrew
 91brew install charmbracelet/tap/crush
 92
 93# NPM
 94npm install -g @charmland/crush
 95
 96# Arch Linux (btw)
 97yay -S crush-bin
 98
 99# Nix
100nix run github:numtide/nix-ai-tools#crush
101
102# FreeBSD
103pkg install crush
104```
105
106Windows users:
107
108```bash
109# Winget
110winget install charmbracelet.crush
111
112# Scoop
113scoop bucket add charm https://github.com/charmbracelet/scoop-bucket.git
114scoop install crush
115```
116
117<details>
118<summary><strong>Nix (NUR)</strong></summary>
119
120Crush 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.
121
122You can also try out Crush via the NUR with `nix-shell`:
123
124```bash
125# Add the NUR channel.
126nix-channel --add https://github.com/nix-community/NUR/archive/main.tar.gz nur
127nix-channel --update
128
129# Get Crush in a Nix shell.
130nix-shell -p '(import <nur> { pkgs = import <nixpkgs> {}; }).repos.charmbracelet.crush'
131```
132
133### NixOS & Home Manager Module Usage via NUR
134
135Crush provides NixOS and Home Manager modules via NUR.
136You 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 :)
137
138```nix
139{
140  inputs = {
141    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
142    nur.url = "github:nix-community/NUR";
143  };
144
145  outputs = { self, nixpkgs, nur, ... }: {
146    nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
147      system = "x86_64-linux";
148      modules = [
149        nur.modules.nixos.default
150        nur.repos.charmbracelet.modules.crush
151        {
152          programs.crush = {
153            enable = true;
154            settings = {
155              providers = {
156                openai = {
157                  id = "openai";
158                  name = "OpenAI";
159                  base_url = "https://api.openai.com/v1";
160                  type = "openai";
161                  api_key = "sk-fake123456789abcdef...";
162                  models = [
163                    {
164                      id = "gpt-4";
165                      name = "GPT-4";
166                    }
167                  ];
168                };
169              };
170              lsp = {
171                go = { command = "gopls"; enabled = true; };
172                nix = { command = "nil"; enabled = true; };
173              };
174              options = {
175                context_paths = [ "/etc/nixos/configuration.nix" ];
176                tui = { compact_mode = true; };
177                debug = false;
178              };
179            };
180          };
181        }
182      ];
183    };
184  };
185}
186```
187
188</details>
189
190<details>
191<summary><strong>Debian/Ubuntu</strong></summary>
192
193```bash
194sudo mkdir -p /etc/apt/keyrings
195curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
196echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
197sudo apt update && sudo apt install crush
198```
199
200</details>
201
202<details>
203<summary><strong>Fedora/RHEL</strong></summary>
204
205```bash
206echo '[charm]
207name=Charm
208baseurl=https://repo.charm.sh/yum/
209enabled=1
210gpgcheck=1
211gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
212sudo yum install crush
213```
214
215</details>
216
217Or, download it:
218
219- [Packages][releases] are available in Debian and RPM formats
220- [Binaries][releases] are available for Linux, macOS, Windows, FreeBSD, OpenBSD, and NetBSD
221
222[releases]: https://github.com/charmbracelet/crush/releases
223
224Or just install it with Go:
225
226```
227go install github.com/charmbracelet/crush@latest
228```
229
230> [!WARNING]
231> Productivity may increase when using Crush and you may find yourself nerd
232> sniped when first using the application. If the symptoms persist, join the
233> [Discord][discord] and nerd snipe the rest of us.
234
235## Getting Started
236
237The quickest way to get started is to grab an API key for your preferred
238provider such as Anthropic, OpenAI, Groq, OpenRouter, or Vercel AI Gateway and just start
239Crush. You'll be prompted to enter your API key.
240
241That said, you can also set environment variables for preferred providers.
242
243| Environment Variable        | Provider                                           |
244| --------------------------- | -------------------------------------------------- |
245| `ANTHROPIC_API_KEY`         | Anthropic                                          |
246| `OPENAI_API_KEY`            | OpenAI                                             |
247| `VERCEL_API_KEY`            | Vercel AI Gateway                                  |
248| `GEMINI_API_KEY`            | Google Gemini                                      |
249| `SYNTHETIC_API_KEY`         | Synthetic                                          |
250| `ZAI_API_KEY`               | Z.ai                                               |
251| `MINIMAX_API_KEY`           | MiniMax                                            |
252| `HF_TOKEN`                  | Hugging Face Inference                             |
253| `CEREBRAS_API_KEY`          | Cerebras                                           |
254| `OPENROUTER_API_KEY`        | OpenRouter                                         |
255| `IONET_API_KEY`             | io.net                                             |
256| `GROQ_API_KEY`              | Groq                                               |
257| `VERTEXAI_PROJECT`          | Google Cloud VertexAI (Gemini)                     |
258| `VERTEXAI_LOCATION`         | Google Cloud VertexAI (Gemini)                     |
259| `AWS_ACCESS_KEY_ID`         | Amazon Bedrock (Claude)                            |
260| `AWS_SECRET_ACCESS_KEY`     | Amazon Bedrock (Claude)                            |
261| `AWS_REGION`                | Amazon Bedrock (Claude)                            |
262| `AWS_PROFILE`               | Amazon Bedrock (Custom Profile)                    |
263| `AWS_BEARER_TOKEN_BEDROCK`  | Amazon Bedrock                                     |
264| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models                                |
265| `AZURE_OPENAI_API_KEY`      | Azure OpenAI models (optional when using Entra ID) |
266| `AZURE_OPENAI_API_VERSION`  | Azure OpenAI models                                |
267
268### Subscriptions
269
270If you prefer subscription-based usage, here are some plans that work well in
271Crush:
272
273- [Synthetic](https://synthetic.new/pricing)
274- [GLM Coding Plan](https://z.ai/subscribe)
275- [Kimi Code](https://www.kimi.com/membership/pricing)
276- [MiniMax Coding Plan](https://platform.minimax.io/subscribe/coding-plan)
277
278### By the Way
279
280Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
281
282Crush’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.
283
284<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>
285
286## Configuration
287
288Crush runs great with no configuration. That said, if you do need or want to
289customize Crush, configuration can be added either local to the project itself,
290or globally, with the following priority:
291
2921. `.crush.json`
2932. `crush.json`
2943. `$HOME/.config/crush/crush.json`
295
296Configuration itself is stored as a JSON object:
297
298```json
299{
300  "this-setting": { "this": "that" },
301  "that-setting": ["ceci", "cela"]
302}
303```
304
305As an additional note, Crush also stores ephemeral data, such as application state, in one additional location:
306
307```bash
308# Unix
309$HOME/.local/share/crush/crush.json
310
311# Windows
312%LOCALAPPDATA%\crush\crush.json
313```
314
315> [!TIP]
316> You can override the user and data config locations by setting:
317> * `CRUSH_GLOBAL_CONFIG`
318> * `CRUSH_GLOBAL_DATA`
319
320### LSPs
321
322Crush can use LSPs for additional context to help inform its decisions, just
323like you would. LSPs can be added manually like so:
324
325```json
326{
327  "$schema": "https://charm.land/crush.json",
328  "lsp": {
329    "go": {
330      "command": "gopls",
331      "env": {
332        "GOTOOLCHAIN": "go1.24.5"
333      }
334    },
335    "typescript": {
336      "command": "typescript-language-server",
337      "args": ["--stdio"]
338    },
339    "nix": {
340      "command": "nil"
341    }
342  }
343}
344```
345
346### MCPs
347
348Crush also supports Model Context Protocol (MCP) servers through three
349transport types: `stdio` for command-line servers, `http` for HTTP endpoints,
350and `sse` for Server-Sent Events. Environment variable expansion is supported
351using `$(echo $VAR)` syntax.
352
353```json
354{
355  "$schema": "https://charm.land/crush.json",
356  "mcp": {
357    "filesystem": {
358      "type": "stdio",
359      "command": "node",
360      "args": ["/path/to/mcp-server.js"],
361      "timeout": 120,
362      "disabled": false,
363      "disabled_tools": ["some-tool-name"],
364      "env": {
365        "NODE_ENV": "production"
366      }
367    },
368    "github": {
369      "type": "http",
370      "url": "https://api.githubcopilot.com/mcp/",
371      "timeout": 120,
372      "disabled": false,
373      "disabled_tools": ["create_issue", "create_pull_request"],
374      "headers": {
375        "Authorization": "Bearer $GH_PAT"
376      }
377    },
378    "streaming-service": {
379      "type": "sse",
380      "url": "https://example.com/mcp/sse",
381      "timeout": 120,
382      "disabled": false,
383      "headers": {
384        "API-Key": "$(echo $API_KEY)"
385      }
386    }
387  }
388}
389```
390
391### Memory files
392
393Crush automatically includes two files for cross-project instructions.
394
395- `~/.config/crush/CRUSH.md`: Crush-specific rules that would confuse other
396  agentic coding tools. If you only use Crush, this is the only one you need to
397  edit.
398- `~/.config/AGENTS.md`: generic instructions that other coding tools might
399  read. Avoid referring to Crush-specific tools or workflows here.
400
401You can customize these paths using the `memory_paths` option in your
402configuration:
403
404```jsonc
405{
406  "$schema": "https://charm.land/crush.json",
407  "options": {
408    "memory_paths": [
409      "~/path/to/custom/memory/file.md",
410      "/full/path/to/folder/of/files/" // recursively load all .md files in folder
411    ]
412  }
413}
414```
415
416### Ignoring Files
417
418Crush respects `.gitignore` files by default, but you can also create a
419`.crushignore` file to specify additional files and directories that Crush
420should ignore. This is useful for excluding files that you want in version
421control but don't want Crush to consider when providing context.
422
423The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
424in the root of your project or in subdirectories.
425
426### Allowing Tools
427
428By default, Crush will ask you for permission before running tool calls. If
429you'd like, you can allow tools to be executed without prompting you for
430permissions. Use this with care.
431
432```json
433{
434  "$schema": "https://charm.land/crush.json",
435  "permissions": {
436    "allowed_tools": [
437      "view",
438      "ls",
439      "grep",
440      "edit",
441      "mcp_context7_get-library-doc"
442    ]
443  }
444}
445```
446
447You can also skip all permission prompts entirely by running Crush with the
448`--yolo` flag. Be very, very careful with this feature.
449
450### Disabling Built-In Tools
451
452If you'd like to prevent Crush from using certain built-in tools entirely, you
453can disable them via the `options.disabled_tools` list. Disabled tools are
454completely hidden from the agent.
455
456```json
457{
458  "$schema": "https://charm.land/crush.json",
459  "options": {
460    "disabled_tools": [
461      "bash",
462      "sourcegraph"
463    ]
464  }
465}
466```
467
468To disable tools from MCP servers, see the [MCP config section](#mcps).
469
470### Agent Skills
471
472Crush supports the [Agent Skills](https://agentskills.io) open standard for
473extending agent capabilities with reusable skill packages. Skills are folders
474containing a `SKILL.md` file with instructions that Crush can discover and
475activate on demand.
476
477Skills are discovered from:
478
479- `~/.config/crush/skills/` on Unix (default, can be overridden with `CRUSH_SKILLS_DIR`)
480- `%LOCALAPPDATA%\crush\skills\` on Windows (default, can be overridden with `CRUSH_SKILLS_DIR`)
481- Additional paths configured via `options.skills_paths`
482
483```jsonc
484{
485  "$schema": "https://charm.land/crush.json",
486  "options": {
487    "skills_paths": [
488      "~/.config/crush/skills", // Windows: "%LOCALAPPDATA%\\crush\\skills",
489      "./project-skills"
490    ]
491  }
492}
493```
494
495You can get started with example skills from [anthropics/skills](https://github.com/anthropics/skills):
496
497```bash
498# Unix
499mkdir -p ~/.config/crush/skills
500cd ~/.config/crush/skills
501git clone https://github.com/anthropics/skills.git _temp
502mv _temp/skills/* . && rm -rf _temp
503```
504
505```powershell
506# Windows (PowerShell)
507mkdir -Force "$env:LOCALAPPDATA\crush\skills"
508cd "$env:LOCALAPPDATA\crush\skills"
509git clone https://github.com/anthropics/skills.git _temp
510mv _temp/skills/* . ; rm -r -force _temp
511```
512
513### Desktop notifications
514
515Crush sends desktop notifications when a tool call requires permission and when
516the agent finishes its turn. They're only sent when the terminal window isn't
517focused _and_ your terminal supports reporting the focus state.
518
519```jsonc
520{
521  "$schema": "https://charm.land/crush.json",
522  "options": {
523    "disable_notifications": false // default
524  }
525}
526```
527
528To disable desktop notifications, set `disable_notifications` to `true` in your
529configuration. On macOS, notifications currently lack icons due to platform
530limitations.
531
532### Initialization
533
534When you initialize a project, Crush analyzes your codebase and creates
535a context file that helps it work more effectively in future sessions.
536By default, this file is named `AGENTS.md`, but you can customize the
537name and location with the `initialize_as` option:
538
539```json
540{
541  "$schema": "https://charm.land/crush.json",
542  "options": {
543    "initialize_as": "AGENTS.md"
544  }
545}
546```
547
548This is useful if you prefer a different naming convention or want to
549place the file in a specific directory (e.g., `CRUSH.md` or
550`docs/LLMs.md`). Crush will fill the file with project-specific context
551like build commands, code patterns, and conventions it discovered during
552initialization.
553
554### Attribution Settings
555
556By default, Crush adds attribution information to Git commits and pull requests
557it creates. You can customize this behavior with the `attribution` option:
558
559```json
560{
561  "$schema": "https://charm.land/crush.json",
562  "options": {
563    "attribution": {
564      "trailer_style": "co-authored-by",
565      "generated_with": true
566    }
567  }
568}
569```
570
571- `trailer_style`: Controls the attribution trailer added to commit messages
572  (default: `assisted-by`)
573	- `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
574	  (includes the model name)
575	- `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
576	- `none`: No attribution trailer
577- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
578  commit messages and PR descriptions
579
580### Custom Providers
581
582Crush supports custom provider configurations for both OpenAI-compatible and
583Anthropic-compatible APIs.
584
585> [!NOTE]
586> Note that we support two "types" for OpenAI. Make sure to choose the right one
587> to ensure the best experience!
588> * `openai` should be used when proxying or routing requests through OpenAI.
589> * `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
590
591#### OpenAI-Compatible APIs
592
593Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
594API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
595
596```json
597{
598  "$schema": "https://charm.land/crush.json",
599  "providers": {
600    "deepseek": {
601      "type": "openai-compat",
602      "base_url": "https://api.deepseek.com/v1",
603      "api_key": "$DEEPSEEK_API_KEY",
604      "models": [
605        {
606          "id": "deepseek-chat",
607          "name": "Deepseek V3",
608          "cost_per_1m_in": 0.27,
609          "cost_per_1m_out": 1.1,
610          "cost_per_1m_in_cached": 0.07,
611          "cost_per_1m_out_cached": 1.1,
612          "context_window": 64000,
613          "default_max_tokens": 5000
614        }
615      ]
616    }
617  }
618}
619```
620
621#### Anthropic-Compatible APIs
622
623Custom Anthropic-compatible providers follow this format:
624
625```json
626{
627  "$schema": "https://charm.land/crush.json",
628  "providers": {
629    "custom-anthropic": {
630      "type": "anthropic",
631      "base_url": "https://api.anthropic.com/v1",
632      "api_key": "$ANTHROPIC_API_KEY",
633      "extra_headers": {
634        "anthropic-version": "2023-06-01"
635      },
636      "models": [
637        {
638          "id": "claude-sonnet-4-20250514",
639          "name": "Claude Sonnet 4",
640          "cost_per_1m_in": 3,
641          "cost_per_1m_out": 15,
642          "cost_per_1m_in_cached": 3.75,
643          "cost_per_1m_out_cached": 0.3,
644          "context_window": 200000,
645          "default_max_tokens": 50000,
646          "can_reason": true,
647          "supports_attachments": true
648        }
649      ]
650    }
651  }
652}
653```
654
655### Amazon Bedrock
656
657Crush currently supports running Anthropic models through Bedrock, with caching disabled.
658
659- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
660- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
661- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
662- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
663
664### Vertex AI Platform
665
666Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
667
668```bash
669gcloud auth application-default login
670```
671
672To add specific models to the configuration, configure as such:
673
674```json
675{
676  "$schema": "https://charm.land/crush.json",
677  "providers": {
678    "vertexai": {
679      "models": [
680        {
681          "id": "claude-sonnet-4@20250514",
682          "name": "VertexAI Sonnet 4",
683          "cost_per_1m_in": 3,
684          "cost_per_1m_out": 15,
685          "cost_per_1m_in_cached": 3.75,
686          "cost_per_1m_out_cached": 0.3,
687          "context_window": 200000,
688          "default_max_tokens": 50000,
689          "can_reason": true,
690          "supports_attachments": true
691        }
692      ]
693    }
694  }
695}
696```
697
698### Local Models
699
700Local models can also be configured via OpenAI-compatible API. Here are two common examples:
701
702#### Ollama
703
704```json
705{
706  "providers": {
707    "ollama": {
708      "name": "Ollama",
709      "base_url": "http://localhost:11434/v1/",
710      "type": "openai-compat",
711      "models": [
712        {
713          "name": "Qwen 3 30B",
714          "id": "qwen3:30b",
715          "context_window": 256000,
716          "default_max_tokens": 20000
717        }
718      ]
719    }
720  }
721}
722```
723
724#### LM Studio
725
726```json
727{
728  "providers": {
729    "lmstudio": {
730      "name": "LM Studio",
731      "base_url": "http://localhost:1234/v1/",
732      "type": "openai-compat",
733      "models": [
734        {
735          "name": "Qwen 3 30B",
736          "id": "qwen/qwen3-30b-a3b-2507",
737          "context_window": 256000,
738          "default_max_tokens": 20000
739        }
740      ]
741    }
742  }
743}
744```
745
746## Logging
747
748Sometimes you need to look at logs. Luckily, Crush logs all sorts of
749stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
750
751The CLI also contains some helper commands to make perusing recent logs easier:
752
753```bash
754# Print the last 1000 lines
755crush logs
756
757# Print the last 500 lines
758crush logs --tail 500
759
760# Follow logs in real time
761crush logs --follow
762```
763
764Want more logging? Run `crush` with the `--debug` flag, or enable it in the
765config:
766
767```json
768{
769  "$schema": "https://charm.land/crush.json",
770  "options": {
771    "debug": true,
772    "debug_lsp": true
773  }
774}
775```
776
777## Provider Auto-Updates
778
779By default, Crush automatically checks for the latest and greatest list of
780providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
781the open source Crush provider database. This means that when new providers and
782models are available, or when model metadata changes, Crush automatically
783updates your local configuration.
784
785### Disabling automatic provider updates
786
787For those with restricted internet access, or those who prefer to work in
788air-gapped environments, this might not be want you want, and this feature can
789be disabled.
790
791To disable automatic provider updates, set `disable_provider_auto_update` into
792your `crush.json` config:
793
794```json
795{
796  "$schema": "https://charm.land/crush.json",
797  "options": {
798    "disable_provider_auto_update": true
799  }
800}
801```
802
803Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
804
805```bash
806export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
807```
808
809### Manually updating providers
810
811Manually updating providers is possible with the `crush update-providers`
812command:
813
814```bash
815# Update providers remotely from Catwalk.
816crush update-providers
817
818# Update providers from a custom Catwalk base URL.
819crush update-providers https://example.com/
820
821# Update providers from a local file.
822crush update-providers /path/to/local-providers.json
823
824# Reset providers to the embedded version, embedded at crush at build time.
825crush update-providers embedded
826
827# For more info:
828crush update-providers --help
829```
830
831## Metrics
832
833Crush records pseudonymous usage metrics (tied to a device-specific hash),
834which maintainers rely on to inform development and support priorities. The
835metrics include solely usage metadata; prompts and responses are NEVER
836collected.
837
838Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
839and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
840
841You can opt out of metrics collection at any time by setting the environment
842variable by setting the following in your environment:
843
844```bash
845export CRUSH_DISABLE_METRICS=1
846```
847
848Or by setting the following in your config:
849
850```json
851{
852  "options": {
853    "disable_metrics": true
854  }
855}
856```
857
858Crush also respects the `DO_NOT_TRACK` convention which can be enabled via
859`export DO_NOT_TRACK=1`.
860
861## Contributing
862
863See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
864
865## Whatcha think?
866
867We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
868
869- [Twitter](https://twitter.com/charmcli)
870- [Slack](https://charm.land/slack)
871- [Discord][discord]
872- [The Fediverse](https://mastodon.social/@charmcli)
873- [Bluesky](https://bsky.app/profile/charm.land)
874
875[discord]: https://charm.land/discord
876
877## License
878
879[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
880
881---
882
883Part of [Charm](https://charm.land).
884
885<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
886
887<!--prettier-ignore-->
888Charm热爱开源 • Charm loves open source