ctx7 CLI
The Context7 CLI does two things: fetches up-to-date library documentation and sets up Context7 MCP for your editor.
Make sure the CLI is up to date before running commands:
Or run directly without installing:
What this skill covers
- Documentation [blocked] — Fetch current docs for any library. Use when writing code, verifying API signatures, or when training data may be outdated.
- Setup [blocked] — Configure Context7 MCP for Claude Code / Cursor / OpenCode.
Quick Reference
Authentication
Most commands work without login. Exception: 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:
Common Mistakes
- Library IDs require a
/prefix —/facebook/reactnotfacebook/react - Always run
ctx7 libraryfirst —ctx7 docs react "hooks"will fail without a valid ID


