Context7 cli

From Jonghakseo/my-pi · View interactive version

Context7 cli is an AI agent skill from the GitHub repository Jonghakseo/my-pi. 라이브러리·프레임워크 공식 문서와 API 예시를 조회할 때 사용한다.

How to use this skill

Skill file

Context7 CLI

What this skill is for

Use this skill when you need Context7 documentation lookup but do not want MCP tool registration.

Typical cases:

Preferred flow

  1. Check how to run Context7 CLI
  1. Resolve the library ID
  1. Fetch docs with the resolved ID
  1. Prefer JSON when machine-readable output helps
  1. Report fallback path clearly

If you already know the exact library ID, skip library and go straight to docs.

Command patterns

1) Check availability

ctx7 --help

If that fails:

npx -y ctx7 --help

2) Resolve a library ID

ctx7 library react
ctx7 library nextjs "app router authentication"
ctx7 library prisma "relations"

JSON mode:

ctx7 library react --json

3) Query docs

ctx7 docs /facebook/react "useEffect cleanup"
ctx7 docs /vercel/next.js "middleware authentication"
ctx7 docs /prisma/prisma "one-to-many relations"

JSON mode:

ctx7 docs /facebook/react "hooks" --json

Bash usage guidance

When you are unsure whether ctx7 is installed, prefer a bash pattern like this:

if command -v ctx7 >/dev/null 2>&1; then
  ctx7 library react --json
else
  npx -y ctx7 library react --json
fi

For doc queries:

if command -v ctx7 >/dev/null 2>&1; then
  ctx7 docs /facebook/react "useEffect cleanup" --json
else
  npx -y ctx7 docs /facebook/react "useEffect cleanup" --json
fi

Authentication

For automation, prefer environment-variable auth when needed:

export CONTEXT7_API_KEY=your_key_here

Interactive auth may also be available:

ctx7 login
ctx7 whoami
ctx7 logout

Optional telemetry disable:

export CTX7_TELEMETRY_DISABLED=1

If unauthenticated access works but appears rate-limited, mention that limitation in the report.

Output handling rules

Search quality rules

Failure recovery

`ctx7` command not found

Retry with:

npx -y ctx7 ...

Auth / rate-limit issues

JSON output is hard to parse

Library resolution is ambiguous

ctx7 library nextjs "vercel app router"

Guidance for searcher

When answering library/framework questions:

Reference points

Re-check these in the current environment when accuracy matters:

If --help does not clarify a command or authentication behavior, check the official Context7 repository.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.