context7-cli by upstash/context7
npx skills add https://github.com/upstash/context7 --skill context7-cliContext7 CLI 主要执行三项功能:获取最新的库文档、管理 AI 编程技能,以及为你的编辑器设置 Context7 MCP。
运行命令前,请确保 CLI 是最新版本:
npm install -g ctx7@latest
或者无需安装直接运行:
npx ctx7@latest <command>
# 文档
ctx7 library <name> <query> # 步骤 1: 解析库 ID
ctx7 docs <libraryId> <query> # 步骤 2: 获取文档
# 技能
ctx7 skills install /owner/repo # 从仓库安装(交互式)
ctx7 skills install /owner/repo name # 安装特定技能
ctx7 skills search <keywords> # 搜索注册表
ctx7 skills suggest # 基于项目依赖自动推荐
ctx7 skills list # 列出已安装的技能
ctx7 skills remove <name> # 卸载技能
ctx7 skills generate # 使用 AI 生成自定义技能(需要登录)
# 设置
ctx7 setup # 配置 Context7 MCP(交互式)
ctx7 login # 登录以获得更高的速率限制和技能生成权限
ctx7 whoami # 检查当前登录状态
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
ctx7 login # 打开浏览器进行 OAuth 登录
ctx7 login --no-browser # 打印 URL 而不是打开浏览器
ctx7 logout # 清除存储的令牌
ctx7 whoami # 显示当前登录状态(姓名 + 邮箱)
大多数命令无需登录即可使用。例外情况:skills generate 始终需要登录;ctx7 setup 需要登录,除非传递了 --api-key 或 --oauth 参数。登录还可以解锁文档命令更高的速率限制。
通过环境变量设置 API 密钥可以完全跳过交互式登录:
export CONTEXT7_API_KEY=your_key
/ 前缀 — 使用 /facebook/react 而不是 facebook/reactctx7 library — 如果没有有效的 ID,ctx7 docs react "hooks" 会失败/owner/repo — 例如,ctx7 skills install /anthropics/skillsskills generate 需要登录 — 请先运行 ctx7 login每周安装量
351
代码仓库
GitHub 星标
50.5K
首次出现
14 天前
安全审计
已安装于
codex333
github-copilot326
opencode326
gemini-cli325
amp325
kimi-cli325
The Context7 CLI does three things: fetches up-to-date library documentation, manages AI coding skills, 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>
# Documentation
ctx7 library <name> <query> # Step 1: resolve library ID
ctx7 docs <libraryId> <query> # Step 2: fetch docs
# Skills
ctx7 skills install /owner/repo # Install from a repo (interactive)
ctx7 skills install /owner/repo name # Install a specific skill
ctx7 skills search <keywords> # Search the registry
ctx7 skills suggest # Auto-suggest based on project deps
ctx7 skills list # List installed skills
ctx7 skills remove <name> # Uninstall a skill
ctx7 skills generate # Generate a custom skill with AI (requires login)
# Setup
ctx7 setup # Configure Context7 MCP (interactive)
ctx7 login # Log in for higher rate limits + skill generation
ctx7 whoami # Check current login status
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. Exceptions: skills generate always requires it; 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
/ prefix — /facebook/react not facebook/reactctx7 library first — ctx7 docs react "hooks" will fail without a valid ID/owner/repo — e.g., ctx7 skills install /anthropics/skillsskills generate requires login — run ctx7 login firstWeekly Installs
351
Repository
GitHub Stars
50.5K
First Seen
14 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
codex333
github-copilot326
opencode326
gemini-cli325
amp325
kimi-cli325
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装
Nuxt UI v4 组件库 | Vue 3 & Nuxt 4+ 开发必备 | 基于 Tailwind CSS
3,300 周安装
UI/UX Pro Max 设计指南:避免AI生成感,打造高级SaaS/着陆页设计原则与实现
3,400 周安装
Three.js 动画教程 - 从程序化动画到关键帧系统完整指南
3,300 周安装
Angular v20+ 测试指南:使用 Vitest 测试信号组件与最佳实践
3,300 周安装
后端架构模式与最佳实践 - REST/GraphQL API设计、仓储模式、服务层优化
3,400 周安装
Deep Agents Memory:LangChain AI 智能体内存管理 - 临时与持久化存储解决方案
3,500 周安装