From cli-wrapper
Wraps external CLIs with a compact digest, saving tokens by capturing --help output and providing standardized invoke/explain/audit commands. Use before calling unfamiliar CLIs or for repeated interactions.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cli-wrapper:cli-wrapperThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bridge between AI harness and external CLIs. Captures, documents, optimizes.
Bridge between AI harness and external CLIs. Captures, documents, optimizes.
Raw CLI help output floods context. A single docker --help = ~3KB. Wrapped digest = ~300 bytes. 10x savings per invocation. Multiply by every CLI the harness calls.
/cli-wrapper wrap <cli-name> — capture CLI help + build digest
/cli-wrapper invoke <cli-name> <args> — run command, return compact output
/cli-wrapper audit <cli-name> — show token savings for this CLI
/cli-wrapper list — list all wrapped CLIs
/cli-wrapper unwrap <cli-name> — remove wrapper, restore raw access
Claude will:
<cli> --help (and <cli> <subcommand> --help recursively).claude/cli-wrappers/<cli-name>.jsonInstead of raw CLI calls, the harness uses the wrapper interface:
/cli-wrapper invoke docker ps --filter status=running
The wrapper:
/cli-wrapper audit docker
Returns:
CLI WRAPPER AUDIT — docker
===========================
Wrapped: 2026-06-15
Commands: 27 subcommands indexed
Help size: 3.2KB raw → 0.3KB digest (90% savings)
Invocations: 12
Tokens saved: ~18,400
Avg savings: ~1,533 tokens/call
Each wrapped CLI produces a machine-readable digest:
{
"name": "docker",
"version": "27.3.1",
"wrapped_at": "2026-06-15T10:30:00Z",
"subcommands": {
"ps": {
"description": "List containers",
"flags": {
"--all": { "type": "bool", "description": "Show all containers" },
"--filter": { "type": "string", "description": "Filter output", "repeatable": true },
"--format": { "type": "string", "description": "Go template" },
"--quiet": { "type": "bool", "description": "Only IDs" }
}
},
"build": {
"description": "Build image from Dockerfile",
"flags": {
"--tag": { "type": "string", "description": "Name:tag", "repeatable": true },
"--file": { "type": "string", "description": "Dockerfile path" },
"--build-arg": { "type": "string", "description": "Build-time var", "repeatable": true },
"--no-cache": { "type": "bool", "description": "Don't use cache" },
"--platform": { "type": "string", "description": "Target platform" }
}
}
},
"global_flags": {
"--config": { "type": "string", "description": "Config file location" },
"--context": { "type": "string", "description": "Docker context" },
"--debug": { "type": "bool", "description": "Debug mode" },
"--host": { "type": "string", "description": "Daemon socket" },
"--log-level": { "type": "string", "description": "Log level", "choices": ["debug", "info", "warn", "error"] }
},
"stats": {
"help_raw_bytes": 3247,
"digest_bytes": 312,
"savings_pct": 90.4
}
}
| Phase | Without Wrapper | With Wrapper |
|---|---|---|
| Discovery | Run cmd --help each session → 3KB tokens | Load digest → 0.3KB tokens |
| Validation | Harness guesses flags → retries | Digest validates → first try |
| Output | Raw output → possibly 10KB+ | Post-processed → essential only |
| Documentation | Harness re-discovers each time | Digest persists across sessions |
Works with any CLI that supports --help:
command --help, command subcommand --helpgit, docker, kubectl, aws, gcloudffmpeg, curl, jq, ghnpx, pnpm, bunTo minimize context bloat, the wrapper applies:
--max-lines overrides)docker ps → table of container names + status only).claude/cli-wrappers/<name>.json — digest (machine-readable).claude/cli-wrappers/<name>.md — human-readable reference (optional)User: /cli-wrapper wrap gh
Claude:
Running gh --help … 2.1KB
Running gh issue --help … 1.8KB
Running gh pr --help … 2.4KB
Running gh repo --help … 1.6KB
✓ gh wrapped — 4 subcommands, 47 flags indexed
Digest: 0.4KB (94% savings vs 7.9KB raw)
Saved to .claude/cli-wrappers/gh.json
User: /cli-wrapper invoke gh issue list --state open --limit 5
Claude: [validates flags ✓] [runs command] [output: 5 issues, compact table]
Tokens used: 142 (vs ~800 raw — 82% savings)
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin cli-wrapper