context7
Original:🇺🇸 English
Translated
1 scripts
Use when needing API docs, framework patterns, or code examples for any library. Fetches up-to-date documentation via Context7 REST API.
7installs
Added on
NPX Install
npx skill4agent add netresearch/context7-skill context7Tags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Context7 Documentation Lookup Skill
Fetch current library documentation, API references, and code examples without MCP context overhead.
When to Use This Skill
When the user asks about library APIs or framework patterns, use this skill to fetch current documentation.
When encountering import statements (, , ), use this skill to provide accurate API information.
importrequirefromWhen the user asks about specific library versions or "How do I use X library?", use this skill to get official patterns.
Core Workflow
To answer questions about library documentation, follow these steps:
- Search for the library ID using
scripts/context7.sh search - Fetch documentation using
scripts/context7.sh docs - Apply returned documentation to provide accurate, version-specific answers
Running Scripts
Searching for Libraries
To find a library ID for documentation lookup:
bash
scripts/context7.sh search "library-name"This returns library IDs in the format (e.g., ).
/vendor/library/facebook/reactFetching Documentation
To fetch documentation for a specific library:
bash
scripts/context7.sh docs "<library-id>" "[topic]" "[mode]"Parameters:
- (required): From search result (e.g.,
library-id)/facebook/react - (optional): Focus area (e.g.,
topic,hooks,routing)authentication - (optional):
modefor API references (default) orcodefor conceptual guidesinfo
Examples
To get React hooks documentation:
bash
scripts/context7.sh search "react"
scripts/context7.sh docs "/facebook/react" "hooks" "code"To get Next.js routing guide:
bash
scripts/context7.sh search "nextjs"
scripts/context7.sh docs "/vercel/next.js" "routing" "info"Documentation Modes
When fetching API references, examples, or code patterns, use mode (default).
codeWhen fetching conceptual guides, tutorials, or explanations, use mode.
infoEnvironment Configuration
To use authenticated requests (optional), set the environment variable:
CONTEXT7_API_KEYbash
export CONTEXT7_API_KEY="your-api-key"Contributing: https://github.com/netresearch/context7-skill