SKILL.md--- name: crush-config description: Use when the user needs help configuring Crush — writing crushrc (the Bash config format) or crush.json, setting up providers, models, LSPs, MCP servers, hooks, skills, permissions, or changing Crush behavior. --- # Crush Configuration Crush supports two config formats: - **`crushrc`** — a Bash script that builds config by calling Crush builtins. **Preferred.** Because it is real Bash you get includes, secrets, conditionals, and variables for free. - **`crush.json`** — static JSON. Fully supported; see [Legacy JSON format](#legacy-json-format). Both are discovered together and deep-merged. Priority (highest to lowest): 1. `.crushrc` / `crushrc` / `.crush.json` / `crush.json` (project-local, closer-to-cwd wins; Windows uses `.\.crushrc` / `.\crushrc`) 2. `$XDG_CONFIG_HOME/crush/crushrc` or `~/.config/crush/crushrc` (`%XDG_CONFIG_HOME%\crush\crushrc` or `%USERPROFILE%\.config\crush\crushrc` on Windows) Data directories (`~/.local/share/crush` and `%LOCALAPPDATA%\crush`) contain machine-owned JSON state only; Crush does not discover or execute a `crushrc` from those locations. If a directory has both `crushrc` and `crush.json`, they merge (`crushrc` wins on conflicts) and Crush logs a warning. ## crushrc at a glance A `crushrc` is a plain Bash script executed at load time with the same embedded shell the `bash` tool uses. It builds config by calling builtins (`provider`, `model`, `mcp`, `lsp`, `hook`, `permissions`, `option`). Statements run top to bottom; later statements win, and `remove`/`reset` operate on anything defined earlier or pulled in via `source`. ```bash #!/usr/bin/env bash # Includes and secrets are just Bash. source ~/.config/crush/shared.sh provider add anthropic --api-key "$ANTHROPIC_API_KEY" model large anthropic/claude-sonnet-4-20250514 --max-tokens 16384 model small anthropic/claude-haiku-4-20250514 option skill-path ./skills permissions allow view ls grep edit ``` Values are ordinary Bash — quote and expand normally (`"$VAR"`, `$(cmd)`, `${VAR:?required}`). A failing `$(command)` aborts the load. `CRUSH_VERSION` is exported into the script so you can feature-detect the running Crush (it is the literal `devel` for local builds): ```bash [[ "$CRUSH_VERSION" != devel ]] && lsp add gopls --command gopls ``` ## Commands All entity commands are verb-first. `remove` accepts `rm` as an alias. Booleans accept `true/false/1/0/yes/no`, case-insensitive. ### providers ```bash provider add <id> [flags] # define/update; repeated calls merge provider remove <id> # alias: rm — removes the provider and its models ``` Flags: `--name`, `--type` (`completions`, `responses`, `messages`, or a local type like `ollama`, `lmstudio`, `llamacpp`; legacy values `openai`, `openai-compat`, `anthropic` are migrated automatically), `--api-key`, `--base-url`, `--disable BOOL`, `--flat-rate BOOL`, `--discover-models BOOL`, `--s