|
|
6 месяцев назад | |
|---|---|---|
| .github | 6 месяцев назад | |
| internal | 6 месяцев назад | |
| .gitattributes | 6 месяцев назад | |
| .gitignore | 7 месяцев назад | |
| .golangci.yml | 7 месяцев назад | |
| .goreleaser.yml | 6 месяцев назад | |
| CLA.md | 6 месяцев назад | |
| CRUSH.md | 6 месяцев назад | |
| LICENSE | 6 месяцев назад | |
| README.md | 6 месяцев назад | |
| Taskfile.yaml | 6 месяцев назад | |
| crush.json | 6 месяцев назад | |
| cspell.json | 6 месяцев назад | |
| go.mod | 6 месяцев назад | |
| go.sum | 6 месяцев назад | |
| main.go | 6 месяцев назад | |
| schema.json | 6 месяцев назад | |
| sqlc.yaml | 10 месяцев назад |
Your new coding bestie, now available in your favourite terminal.
Your tools, your code, and your workflows, wired into your LLM of choice.
http, stdio, and sse)Use a package manager:
# NPM
npm install -g @charmland/crush
# Arch Linux (btw)
yay -S crush-bin
# Nix
nix-shell -p nur.repos.charmbracelet.crush
Or, download it:
Or just install it with go:
go install github.com/charmbracelet/crush@latest
[!WARNING] Productivity may increase when using Crush and you may find yourself nerd sniped when first using the application. If the symptoms persist, join the Discord and nerd snipe the rest of us.
The quickest way to get started is to grab an API key for your preferred provider such as Anthropic, OpenAI, Groq, or OpenRouter and just start Crush. You'll be prompted to enter your API key.
That said, you can also set environment variables for preferred providers.
Crush runs great with no configuration. That said, if you do need or want to customize Crush, configuration can be added either local to the project itself, or globally, with the following priority:
./.crush.json./crush.json$HOME/.config/crush/crush.jsonConfiguration itself is stored as a JSON object:
{
"this-setting": { }
"that-setting": { }
}
Crush can use LSPs for additional context to help inform its decisions, just like you would. LSPs can be added manually like so:
{
"$schema": "https://charm.land/crush.json",
"lsp": {
"go": {
"command": "gopls"
},
"typescript": {
"command": "typescript-language-server",
"args": ["--stdio"]
},
"nix": {
"command": "nil"
}
}
}
Crush also supports Model Context Protocol (MCP) servers through three
transport types: stdio for command-line servers, http for HTTP endpoints,
and sse for Server-Sent Events. Environment variable expansion is supported
using $(echo $VAR) syntax.
{
"$schema": "https://charm.land/crush.json",
"mcp": {
"filesystem": {
"type": "stdio",
"command": "node",
"args": ["/path/to/mcp-server.js"],
"env": {
"NODE_ENV": "production"
}
},
"github": {
"type": "http",
"url": "https://example.com/mcp/",
"headers": {
"Authorization": "$(echo Bearer $EXAMPLE_MCP_TOKEN)"
}
},
"streaming-service": {
"type": "sse",
"url": "https://example.com/mcp/sse",
"headers": {
"API-Key": "$(echo $API_KEY)"
}
}
}
}
By default, Crush will ask you for permission before running tool calls. If you'd like, you can whitelist tools to be executed without prompting you for permissions. Use this with care.
{
"$schema": "https://charm.land/crush.json",
"permissions": {
"allowed_tools": [
"view",
"ls",
"grep",
"edit",
"mcp_context7_get-library-doc"
]
}
}
You can also skip all permission prompts entirely by running Crush with the
--yolo flag. Be very, very careful with this feature.
Crush supports custom provider configurations for both OpenAI-compatible and Anthropic-compatible APIs.
Here’s an example configuration for Deepseek, which uses an OpenAI-compatible
API. Don't forget to set DEEPSEEK_API_KEY in your environment.
{
"$schema": "https://charm.land/crush.json",
"providers": {
"deepseek": {
"type": "openai",
"base_url": "https://api.deepseek.com/v1",
"api_key": "$DEEPSEEK_API_KEY",
"models": [
{
"id": "deepseek-chat",
"name": "Deepseek V3",
"cost_per_1m_in": 0.27,
"cost_per_1m_out": 1.1,
"cost_per_1m_in_cached": 0.07,
"cost_per_1m_out_cached": 1.1,
"context_window": 64000,
"default_max_tokens": 5000
}
]
}
}
}
Custom Anthropic-compatible providers follow this format:
{
"$schema": "https://charm.land/crush.json",
"providers": {
"custom-anthropic": {
"type": "anthropic",
"base_url": "https://api.anthropic.com/v1",
"api_key": "$ANTHROPIC_API_KEY",
"extra_headers": {
"anthropic-version": "2023-06-01"
},
"models": [
{
"id": "claude-sonnet-4-20250514",
"name": "Claude Sonnet 4",
"cost_per_1m_in": 3,
"cost_per_1m_out": 15,
"cost_per_1m_in_cached": 3.75,
"cost_per_1m_out_cached": 0.3,
"context_window": 200000,
"default_max_tokens": 50000,
"can_reason": true,
"supports_attachments": true
}
]
}
}
}
Sometimes you need to look at logs. Luckily, Crush logs all sorts of
stuff. Logs are stored in ./.crush/logs/crush.log relative to the project.
The CLI also contains some helper commands to make perusing recent logs easier:
# Print the last 1000 lines
crush logs
# Print the last 500 lines
crush logs --tail 500
# Follow logs in real time
crush logs --follow
Want more logging? Run crush with the --debug flag, or enable it in the
config:
{
"$schema": "https://charm.land/crush.json",
"options": {
"debug": true,
"debug_lsp": true
}
}
We’d love to hear your thoughts on this project. Need help? We gotchu. You can find us on:
Part of Charm.
Charm热爱开源 • Charm loves open source