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| `AVIAN_API_KEY` | Avian |
258| `OPENCODE_API_KEY` | OpenCode Zen & Go |
259| `VERTEXAI_PROJECT` | Google Cloud VertexAI (Gemini) |
260| `VERTEXAI_LOCATION` | Google Cloud VertexAI (Gemini) |
261| `AWS_ACCESS_KEY_ID` | Amazon Bedrock (Claude) |
262| `AWS_SECRET_ACCESS_KEY` | Amazon Bedrock (Claude) |
263| `AWS_REGION` | Amazon Bedrock (Claude) |
264| `AWS_PROFILE` | Amazon Bedrock (Custom Profile) |
265| `AWS_BEARER_TOKEN_BEDROCK` | Amazon Bedrock |
266| `AZURE_OPENAI_API_ENDPOINT` | Azure OpenAI models |
267| `AZURE_OPENAI_API_KEY` | Azure OpenAI models (optional when using Entra ID) |
268| `AZURE_OPENAI_API_VERSION` | Azure OpenAI models |
269
270### Subscriptions
271
272If you prefer subscription-based usage, here are some plans that work well in
273Crush:
274
275- [Synthetic](https://synthetic.new/pricing)
276- [GLM Coding Plan](https://z.ai/subscribe)
277- [Kimi Code](https://www.kimi.com/membership/pricing)
278- [MiniMax Coding Plan](https://platform.minimax.io/subscribe/coding-plan)
279
280### By the Way
281
282Is there a provider you’d like to see in Crush? Is there an existing model that needs an update?
283
284Crush’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.
285
286<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>
287
288## Configuration
289
290> [!TIP]
291> Crush ships with a builtin `crush-config` skill for configuring itself. In
292> many cases you can simply ask Crush to configure itself.
293
294Crush runs great with no configuration. That said, if you do need or want to
295customize Crush, configuration can be added either local to the project itself,
296or globally, with the following priority:
297
2981. `.crush.json`
2992. `crush.json`
3003. `$HOME/.config/crush/crush.json`
301
302Configuration itself is stored as a JSON object:
303
304```json
305{
306 "this-setting": { "this": "that" },
307 "that-setting": ["ceci", "cela"]
308}
309```
310
311As an additional note, Crush also stores ephemeral data, such as application
312state, in one additional location:
313
314```bash
315# Unix
316$HOME/.local/share/crush/crush.json
317
318# Windows
319%LOCALAPPDATA%\crush\crush.json
320```
321
322> [!TIP]
323> You can override the user and data config locations by setting:
324>
325> - `CRUSH_GLOBAL_CONFIG`
326> - `CRUSH_GLOBAL_DATA`
327
328### LSPs
329
330Crush can use LSPs for additional context to help inform its decisions, just
331like you would. LSPs can be added manually like so:
332
333```json
334{
335 "$schema": "https://charm.land/crush.json",
336 "lsp": {
337 "go": {
338 "command": "gopls",
339 "env": {
340 "GOTOOLCHAIN": "go1.24.5"
341 }
342 },
343 "typescript": {
344 "command": "typescript-language-server",
345 "args": ["--stdio"]
346 },
347 "nix": {
348 "command": "nil"
349 }
350 }
351}
352```
353
354### MCPs
355
356Crush also supports Model Context Protocol (MCP) servers through three
357transport types: `stdio` for command-line servers, `http` for HTTP endpoints,
358and `sse` for Server-Sent Events. Environment variable expansion is supported
359using `$(echo $VAR)` syntax.
360
361```json
362{
363 "$schema": "https://charm.land/crush.json",
364 "mcp": {
365 "filesystem": {
366 "type": "stdio",
367 "command": "node",
368 "args": ["/path/to/mcp-server.js"],
369 "timeout": 120,
370 "disabled": false,
371 "disabled_tools": ["some-tool-name"],
372 "env": {
373 "NODE_ENV": "production"
374 }
375 },
376 "github": {
377 "type": "http",
378 "url": "https://api.githubcopilot.com/mcp/",
379 "timeout": 120,
380 "disabled": false,
381 "disabled_tools": ["create_issue", "create_pull_request"],
382 "headers": {
383 "Authorization": "Bearer $GH_PAT"
384 }
385 },
386 "streaming-service": {
387 "type": "sse",
388 "url": "https://example.com/mcp/sse",
389 "timeout": 120,
390 "disabled": false,
391 "headers": {
392 "API-Key": "$(echo $API_KEY)"
393 }
394 }
395 }
396}
397```
398
399### Global context files
400
401Crush automatically includes two files for cross-project instructions.
402
403- `~/.config/crush/CRUSH.md`: Crush-specific rules that would confuse other
404 agentic coding tools. If you only use Crush, this is the only one you need to
405 edit.
406- `~/.config/AGENTS.md`: generic instructions that other coding tools might
407 read. Avoid referring to Crush-specific features or workflows here. You
408 probably only care about this if you use multiple agentic coding tools and
409 want to share instructions between them.
410
411You can customize these paths using the `global_context_paths` option in your
412configuration:
413
414```jsonc
415{
416 "$schema": "https://charm.land/crush.json",
417 "options": {
418 "global_context_paths": [
419 "~/path/to/custom/context/file.md",
420 "/full/path/to/folder/of/files/" // recursively load all .md files in folder
421 ]
422 }
423}
424```
425
426### Ignoring Files
427
428Crush respects `.gitignore` files by default, but you can also create a
429`.crushignore` file to specify additional files and directories that Crush
430should ignore. This is useful for excluding files that you want in version
431control but don't want Crush to consider when providing context.
432
433The `.crushignore` file uses the same syntax as `.gitignore` and can be placed
434in the root of your project or in subdirectories.
435
436### Allowing Tools
437
438By default, Crush will ask you for permission before running tool calls. If
439you'd like, you can allow tools to be executed without prompting you for
440permissions. Use this with care.
441
442```json
443{
444 "$schema": "https://charm.land/crush.json",
445 "permissions": {
446 "allowed_tools": [
447 "view",
448 "ls",
449 "grep",
450 "edit",
451 "mcp_context7_get-library-doc"
452 ]
453 }
454}
455```
456
457You can also skip all permission prompts entirely by running Crush with the
458`--yolo` flag. Be very, very careful with this feature.
459
460### Disabling Built-In Tools
461
462If you'd like to prevent Crush from using certain built-in tools entirely, you
463can disable them via the `options.disabled_tools` list. Disabled tools are
464completely hidden from the agent.
465
466```json
467{
468 "$schema": "https://charm.land/crush.json",
469 "options": {
470 "disabled_tools": ["bash", "sourcegraph"]
471 }
472}
473```
474
475To disable tools from MCP servers, see the [MCP config section](#mcps).
476
477### Disabling Skills
478
479If you'd like to prevent Crush from using certain skills entirely, you can
480disable them via the `options.disabled_skills` list. Disabled skills are hidden
481from the agent, including builtin skills and skills discovered from disk.
482
483```json
484{
485 "$schema": "https://charm.land/crush.json",
486 "options": {
487 "disabled_skills": ["crush-config"]
488 }
489}
490```
491
492### Agent Skills
493
494Crush supports the [Agent Skills](https://agentskills.io) open standard for
495extending agent capabilities with reusable skill packages. Skills are folders
496containing a `SKILL.md` file with instructions that Crush can discover and
497activate on demand.
498
499The global paths we looks for skills are:
500
501* `$CRUSH_SKILLS_DIR`
502* `$XDG_CONFIG_HOME/agents/skills` or `~/.config/agents/skills/`
503* `$XDG_CONFIG_HOME/crush/skills` or `~/.config/crush/skills/`
504* On Windows, we _also_ look at
505 * `%LOCALAPPDATA%\agents\skills\` or `%USERPROFILE%\AppData\Local\agents\skills\`
506 * `%LOCALAPPDATA%\crush\skills\` or `%USERPROFILE%\AppData\Local\crush\skills\`
507* Additional paths configured via `options.skills_paths`
508
509On top of that, we _also_ load skills in your project from the following
510relative paths:
511
512* `.agents/skills`
513* `.crush/skills`
514* `.claude/skills`
515* `.cursor/skills`
516
517```jsonc
518{
519 "$schema": "https://charm.land/crush.json",
520 "options": {
521 "skills_paths": [
522 "~/.config/crush/skills", // Windows: "%LOCALAPPDATA%\\crush\\skills",
523 "./project-skills",
524 ],
525 },
526}
527```
528
529You can get started with example skills from [anthropics/skills](https://github.com/anthropics/skills):
530
531```bash
532# Unix
533mkdir -p ~/.config/crush/skills
534cd ~/.config/crush/skills
535git clone https://github.com/anthropics/skills.git _temp
536mv _temp/skills/* . && rm -rf _temp
537```
538
539```powershell
540# Windows (PowerShell)
541mkdir -Force "$env:LOCALAPPDATA\crush\skills"
542cd "$env:LOCALAPPDATA\crush\skills"
543git clone https://github.com/anthropics/skills.git _temp
544mv _temp/skills/* . ; rm -r -force _temp
545```
546
547### Desktop notifications
548
549Crush sends desktop notifications when a tool call requires permission and when
550the agent finishes its turn. They're only sent when the terminal window isn't
551focused _and_ your terminal supports reporting the focus state.
552
553```jsonc
554{
555 "$schema": "https://charm.land/crush.json",
556 "options": {
557 "disable_notifications": false, // default
558 },
559}
560```
561
562To disable desktop notifications, set `disable_notifications` to `true` in your
563configuration. On macOS, notifications currently lack icons due to platform
564limitations.
565
566### Initialization
567
568When you initialize a project, Crush analyzes your codebase and creates
569a context file that helps it work more effectively in future sessions.
570By default, this file is named `AGENTS.md`, but you can customize the
571name and location with the `initialize_as` option:
572
573```json
574{
575 "$schema": "https://charm.land/crush.json",
576 "options": {
577 "initialize_as": "AGENTS.md"
578 }
579}
580```
581
582This is useful if you prefer a different naming convention or want to
583place the file in a specific directory (e.g., `CRUSH.md` or
584`docs/LLMs.md`). Crush will fill the file with project-specific context
585like build commands, code patterns, and conventions it discovered during
586initialization.
587
588### Attribution Settings
589
590By default, Crush adds attribution information to Git commits and pull requests
591it creates. You can customize this behavior with the `attribution` option:
592
593```json
594{
595 "$schema": "https://charm.land/crush.json",
596 "options": {
597 "attribution": {
598 "trailer_style": "co-authored-by",
599 "generated_with": true
600 }
601 }
602}
603```
604
605- `trailer_style`: Controls the attribution trailer added to commit messages
606 (default: `assisted-by`)
607 - `assisted-by`: Adds `Assisted-by: [Model Name] via Crush <crush@charm.land>`
608 (includes the model name)
609 - `co-authored-by`: Adds `Co-Authored-By: Crush <crush@charm.land>`
610 - `none`: No attribution trailer
611- `generated_with`: When true (default), adds `💘 Generated with Crush` line to
612 commit messages and PR descriptions
613
614### Custom Providers
615
616Crush supports custom provider configurations for both OpenAI-compatible and
617Anthropic-compatible APIs.
618
619> [!NOTE]
620> Note that we support two "types" for OpenAI. Make sure to choose the right one
621> to ensure the best experience!
622>
623> - `openai` should be used when proxying or routing requests through OpenAI.
624> - `openai-compat` should be used when using non-OpenAI providers that have OpenAI-compatible APIs.
625
626#### OpenAI-Compatible APIs
627
628Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
629API. Don't forget to set `DEEPSEEK_API_KEY` in your environment.
630
631```json
632{
633 "$schema": "https://charm.land/crush.json",
634 "providers": {
635 "deepseek": {
636 "type": "openai-compat",
637 "base_url": "https://api.deepseek.com/v1",
638 "api_key": "$DEEPSEEK_API_KEY",
639 "models": [
640 {
641 "id": "deepseek-chat",
642 "name": "Deepseek V3",
643 "cost_per_1m_in": 0.27,
644 "cost_per_1m_out": 1.1,
645 "cost_per_1m_in_cached": 0.07,
646 "cost_per_1m_out_cached": 1.1,
647 "context_window": 64000,
648 "default_max_tokens": 5000
649 }
650 ]
651 }
652 }
653}
654```
655
656#### Anthropic-Compatible APIs
657
658Custom Anthropic-compatible providers follow this format:
659
660```json
661{
662 "$schema": "https://charm.land/crush.json",
663 "providers": {
664 "custom-anthropic": {
665 "type": "anthropic",
666 "base_url": "https://api.anthropic.com/v1",
667 "api_key": "$ANTHROPIC_API_KEY",
668 "extra_headers": {
669 "anthropic-version": "2023-06-01"
670 },
671 "models": [
672 {
673 "id": "claude-sonnet-4-20250514",
674 "name": "Claude Sonnet 4",
675 "cost_per_1m_in": 3,
676 "cost_per_1m_out": 15,
677 "cost_per_1m_in_cached": 3.75,
678 "cost_per_1m_out_cached": 0.3,
679 "context_window": 200000,
680 "default_max_tokens": 50000,
681 "can_reason": true,
682 "supports_attachments": true
683 }
684 ]
685 }
686 }
687}
688```
689
690### Amazon Bedrock
691
692Crush currently supports running Anthropic models through Bedrock, with caching disabled.
693
694- A Bedrock provider will appear once you have AWS configured, i.e. `aws configure`
695- Crush also expects the `AWS_REGION` or `AWS_DEFAULT_REGION` to be set
696- To use a specific AWS profile set `AWS_PROFILE` in your environment, i.e. `AWS_PROFILE=myprofile crush`
697- Alternatively to `aws configure`, you can also just set `AWS_BEARER_TOKEN_BEDROCK`
698
699### Vertex AI Platform
700
701Vertex AI will appear in the list of available providers when `VERTEXAI_PROJECT` and `VERTEXAI_LOCATION` are set. You will also need to be authenticated:
702
703```bash
704gcloud auth application-default login
705```
706
707To add specific models to the configuration, configure as such:
708
709```json
710{
711 "$schema": "https://charm.land/crush.json",
712 "providers": {
713 "vertexai": {
714 "models": [
715 {
716 "id": "claude-sonnet-4@20250514",
717 "name": "VertexAI Sonnet 4",
718 "cost_per_1m_in": 3,
719 "cost_per_1m_out": 15,
720 "cost_per_1m_in_cached": 3.75,
721 "cost_per_1m_out_cached": 0.3,
722 "context_window": 200000,
723 "default_max_tokens": 50000,
724 "can_reason": true,
725 "supports_attachments": true
726 }
727 ]
728 }
729 }
730}
731```
732
733### Local Models
734
735Local models can also be configured via OpenAI-compatible API. Here are two common examples:
736
737#### Ollama
738
739```json
740{
741 "providers": {
742 "ollama": {
743 "name": "Ollama",
744 "base_url": "http://localhost:11434/v1/",
745 "type": "openai-compat",
746 "models": [
747 {
748 "name": "Qwen 3 30B",
749 "id": "qwen3:30b",
750 "context_window": 256000,
751 "default_max_tokens": 20000
752 }
753 ]
754 }
755 }
756}
757```
758
759#### LM Studio
760
761```json
762{
763 "providers": {
764 "lmstudio": {
765 "name": "LM Studio",
766 "base_url": "http://localhost:1234/v1/",
767 "type": "openai-compat",
768 "models": [
769 {
770 "name": "Qwen 3 30B",
771 "id": "qwen/qwen3-30b-a3b-2507",
772 "context_window": 256000,
773 "default_max_tokens": 20000
774 }
775 ]
776 }
777 }
778}
779```
780
781## Logging
782
783Sometimes you need to look at logs. Luckily, Crush logs all sorts of
784stuff. Logs are stored in `./.crush/logs/crush.log` relative to the project.
785
786The CLI also contains some helper commands to make perusing recent logs easier:
787
788```bash
789# Print the last 1000 lines
790crush logs
791
792# Print the last 500 lines
793crush logs --tail 500
794
795# Follow logs in real time
796crush logs --follow
797```
798
799Want more logging? Run `crush` with the `--debug` flag, or enable it in the
800config:
801
802```json
803{
804 "$schema": "https://charm.land/crush.json",
805 "options": {
806 "debug": true,
807 "debug_lsp": true
808 }
809}
810```
811
812## Provider Auto-Updates
813
814By default, Crush automatically checks for the latest and greatest list of
815providers and models from [Catwalk](https://github.com/charmbracelet/catwalk),
816the open source Crush provider database. This means that when new providers and
817models are available, or when model metadata changes, Crush automatically
818updates your local configuration.
819
820### Disabling automatic provider updates
821
822For those with restricted internet access, or those who prefer to work in
823air-gapped environments, this might not be want you want, and this feature can
824be disabled.
825
826To disable automatic provider updates, set `disable_provider_auto_update` into
827your `crush.json` config:
828
829```json
830{
831 "$schema": "https://charm.land/crush.json",
832 "options": {
833 "disable_provider_auto_update": true
834 }
835}
836```
837
838Or set the `CRUSH_DISABLE_PROVIDER_AUTO_UPDATE` environment variable:
839
840```bash
841export CRUSH_DISABLE_PROVIDER_AUTO_UPDATE=1
842```
843
844### Manually updating providers
845
846Manually updating providers is possible with the `crush update-providers`
847command:
848
849```bash
850# Update providers remotely from Catwalk.
851crush update-providers
852
853# Update providers from a custom Catwalk base URL.
854crush update-providers https://example.com/
855
856# Update providers from a local file.
857crush update-providers /path/to/local-providers.json
858
859# Reset providers to the embedded version, embedded at crush at build time.
860crush update-providers embedded
861
862# For more info:
863crush update-providers --help
864```
865
866## Metrics
867
868Crush records pseudonymous usage metrics (tied to a device-specific hash),
869which maintainers rely on to inform development and support priorities. The
870metrics include solely usage metadata; prompts and responses are NEVER
871collected.
872
873Details on exactly what’s collected are in the source code ([here](https://github.com/charmbracelet/crush/tree/main/internal/event)
874and [here](https://github.com/charmbracelet/crush/blob/main/internal/llm/agent/event.go)).
875
876You can opt out of metrics collection at any time by setting the environment
877variable by setting the following in your environment:
878
879```bash
880export CRUSH_DISABLE_METRICS=1
881```
882
883Or by setting the following in your config:
884
885```json
886{
887 "options": {
888 "disable_metrics": true
889 }
890}
891```
892
893Crush also respects the `DO_NOT_TRACK` convention which can be enabled via
894`export DO_NOT_TRACK=1`.
895
896## Q&A
897
898### Why is clipboard copy and paste not working?
899
900Installing an extra tool might be needed on Unix-like environments.
901
902| Environment | Tool |
903| ------------------- | ------------------------ |
904| Windows | Native support |
905| macOS | Native support |
906| Linux/BSD + Wayland | `wl-copy` and `wl-paste` |
907| Linux/BSD + X11 | `xclip` or `xsel` |
908
909## Contributing
910
911See the [contributing guide](https://github.com/charmbracelet/crush?tab=contributing-ov-file#contributing).
912
913## Whatcha think?
914
915We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
916
917- [Twitter](https://twitter.com/charmcli)
918- [Slack](https://charm.land/slack)
919- [Discord][discord]
920- [The Fediverse](https://mastodon.social/@charmcli)
921- [Bluesky](https://bsky.app/profile/charm.land)
922
923[discord]: https://charm.land/discord
924
925## License
926
927[FSL-1.1-MIT](https://github.com/charmbracelet/crush/raw/main/LICENSE.md)
928
929---
930
931Part of [Charm](https://charm.land).
932
933<a href="https://charm.land/"><img alt="The Charm logo" width="400" src="https://stuff.charm.sh/charm-banner-next.jpg" /></a>
934
935<!--prettier-ignore-->
936Charm热爱开源 • Charm loves open source