context7-docs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext7 Documentation Lookup
Context7 文档查询
Retrieve current documentation and code examples from Context7 using the and tools that ship with this extension.
resolve-library-idquery-docsWhen to use
何时使用
Reach for these tools whenever a question involves a specific library, framework, SDK, CLI tool, or cloud service. Examples:
- "How do I configure caching in Next.js 16?"
- "What's the syntax for Prisma's with relations?"
findMany - "Show me a working Tailwind v4 install for a Vite app."
- "How do I rate-limit with ?"
@upstash/ratelimit
只要问题涉及特定的 library、framework、SDK、CLI tool 或 cloud service,都应使用这些工具。例如:
- “如何在 Next.js 16 中配置缓存?”
- “Prisma 的 如何使用关联关系?”
findMany - “为 Vite app 提供一个可用的 Tailwind v4 安装示例。”
- “如何使用 实施速率限制?”
@upstash/ratelimit
Workflow
工作流程
- Resolve the library ID. Call with the library name and what to look up in the library's documentation. The tool returns matching libraries with their Context7 IDs (
resolve-library-idformat), descriptions, snippet counts, and quality scores. Pick the best match — prioritize official sources, name match, and high benchmark scores./org/project - Query the docs. Call with the chosen library ID and what to look up in the library's documentation, scoped to a single concept — if the question spans multiple distinct concepts, make a separate call per concept with the same library ID, unless the question is about how the concepts interact. The tool returns documentation snippets and code examples.
query-docs - Answer. Cite the library ID you used and quote code examples verbatim when relevant.
If the user supplies a library ID in or format directly, skip step 1 and call immediately.
/org/project/org/project/versionquery-docs- 解析 library ID。 使用 library 名称以及要在该 library 文档中查找的内容,调用 。该工具会返回匹配的 library 及其 Context7 ID(
resolve-library-id格式)、描述、代码片段数量和质量分数。选择最匹配的项——优先考虑官方来源、名称匹配度高且基准分数较高的项目。/org/project - 查询文档。 使用选定的 library ID 以及要在该 library 文档中查找的内容,调用 ,并将查询范围限定为单一概念——如果问题涉及多个不同概念,请使用同一个 library ID 为每个概念分别调用一次,除非问题涉及这些概念之间的交互。该工具会返回文档片段和代码示例。
query-docs - 回答。 引用你使用的 library ID,并在相关时逐字引用代码示例。
如果用户直接提供了 或 格式的 library ID,请跳过第 1 步,立即调用 。
/org/project/org/project/versionquery-docsConstraints
约束
- Do not call either tool more than 3 times per question.
- Do not pass API keys, passwords, credentials, personal data, or proprietary code as the argument — it is sent to the Context7 API.
query - Authentication uses the environment variable. Get a key at https://context7.com/dashboard if requests fail with an auth error.
CONTEXT7_API_KEY
- 每个问题中,任一工具的调用次数均不得超过 3 次。
- 不要将 API key、密码、凭据、个人数据或专有代码作为 参数传入——这些内容会被发送到 Context7 API。
query - 身份验证使用 环境变量。如果请求因身份验证错误而失败,请前往 https://context7.com/dashboard 获取 key。
CONTEXT7_API_KEY