
Context7 Cli
Drive the ctx7 CLI to fetch fresh library docs, install skills from repos, and wire Context7 MCP into Claude Code or Cursor.
Install
npx skills add https://github.com/upstash/context7 --skill context7-cliWhat is this skill?
- Three pillars: library documentation fetch, AI coding skills management, and Context7 MCP setup
- Two-step docs flow: ctx7 library then ctx7 docs with resolved library ID
- Skills commands: install from /owner/repo, search registry, suggest, list, remove, generate
- Runnable via npm install -g ctx7@latest or npx ctx7@latest without global install
- Dedicated reference docs for documentation, skills, and editor setup paths
Adoption & trust: 2.9k installs on skills.sh; 57k GitHub stars; 1/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Build/integrations is the canonical shelf because the skill centers on ctx7 CLI commands that connect agents to live documentation and skill registries. Integrations subphase fits MCP setup, global CLI install, and bridging editors to Context7—not writing product UI or ship-time test suites.
Common Questions / FAQ
Is Context7 Cli safe to install?
skills.sh reports 1 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Context7 Cli
# ctx7 CLI The Context7 CLI does three things: fetches up-to-date library documentation, manages AI coding skills, and sets up Context7 MCP for your editor. Make sure the CLI is up to date before running commands: ```bash npm install -g ctx7@latest ``` Or run directly without installing: ```bash npx ctx7@latest <command> ``` ## What this skill covers - **[Documentation](references/docs.md)** — Fetch current docs for any library. Use when writing code, verifying API signatures, or when training data may be outdated. - **[Skills management](references/skills.md)** — Install, search, suggest, list, remove, and generate AI coding skills. - **[Setup](references/setup.md)** — Configure Context7 MCP for Claude Code / Cursor / OpenCode. ## Quick Reference ```bash # Documentation ctx7 library <name> <query> # Step 1: resolve library ID ctx7 docs <libraryId> <query> # Step 2: fetch docs # Skills ctx7 skills install /owner/repo # Install from a repo (interactive) ctx7 skills install /owner/repo name # Install a specific skill ctx7 skills search <keywords> # Search the registry ctx7 skills suggest # Auto-suggest based on project deps ctx7 skills list # List installed skills ctx7 skills remove <name> # Uninstall a skill ctx7 skills generate # Generate a custom skill with AI (requires login) # Setup ctx7 setup # Configure Context7 MCP (interactive) ctx7 login # Log in for higher rate limits + skill generation ctx7 whoami # Check current login status ``` ## Authentication ```bash ctx7 login # Opens browser for OAuth ctx7 login --no-browser # Prints URL instead of opening browser ctx7 logout # Clear stored tokens ctx7 whoami # Show current login status (name + email) ``` Most commands work without login. Exceptions: `skills generate` always requires it; `ctx7 setup` requires it unless `--api-key` or `--oauth` is passed. Login also unlocks higher rate limits on docs commands. Set an API key via environment variable to skip interactive login entirely: ```bash export CONTEXT7_API_KEY=your_key ``` ## Common Mistakes - Library IDs require a `/` prefix — `/facebook/react` not `facebook/react` - Always run `ctx7 library` first — `ctx7 docs react "hooks"` will fail without a valid ID - Repository format for skills is `/owner/repo` — e.g., `ctx7 skills install /anthropics/skills` - `skills generate` requires login — run `ctx7 login` first # Setup ## ctx7 setup One-time command to configure Context7 for your AI coding agent. Prompts for mode on first run: - **MCP server** — registers the Context7 MCP server so the agent can call tools natively - **CLI + Skills** — installs a `find-docs` skill that guides the agent to use `ctx7` CLI commands (no MCP required) ```bash ctx7 setup # Interactive — prompts for mode, then agent/install target ctx7 setup --mcp # Skip prompt, use MCP server mode ctx7 setup --cli # Skip prompt, use CLI + Skills mode # MCP mode — target a specific agent ctx7 setup --claude # Claude Code only ctx7 setup --cursor # Cursor only ctx7 setup --opencode # OpenCode only # CLI + Skills mode — target a specific install location ctx7 setup --cli --claude # Claude Code (~/.claude/skills) ctx7 setup --cli --cursor # Cursor (~/.cursor/skills) ctx7 setup --cli --universal # Universal (~/.agents/skills) ctx7 setup --cli --antigravity # Antigravity (~/.config/agent/skills) ctx7 setup --proje