cli
GitHubCLI路由技能,将终端任务精确分发至最匹配的专用工具(如rg、fd、jq等),避免使用通用Shell模式。通过工具对比表和使用场景指导选择,确保高效且准确的命令行操作执行。
Trigger Scenarios
用户要求使用特定CLI工具进行搜索或替换
需要快速文件发现或文本检索
涉及JSON/YAML数据查询与转换
需要代码结构感知搜索或重写
请求交互式模糊选择或文件分页查看
Install
npx skills add NeverSight/learn-skills.dev --skill cli -g -y
SKILL.md
Frontmatter
{
"name": "cli",
"source": "local",
"license": "MIT",
"version": "1.0.0",
"description": "Route terminal work to the narrowest CLI instead of generic shell patterns. Use this skill when the user asks to search with `rg` or `fd`, rewrite text with `sd`, `comby`, or `ast-grep`, inspect output with `head` or `less`, fetch files with `wget`, transform JSON or YAML with `jq` or `yq`, pick items with `fzf`, compare code with `difftastic`, lint shell with `shellcheck`, or measure a repo with `scc`."
}
CLI Router
Route the task to the narrowest tool that matches the job. Keep this file small; read references/ only for the tool you need.
Choose The Tool
| Tool | Use it for | Avoid when | Reference |
|---|---|---|---|
fd |
Fast file and path discovery | You need content matches inside files | references/fd.md |
rg |
Fast text search across files | You need structural or syntax-aware matching | references/ripgrep.md |
sd |
Simple literal or regex replacement | The change depends on code structure or multiline context beyond regex comfort | references/sd.md |
comby |
Lightweight structural rewrites across languages | You need full syntax parsing guarantees | references/comby.md |
ast-grep |
AST-aware code search, lint, and rewrite | You need type-aware or semantic analysis | references/ast-grep.md |
jq |
Query and transform JSON | The source is YAML-first | references/jq.md |
yq |
Query and edit YAML, convert structured formats | You need exact comment preservation or full jq parity assumptions |
references/yq.md |
wget |
Non-interactive download, retry, resume, mirror | You need browser automation or interactive login flows | references/wget.md |
head |
Quick non-interactive sampling | You need interactive search, paging, or follow mode | references/head.md |
less |
Interactive paging, search, and follow | The flow must stay unattended | references/less.md |
fzf |
Interactive fuzzy selection for humans | The agent must run headless or deterministically | references/fzf.md |
difftastic |
Syntax-aware diffs for human review | You need an applicable patch or machine-stable diff format | references/difftastic.md |
shellcheck |
Shell linting and safety checks | You need formatting rather than diagnostics | references/shellcheck.md |
scc |
Repo language inventory, LOC, and rough complexity | You need semantic code review or profiling | references/scc.md |
Escalate Deliberately
- Use
fdfor paths, thenrgfor text. - Use
sdfor simple replacements,combywhen regex gets brittle, andast-grepwhen syntax precision matters. - Use
jqfor JSON andyqfor YAML-first edits or format conversion. - Use
headfor quick samples; switch tolessonly when a human needs to page or search. - Treat
fzf,less, anddifftasticas human-oriented tools unless the task explicitly benefits from interactive review.
Load More Detail Only When Needed
- Read
references/api-surface.mdfor command/flag selection across the toolset. - Read
references/common-use-cases.mdfor ready-made task patterns. - Read
references/troubleshooting-workarounds.mdfor common failure modes. - Read the tool-specific reference for examples, sharp edges, and escalation boundaries.
Version History
- e0220ca Current 2026-07-05 22:10


