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