Skip to content
Skillpedia
General coding64k · #3166

context7-cli

What it does

This skill lets your agent use the ctx7 command-line tool to look up current library docs and connect Context7 to a code editor. It is for developers who work in a terminal.

When to use it

  • ✓When you want to look up current documentation for a library from the command line.
  • ✓When you want to set up Context7 for Claude Code, Cursor, or OpenCode.
  • ✓When you need to check whether you are logged in to Context7.

Skill link

https://github.com/upstash/context7/blob/master/skills/context7-cli/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/upstash/context7/blob/master/skills/context7-cli/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Set up Context7 for my Claude Code so it can read current library docs.”

5 new skills a week. 1 minute to read.

How it works

The skill runs the ctx7 tool, which searches for a library and then fetches its docs for your question. It can also guide the setup that connects Context7 to your editor.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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:

npm install -g ctx7@latest

Or run directly without installing:

npx ctx7@latest <command>

What this skill covers

  • Documentation — Fetch current docs for any library. Use when writing code, verifying API signatures, or when training data may be outdated.
  • Setup — Configure Context7 MCP for Claude Code / Cursor / OpenCode.

Quick Reference

# Documentation
ctx7 search <query>                   # Search all libraries in one step
ctx7 library <name> <query>           # Step 1: resolve library ID
ctx7 docs <libraryId> <query>         # Step 2: fetch docs

# Setup
ctx7 setup                            # Configure Context7 MCP (interactive)
ctx7 login                            # Log in for higher rate limits
ctx7 whoami                           # Check current login status

Authentication

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. 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:

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
FAQ

Do I need to install anything?

The skill uses the ctx7 tool, which can be run with npx or installed globally with npm.

Do I need to log in?

Most commands work without logging in, but the setup command requires a login.

Which editors does setup support?

The skill mentions Claude Code, Cursor, and OpenCode.

Details

Original description by the author

Use the ctx7 CLI to fetch library documentation and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7", needs current docs for any library, or needs to set up Context7 for their AI coding agent.

repo: upstash/context7

Popularity

GitHub stars
64k
Ranking position
#3166
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills