Claude-skill-registry context7-cli
Use the local Context7 CLI in this repo to search libraries and fetch Context7 context for skills or documentation tasks. Trigger when you need to run `c7 search`/`c7 context`, resolve library IDs, or retrieve text/json outputs from Context7 via the CLI.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/context7-cli" ~/.claude/skills/majiayu000-claude-skill-registry-context7-cli && rm -rf "$T"
manifest:
skills/data/context7-cli/SKILL.mdsource content
Context7 CLI
Overview
Use the local
agent-skills CLI (subcommand c7) to query Context7 for library discovery and context snippets. Prefer this tool when a task needs authoritative library context and you want a deterministic CLI output that can be piped into downstream steps.
Quick Start
- Ensure
is set or passCONTEXT7_API_KEY
.--api-key - If
is already installed, use it directly:agent-skills
command -v agent-skills agent-skills c7 search --library-name react --query "useEffect cleanup"
- Otherwise, run the CLI from the repo:
go run ./cmd/agent-skills c7 search --library-name react --query "useEffect cleanup"
For repeated calls, build once:
go build -o bin/agent-skills ./cmd/agent-skills ./bin/agent-skills c7 context --library-id /facebook/react --query "useEffect cleanup"
Or install remotely (requires Go) only if the binary is missing:
if ! command -v agent-skills >/dev/null 2>&1; then go install github.com/strantalis/agent-skills/cmd/agent-skills@latest fi agent-skills c7 search --library-name react --query "useEffect cleanup"
Tasks
Search for libraries
Use this to discover candidate library IDs.
go run ./cmd/agent-skills c7 search --library-name react --query "useEffect cleanup"
- Default output is JSON. Use
for JSON lines or--format jsonl
for tab-separated lines.--format text - Use
to reduce results when you only need the top few.--limit
Fetch context
Prefer explicit
--library-id for determinism.
go run ./cmd/agent-skills c7 context --library-id /facebook/react --query "useEffect cleanup"
If you only have a name, you may use
--library-name. If multiple libraries match, use --select=interactive or --select=first, or provide --library-id for determinism.
go run ./cmd/agent-skills c7 context --library-name react --query "useEffect cleanup"
Output formats
- Use
when another tool or step needs structured output.--format json - Use
for streaming or piping one JSON object per line.--format jsonl - Use
for direct reading or quick copy/paste.--format text
Flags (global to c7
)
c7
(or--api-key
): Context7 API key.CONTEXT7_API_KEY
: Override the Context7 base URL.--base-url
: HTTP timeout (default 30s).--timeout
: Retry count for 202/429/5xx responses.--retries
: Enable disk cache when set.--cache-dir
: Cache TTL (default 24h, only used when cache-dir is set).--cache-ttl
Troubleshooting
- 401/403: Missing or invalid API key. Set
or passCONTEXT7_API_KEY
.--api-key - 429: Rate limited. The client retries automatically; reduce request rate if persistent.
- 202: Context is still processing; retries will handle this automatically.
Reference
See
references/api_reference.md for the full command reference and examples.