Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.
Documentation Index
Fetch the complete documentation index at: https://docs.llmrouter.app/llms.txt
Use this file to discover all available pages before exploring further.
Crush & LLM Router
Crush (or similar terminal-based AI agents) is a powerful CLI/TUI tool that handles code generation, debugging, and file operations directly inside your command line.Because terminal agents frequently read massive error logs, command outputs, and local files, they consume huge amounts of input tokens. By routing Crush through LLM Router, you automatically apply Middle-Out Context Compression to bloated terminal outputs and ensure your local .env secrets are Redacted before they are sent to third-party AI providers.
Important: When using LLM Router with custom CLI tools, you must configure
the base URL to point to https://api.llmrouter.app/v1 to ensure OpenAI SDK
compatibility.
Step 1: Installing Crush
If you haven’t installed Crush yet, select the appropriate installation method based on your system:
Homebrew (macOS/Linux)
NPM (Cross-Platform)
Arch Linux
Nix
brew install charmbracelet/tap/crush
bash npm install -g @charmland/crush
bash yay -S crush-bin
nix run github:numtide/nix-ai-tools#crush
Step 2: Modifying the Crush Configuration
To point Crush to LLM Router, you need to edit its local configuration file and add LLM Router as a custom provider.
1. Locate the Configuration File
Depending on your operating system, the crush.json configuration file can be found here:
~/.config/crush/crush.json
%USERPROFILE%\.config\crush\crush.json
2. Add LLM Router as a Provider
Open the crush.json file and add the LLM Router endpoint under your providers list. Make sure to replace sk-router-your-api-key with your actual LLM Router API key.
API Key Location: You can generate your LLM Router API Key in the
Dashboard. Your key is stored locally by
Crush and is never exposed.
Step 3: Launch Crush and Select Your Model
Run the crush command in your terminal to start the application:
crush
Open the command palette (usually ctrl+p) and choose “Switch Model”.
Because LLM Router acts as a universal gateway, you can type the name of any supported model, prefixed with the provider. For example:
anthropic/claude-3-5-sonnet (Best for heavy coding/refactoring)
openai/gpt-4o
deepseek/deepseek-chat (Highly cost-efficient)
router-auto (If you want LLM Router to dynamically pick the model based on your Tags)
Step 4: The LLM Router Advantage in the Terminal
Once configured, you can use Crush as normal to generate code, execute terminal commands, and debug.Because traffic is now flowing through LLM Router, you instantly gain:
Token Savings on Logs: If Crush runs npm run build and ingests 3,000 lines of terminal output, LLM Router will dynamically compress the repetitive middle sections, saving you up to 80% on API costs.
Zero-Trust Security: If Crush accidentally reads your .npmrc or AWS credentials from your local workspace, LLM Router’s PII engine will redact them into [TOKEN_REDACTED] before sending the context to Claude or GPT-4.
Resilience: If your primary AI provider experiences an outage, LLM Router will automatically fall back to your configured secondary provider without interrupting your CLI session.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LLM Router","description":"Comprehensive documentation for Saasio, the intelligent AI gateway. Reduce API costs and latency with smart prompt routing, context compression, and seamless model fallbacks.","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/llmrouter/fmzcB0C0hZ8TxqoJ/logo/llmr-light.svg?fit=max\u0026auto=format\u0026n=fmzcB0C0hZ8TxqoJ\u0026q=85\u0026s=97bc60d4ed101a355191a7baaebd8a1c","dark":"https://mintcdn.com/llmrouter/fmzcB0C0hZ8TxqoJ/logo/llmr-dark.svg?fit=max\u0026auto=format\u0026n=fmzcB0C0hZ8TxqoJ\u0026q=85\u0026s=340765a1ce35e8f74a12232225eb42f7"},"favicon":"https://mintcdn.com/llmrouter/DRv49vI19q9DHhUZ/favicon.ico?fit=max\u0026auto=format\u0026n=DRv49vI19q9DHhUZ\u0026q=85\u0026s=eba667155b546fa4c1e9f7876cd7e7ad","navbar":{"links":[{"href":"mailto:contact@llmrouter.app","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://llmrouter.app/dashboard"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"llms.txt","icon":"book-open-cover","href":"https://docs.llmrouter.app/llms.txt"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"llmrouter","hasAudioNarration":false,"actualSubdomain":"llmrouter","customDomains":["docs.llmrouter.app"],"gitSource":{"type":"github","owner":"ussef083","repo":"llm-router","deployBranch":"main","contentDirectory":"apps/docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae94af2d5a6abdcaff3bbca:success","clientVersion":"0.0.4344","searchFilterCounts":[{"language":"default","tag":"Guides","count":31},{"language":"default","tag":"AI tools","count":18},{"language":"default","tag":"API reference","count":9},{"language":"default","tag":"Getting started","count":9},{"language":"default","tag":"SDKs","count":4},{"language":"default","tag":"Chat","count":2},{"language":"default","tag":"Models","count":2},{"language":"default","tag":"API documentation","count":1},{"language":"default","tag":"Blog","count":1},{"language":"default","tag":"Embeddings","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"ai-tools/crush","slug":"/ai-tools/crush","pageMetadata":{"title":"Crush (CLI/TUI Agent)","description":"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.","href":"/ai-tools/crush"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,blockquote:`blockquote`,code:`code`,em:`em`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Tab,Tabs,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.hr,{}),`\n`,_jsxs(_components.blockquote,{children:[`\n`,_jsx(Heading,{level:`2`,id:`documentation-index`,children:`Documentation Index`}),`\n`,_jsxs(_components.p,{children:[`Fetch the complete documentation index at: `,_jsx(_components.a,{href:`https://docs.llmrouter.app/llms.txt`,children:`https://docs.llmrouter.app/llms.txt`}),`\nUse this file to discover all available pages before exploring further.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`1`,id:`crush-\u0026-llm-router`,children:`Crush \u0026 LLM Router`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.a,{href:`https://github.com/charmbracelet/crush`,children:`Crush`}),` (or similar terminal-based AI agents) is a powerful CLI/TUI tool that handles code generation, debugging, and file operations directly inside your command line.`]}),`\n`,_jsxs(_components.p,{children:[`Because terminal agents frequently read massive error logs, command outputs, and local files, they consume huge amounts of input tokens. By routing Crush through `,_jsx(_components.strong,{children:`LLM Router`}),`, you automatically apply `,_jsx(_components.strong,{children:`Middle-Out Context Compression`}),` to bloated terminal outputs and ensure your local `,_jsx(_components.code,{children:`.env`}),` secrets are `,_jsx(_components.strong,{children:`Redacted`}),` before they are sent to third-party AI providers.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Important:`}),` When using LLM Router with custom CLI tools, you must configure\nthe base URL to point to `,_jsx(_components.code,{children:`https://api.llmrouter.app/v1`}),` to ensure OpenAI SDK\ncompatibility.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-installing-crush`,children:`Step 1: Installing Crush`}),`\n`,_jsx(_components.p,{children:`If you haven’t installed Crush yet, select the appropriate installation method based on your system:`}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Homebrew (macOS/Linux)`,id:`homebrew-macos%2Flinux`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`brew`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` install charmbracelet/tap/crush`})]}),`\n`]})})})}),_jsx(Tab,{title:`NPM (Cross-Platform)`,id:`npm-cross-platform`,children:_jsx(_components.p,{children:_jsx(_components.code,{children:`bash npm install -g @charmland/crush `})})}),_jsx(Tab,{title:`Arch Linux`,id:`arch-linux`,children:_jsx(_components.code,{children:`bash yay -S crush-bin `})}),_jsx(Tab,{title:`Nix`,id:`nix`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nix run github:numtide/nix-ai-tools#crush`})}),`\n`]})})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-modifying-the-crush-configuration`,children:`Step 2: Modifying the Crush Configuration`}),`\n`,_jsx(_components.p,{children:`To point Crush to LLM Router, you need to edit its local configuration file and add LLM Router as a custom provider.`}),`\n`,_jsx(Heading,{level:`3`,id:`1-locate-the-configuration-file`,children:`1. Locate the Configuration File`}),`\n`,_jsxs(_components.p,{children:[`Depending on your operating system, the `,_jsx(_components.code,{children:`crush.json`}),` configuration file can be found here:`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`macOS/Linux`,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`~/.config/crush/crush.json`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Windows`,numberOfLines:`1`,language:`powershell`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`powershell`,children:_jsxs(_components.code,{language:`powershell`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`%`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`USERPROFILE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`%`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\\\\.config\\\\crush\\\\crush.json`})]}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`3`,id:`2-add-llm-router-as-a-provider`,children:`2. Add LLM Router as a Provider`}),`\n`,_jsxs(_components.p,{children:[`Open the `,_jsx(_components.code,{children:`crush.json`}),` file and add the LLM Router endpoint under your providers list. Make sure to replace `,_jsx(_components.code,{children:`sk-router-your-api-key`}),` with your actual LLM Router API key.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"providers\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"llmrouter\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"llmrouter\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"LLM Router\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"base_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.llmrouter.app/v1\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"api_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-router-your-api-key\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`API Key Location:`}),` You can generate your LLM Router API Key in the\n`,_jsx(_components.a,{href:`https://llmrouter.app/dashboard`,children:`Dashboard`}),`. Your key is stored locally by\nCrush and is never exposed.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-launch-crush-and-select-your-model`,children:`Step 3: Launch Crush and Select Your Model`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Run the `,_jsx(_components.code,{children:`crush`}),` command in your terminal to start the application:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`crush`})}),`\n`]})})}),`\n`,_jsxs(_components.ol,{start:`2`,children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Open the command palette (usually `,_jsx(_components.code,{children:`ctrl+p`}),`) and choose `,_jsx(_components.strong,{children:`“Switch Model”`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Because LLM Router acts as a universal gateway, you can type the name of `,_jsx(_components.em,{children:`any`}),` supported model, prefixed with the provider. For example:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`anthropic/claude-3-5-sonnet`}),` (Best for heavy coding/refactoring)`]}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`openai/gpt-4o`})}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`deepseek/deepseek-chat`}),` (Highly cost-efficient)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`router-auto`}),` (If you want LLM Router to dynamically pick the model based on your Tags)`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-4-the-llm-router-advantage-in-the-terminal`,children:`Step 4: The LLM Router Advantage in the Terminal`}),`\n`,_jsx(_components.p,{children:`Once configured, you can use Crush as normal to generate code, execute terminal commands, and debug.`}),`\n`,_jsx(_components.p,{children:`Because traffic is now flowing through LLM Router, you instantly gain:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Token Savings on Logs:`}),` If Crush runs `,_jsx(_components.code,{children:`npm run build`}),` and ingests 3,000 lines of terminal output, LLM Router will dynamically compress the repetitive middle sections, saving you up to 80% on API costs.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Zero-Trust Security:`}),` If Crush accidentally reads your `,_jsx(_components.code,{children:`.npmrc`}),` or AWS credentials from your local workspace, LLM Router’s PII engine will redact them into `,_jsx(_components.code,{children:`[TOKEN_REDACTED]`}),` before sending the context to Claude or GPT-4.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Resilience:`}),` If your primary AI provider experiences an outage, LLM Router will automatically fall back to your configured secondary provider without interrupting your CLI session.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Crush (CLI/TUI Agent)","description":"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.","href":"/ai-tools/crush"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Documentation Index","slug":"documentation-index","depth":2,"children":[]},{"title":"Crush \u0026 LLM Router","slug":"crush-\u0026-llm-router","depth":1,"children":[]},{"title":"Step 1: Installing Crush","slug":"step-1-installing-crush","depth":2,"children":[]},{"title":"Step 2: Modifying the Crush Configuration","slug":"step-2-modifying-the-crush-configuration","depth":2,"children":[{"title":"1. Locate the Configuration File","slug":"1-locate-the-configuration-file","depth":3,"children":[]},{"title":"2. Add LLM Router as a Provider","slug":"2-add-llm-router-as-a-provider","depth":3,"children":[]}]},{"title":"Step 3: Launch Crush and Select Your Model","slug":"step-3-launch-crush-and-select-your-model","depth":2,"children":[]},{"title":"Step 4: The LLM Router Advantage in the Terminal","slug":"step-4-the-llm-router-advantage-in-the-terminal","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"llmrouter","siteName":"LLM Router","title":"Crush (CLI/TUI Agent) - LLM Router","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-29T22:08:53.492Z","originalFileLocation":"ai-tools/crush.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LLM Router\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Crush (CLI/TUI Agent) - LLM Router\">\u003cmeta data-mint-head property=\"og:description\" content=\"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LLM Router\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.llmrouter.app/ai-tools/crush\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://llmrouter.mintlify.site/_mintlify/api/og/v2?division=AI+tools\u0026amp;title=Crush+%28CLI%2FTUI+Agent%29\u0026amp;description=Route+your+Crush+terminal+agent+through+LLM+Router+to+automatically+compress+massive+terminal+logs%2C+redact+local+secrets%2C+and+slash+API+costs.\u0026amp;theme=a478849910e652ec7906a8ef\u0026amp;signature=cc0785c32ea2a7679aaeebe9b56a10ed49ed3571167209e2c831262fa26cd050\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Crush (CLI/TUI Agent) - LLM Router\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://llmrouter.mintlify.site/_mintlify/api/og/v2?division=AI+tools\u0026amp;title=Crush+%28CLI%2FTUI+Agent%29\u0026amp;description=Route+your+Crush+terminal+agent+through+LLM+Router+to+automatically+compress+massive+terminal+logs%2C+redact+local+secrets%2C+and+slash+API+costs.\u0026amp;theme=a478849910e652ec7906a8ef\u0026amp;signature=cc0785c32ea2a7679aaeebe9b56a10ed49ed3571167209e2c831262fa26cd050\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/llmrouter/iLFkswXm1WfMhY20/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LLM Router\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.llmrouter.app/ai-tools/crush\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ai-tools/crush.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.llmrouter.app/#organization\",\"name\":\"LLM Router\",\"url\":\"https://docs.llmrouter.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/llmrouter/fmzcB0C0hZ8TxqoJ/logo/llmr-light.svg?fit=max\u0026auto=format\u0026n=fmzcB0C0hZ8TxqoJ\u0026q=85\u0026s=97bc60d4ed101a355191a7baaebd8a1c\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.llmrouter.app#website\",\"name\":\"LLM Router\",\"url\":\"https://docs.llmrouter.app\",\"publisher\":{\"@id\":\"https://docs.llmrouter.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.llmrouter.app/ai-tools/crush#webpage\",\"url\":\"https://docs.llmrouter.app/ai-tools/crush\",\"name\":\"Crush (CLI/TUI Agent)\",\"description\":\"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\",\"dateModified\":\"2026-03-29T22:08:53.492Z\",\"isPartOf\":{\"@id\":\"https://docs.llmrouter.app#website\"},\"breadcrumb\":{\"@id\":\"https://docs.llmrouter.app/ai-tools/crush#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.llmrouter.app/ai-tools/crush#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"AI tools\",\"item\":\"https://docs.llmrouter.app/ai-tools/cursor\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Crush (CLI/TUI Agent)\",\"item\":\"https://docs.llmrouter.app/ai-tools/crush\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.llmrouter.app/ai-tools/crush#article\",\"headline\":\"Crush (CLI/TUI Agent)\",\"name\":\"Crush (CLI/TUI Agent)\",\"description\":\"Route your Crush terminal agent through LLM Router to automatically compress massive terminal logs, redact local secrets, and slash API costs.\",\"url\":\"https://docs.llmrouter.app/ai-tools/crush\",\"mainEntityOfPage\":{\"@id\":\"https://docs.llmrouter.app/ai-tools/crush#webpage\"},\"dateModified\":\"2026-03-29T22:08:53.492Z\",\"publisher\":{\"@id\":\"https://docs.llmrouter.app/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.llmrouter.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LLM Router\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"LLM Router\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/ai-tools/crush.md","siteName":"LLM Router","nav":{"global":{"anchors":[{"anchor":"llms.txt","icon":"book-open-cover","href":"https://docs.llmrouter.app/llms.txt"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":""},{"title":"Provider Fallbacks","href":"/provider-fallbacks"},{"title":"Smart Routing","href":"/smart-routing"},{"title":"Chat Optimization","href":"/chat-optimization"},{"title":"Tools Optimization","href":"/tool-optimization"},{"title":"Skills","href":"/skills"},{"title":"Zero-Trust Data Redaction","href":"/redact"},{"title":"Zero Data Retention (ZDR)","href":"/zdr"},{"title":"Planning","href":"/planning"}]},{"group":"SDKs","pages":[{"title":"OpenAI","href":"/sdk/openai"},{"title":"Anthropic SDK","href":"/sdk/anthropic"},{"title":"Vercel AI SDK","href":"/sdk/vercel-ai-sdk"},{"title":"LiteLLM","href":"/sdk/litellm"}]},{"group":"AI tools","pages":[{"title":"Cursor","href":"/ai-tools/cursor"},{"title":"OpenAI Codex CLI","href":"/ai-tools/codex"},{"title":"OpenClaw (CLI)","href":"/ai-tools/openclaw"},{"title":"Claude Code","href":"/ai-tools/claude-code"},{"title":"Blackbox AI (CLI)","href":"/ai-tools/blackbox"},{"title":"Cline","href":"/ai-tools/cline"},{"title":"OpenCode","href":"/ai-tools/opencode"},{"title":"Roo Code (VS Code)","href":"/ai-tools/roo-code"},{"title":"TRAE","href":"/ai-tools/trae"},{"title":"Kilo Code","href":"/ai-tools/kilo"},{"title":"Factory Droid","description":"Route Factory Droid through LLM Router to automatically compress massive terminal logs, redact local .env secrets, and optimize token costs.","href":"/ai-tools/droid"},{"title":"Crush (CLI/TUI Agent)","href":"/ai-tools/crush"},{"title":"Goose","description":"Configure Goose AI agent to use LLM Router for intelligent routing, Skills, Zero Data Retention, and powerful terminal-based development workflows.","href":"/ai-tools/goose"},{"title":"Eigent (Desktop Agent)","href":"/ai-tools/eigent"},{"title":"Superset","href":"/ai-tools/superset"},{"title":"LibreChat","href":"/ai-tools/libre-chat"},{"title":"Chatbox (Desktop)","href":"/ai-tools/chatbox"},{"title":"Open WebUI","href":"/ai-tools/openwebui"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]},{"tab":"Blog","pages":[{"title":"Blog","href":"/blog/intro-to-llm-router"}]}]},"basePath":"","title":"Crush (CLI/TUI Agent) - LLM Router","deploymentId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","buildId":"dpl_EwfxjeKENdVkfzdag8rM6mKzcTUJ","dynamics":[],"chunks":[]}