Index of every page on this site: llms.txt
All skills
upstash avatar

/context7-cli

@b1e3611 official
by upstashupstash/context765k stars
3,258
Run it yourself

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.

Use this Skill: https://skilld.dev/gh/upstash/context7/context7-cli

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈59 tokens for metadata: the name and description. ≈456 when used: this file. ≈2.3k more on demand in 2 files.

Description uses 2.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈235 characters, or 2.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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 — /reactjs/react.dev not reactjs/react.dev
  • Always run ctx7 library first — ctx7 docs react "hooks" will fail without a valid ID

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warningtoday5 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill facilitates fetching programming documentation and configuring AI agent environments using the ctx7 CLI. It involves installing an external package from the NPM registry, executing shell commands, and modifying agent-specific configuration files to integrate with the Context7 documentation service.

  • Socket7d

    No alerts

  • Snyktoday

    Risk: MEDIUM · 2 issues

  • Runlayer8mo

    1/4 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at b1e3611. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 16 hours ago.

Activeupdated last week

README badge

README badge for upstash/context7/context7-cli