crush-config
Skill này làm gì
Skill này giúp bạn cấu hình Crush, một công cụ lập trình, qua các file cấu hình. Nó bao quát nhà cung cấp, mô hình, máy chủ MCP, hook và quyền. Skill dành cho người muốn thay đổi cách Crush hoạt động.
Khi nào nên dùng
- ✓Khi bạn muốn thiết lập nhà cung cấp hoặc mô hình trong Crush.
- ✓Khi bạn muốn thêm máy chủ MCP, máy chủ ngôn ngữ hoặc skill vào Crush.
- ✓Khi bạn muốn thay đổi quyền hoặc hành vi của Crush bằng file cấu hình.
Liên kết skill
https://github.com/charmbracelet/crush/blob/main/internal/skills/builtin/crush-config/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy thiết lập Crush với nhà cung cấp API của tôi và thêm một máy chủ MCP, dùng file crushrc trong dự án của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent viết một script crushrc, dựa trên Bash, hoặc một file crush.json. Crush gộp các file cấu hình từ thư mục home và thư mục dự án của bạn. Script dùng các lệnh có sẵn như provider, model và mcp để tạo ra các thiết lập.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Both are discovered together and deep-merged. Priority (highest to lowest):
.crushrc/crushrc/.crush.json/crush.json(project-local, closer-to-cwd wins; Windows uses.\.crushrc/.\crushrc)$XDG_CONFIG_HOME/crush/crushrcor~/.config/crush/crushrc(%XDG_CONFIG_HOME%\crush\crushrcor%USERPROFILE%\.config\crush\crushrcon 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.
#!/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):
[[ "$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
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,
--system-prompt-prefix TEXT, --extra-header KEY VALUE (repeatable),
--extra-body JSON, --provider-options JSON.
provider add deepseek \
--type completions \
--base-url "https://api.deepseek.com/v1" \
--api-key "${DEEPSEEK_API_KEY:?set DEEPSEEK_API_KEY}"
models
model add <provider>/<id> [flags] # register a custom model (provider must exist)
model remove <provider>/<id> # alias: rm
model large [<provider>/<id>] [flags] # set the large slot; no arg prints it
model small [<provider>/<id>] [flags] # set the small slot; no arg prints it
<provider>/<id>is the same formcrush modelsprints. A missing slash is an error.model addrequires the provider to already exist.model addflags:--name,--context-window N,--default-max-tokens N,--thinking always|never|toggleable,--supports-images BOOL,--price-input F,--price-output F,--price-cache-create F,--price-cache-hit F,--reasoning-effort low|medium|high,--max-attachments N.model large/model smallflags:--think,--reasoning-effort,--max-tokens N,--temperature F,--top-p F,--top-k N,--frequency-penalty F,--presence-penalty F,--provider-options JSON.model largewith no argument prints the current selection asprovider/id, usable in$(model large).
large is the primary coding model; small is used for summarization.
mcp
mcp add <name> --type stdio|sse|http [flags] # default type is stdio
mcp remove <name> # alias: rm
Flags: --command CMD, --args ARG (repeatable), --env KEY VALUE
(repeatable), --url URL, --header KEY VALUE (repeatable), --timeout N,
--disabled BOOL, --disabled-tools TOOL (repeatable), `--enabled-t
Câu hỏi thường gặp
crushrc là gì?
Đó là một script Bash xây dựng cấu hình Crush bằng cách gọi các lệnh có sẵn, và là định dạng được ưu tiên.
Tôi vẫn có thể dùng JSON không?
Có. crush.json được hỗ trợ đầy đủ, và cả hai định dạng có thể dùng cùng nhau.
Skill bao quát những thiết lập nào?
Skill bao quát nhà cung cấp, mô hình, máy chủ ngôn ngữ, máy chủ MCP, hook, skill và quyền.
Chi tiết
Mô tả gốc của tác giả
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.
repo: charmbracelet/crush
Độ phổ biến
- Sao GitHub
- 29k
- Vị trí xếp hạng
- #9765
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
crush-hooks
29kGiúp agent của bạn viết và gỡ lỗi hook Crush để kiểm tra, chặn hoặc thay đổi lệnh gọi công cụ trước khi chạy, bằng thiết lập trong crush.json.
jq
29kGiúp agent của bạn truy vấn và định hình lại dữ liệu JSON, như phản hồi API, file cấu hình hoặc log, bằng lệnh jq có sẵn.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.