ctx7 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -137
- package/dist/index.js +61 -39
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# ctx7
|
|
2
2
|
|
|
3
|
-
CLI for [Context7](https://context7.com) - query up-to-date library documentation and
|
|
4
|
-
|
|
5
|
-
Skills are reusable prompt instructions that enhance your AI coding assistant with specialized capabilities like working with specific frameworks, libraries, or coding patterns.
|
|
3
|
+
CLI for [Context7](https://context7.com) - query up-to-date library documentation and configure Context7 for AI coding agents.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
@@ -41,22 +39,6 @@ ctx7 docs /facebook/react "useEffect cleanup"
|
|
|
41
39
|
ctx7 docs /vercel/next.js "middleware"
|
|
42
40
|
```
|
|
43
41
|
|
|
44
|
-
### Skills
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
# Search for skills
|
|
48
|
-
ctx7 skills search pdf
|
|
49
|
-
|
|
50
|
-
# Install a skill
|
|
51
|
-
ctx7 skills install /anthropics/skills pdf
|
|
52
|
-
|
|
53
|
-
# Generate a custom skill with AI
|
|
54
|
-
ctx7 skills generate
|
|
55
|
-
|
|
56
|
-
# List installed skills
|
|
57
|
-
ctx7 skills list --claude
|
|
58
|
-
```
|
|
59
|
-
|
|
60
42
|
## Usage
|
|
61
43
|
|
|
62
44
|
### Find a library
|
|
@@ -133,42 +115,9 @@ ctx7 remove --claude --mcp
|
|
|
133
115
|
|
|
134
116
|
If you installed the CLI itself globally with `npm install -g ctx7`, remove that separately with `npm uninstall -g ctx7`. If you use `npx ctx7`, there is no permanent CLI install to remove.
|
|
135
117
|
|
|
136
|
-
### Generate skills
|
|
137
|
-
|
|
138
|
-
Generate custom skills tailored to your use case using AI. Requires authentication.
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# Log in first
|
|
142
|
-
ctx7 login
|
|
143
|
-
|
|
144
|
-
# Generate a skill (interactive)
|
|
145
|
-
ctx7 skills generate
|
|
146
|
-
|
|
147
|
-
# Short aliases
|
|
148
|
-
ctx7 skills gen
|
|
149
|
-
ctx7 skills g
|
|
150
|
-
|
|
151
|
-
# Generate and install to a specific client
|
|
152
|
-
ctx7 skills generate --cursor
|
|
153
|
-
ctx7 skills generate --claude
|
|
154
|
-
ctx7 skills generate --universal
|
|
155
|
-
|
|
156
|
-
# Generate globally
|
|
157
|
-
ctx7 skills generate --global
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
The generate flow:
|
|
161
|
-
|
|
162
|
-
1. Describe the expertise you want (e.g., "OAuth authentication with NextAuth.js")
|
|
163
|
-
2. Select relevant libraries from search results
|
|
164
|
-
3. Answer 3 clarifying questions to focus the skill
|
|
165
|
-
4. Review the generated skill, request changes if needed, then install
|
|
166
|
-
|
|
167
|
-
Weekly generation limits apply: free accounts get 6 generations/week, Pro accounts get 10.
|
|
168
|
-
|
|
169
118
|
### Authentication
|
|
170
119
|
|
|
171
|
-
Log in to access
|
|
120
|
+
Log in to access authenticated setup and higher documentation rate limits.
|
|
172
121
|
|
|
173
122
|
```bash
|
|
174
123
|
# Log in (opens browser for OAuth)
|
|
@@ -181,79 +130,9 @@ ctx7 whoami
|
|
|
181
130
|
ctx7 logout
|
|
182
131
|
```
|
|
183
132
|
|
|
184
|
-
### Install skills
|
|
185
|
-
|
|
186
|
-
Install skills from a project repository to your AI coding assistant's skills directory.
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
# Install all skills from a project (interactive selection)
|
|
190
|
-
ctx7 skills install /anthropics/skills
|
|
191
|
-
|
|
192
|
-
# Install a specific skill
|
|
193
|
-
ctx7 skills install /anthropics/skills pdf
|
|
194
|
-
|
|
195
|
-
# Install multiple skills at once
|
|
196
|
-
ctx7 skills install /anthropics/skills pdf commit
|
|
197
|
-
|
|
198
|
-
# Install to a specific client
|
|
199
|
-
ctx7 skills install /anthropics/skills pdf --cursor
|
|
200
|
-
ctx7 skills install /anthropics/skills pdf --claude
|
|
201
|
-
ctx7 skills install /anthropics/skills pdf --universal
|
|
202
|
-
|
|
203
|
-
# Install globally (home directory instead of current project)
|
|
204
|
-
ctx7 skills install /anthropics/skills pdf --global
|
|
205
|
-
|
|
206
|
-
# Install non-interactively
|
|
207
|
-
ctx7 skills install /anthropics/skills pdf --global --universal --yes
|
|
208
|
-
|
|
209
|
-
# Install to all supported agent locations
|
|
210
|
-
ctx7 skills install /anthropics/skills pdf --all-agents
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
### Search for skills
|
|
214
|
-
|
|
215
|
-
Find skills across all indexed projects in the registry.
|
|
216
|
-
|
|
217
|
-
```bash
|
|
218
|
-
ctx7 skills search pdf
|
|
219
|
-
ctx7 skills search typescript
|
|
220
|
-
ctx7 skills search react testing
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### List installed skills
|
|
224
|
-
|
|
225
|
-
View skills installed in your project or globally.
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
ctx7 skills list
|
|
229
|
-
ctx7 skills list --claude
|
|
230
|
-
ctx7 skills list --cursor
|
|
231
|
-
ctx7 skills list --universal
|
|
232
|
-
ctx7 skills list --global
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Show skill information
|
|
236
|
-
|
|
237
|
-
Get details about available skills in a project.
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
ctx7 skills info /anthropics/skills
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### Remove a skill
|
|
244
|
-
|
|
245
|
-
Uninstall a skill from your project.
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
ctx7 skills remove pdf
|
|
249
|
-
ctx7 skills remove pdf --claude
|
|
250
|
-
ctx7 skills remove pdf --universal
|
|
251
|
-
ctx7 skills remove pdf --global
|
|
252
|
-
```
|
|
253
|
-
|
|
254
133
|
## Supported Clients
|
|
255
134
|
|
|
256
|
-
The CLI automatically detects which AI coding assistants you have installed and
|
|
135
|
+
The CLI automatically detects which AI coding assistants you have installed and configures Context7 for them:
|
|
257
136
|
|
|
258
137
|
| Client | Skills Directory |
|
|
259
138
|
| ------------------------------------------------------------------- | ----------------- |
|
|
@@ -262,24 +141,13 @@ The CLI automatically detects which AI coding assistants you have installed and
|
|
|
262
141
|
| Cursor | `.cursor/skills/` |
|
|
263
142
|
| Antigravity | `.agent/skills/` |
|
|
264
143
|
|
|
265
|
-
## Shortcuts
|
|
266
|
-
|
|
267
|
-
For faster usage, the CLI provides short aliases:
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
ctx7 si /anthropics/skills pdf # skills install
|
|
271
|
-
ctx7 ss pdf # skills search
|
|
272
|
-
ctx7 skills gen # skills generate
|
|
273
|
-
ctx7 skills g # skills generate
|
|
274
|
-
```
|
|
275
|
-
|
|
276
144
|
## Disabling Telemetry
|
|
277
145
|
|
|
278
146
|
The CLI collects anonymous usage data to help improve the product. To disable telemetry, set the `CTX7_TELEMETRY_DISABLED` environment variable:
|
|
279
147
|
|
|
280
148
|
```bash
|
|
281
149
|
# For a single command
|
|
282
|
-
CTX7_TELEMETRY_DISABLED=1 ctx7
|
|
150
|
+
CTX7_TELEMETRY_DISABLED=1 ctx7 docs /facebook/react "useEffect examples"
|
|
283
151
|
|
|
284
152
|
# Or export in your shell profile (~/.bashrc, ~/.zshrc, etc.)
|
|
285
153
|
export CTX7_TELEMETRY_DISABLED=1
|
|
@@ -287,4 +155,4 @@ export CTX7_TELEMETRY_DISABLED=1
|
|
|
287
155
|
|
|
288
156
|
## Learn More
|
|
289
157
|
|
|
290
|
-
Visit [context7.com](https://context7.com)
|
|
158
|
+
Visit [context7.com](https://context7.com) for documentation lookup and setup guides.
|
package/dist/index.js
CHANGED
|
@@ -1911,6 +1911,11 @@ async function detectProjectDependencies(cwd) {
|
|
|
1911
1911
|
}
|
|
1912
1912
|
|
|
1913
1913
|
// src/commands/skill.ts
|
|
1914
|
+
var SKILL_HUB_DEPRECATION_WARNING = "Warning: Skill commands are deprecated and will stop working in the next major release.";
|
|
1915
|
+
function warnSkillHubDeprecated() {
|
|
1916
|
+
console.error(pc7.yellow(SKILL_HUB_DEPRECATION_WARNING));
|
|
1917
|
+
console.error("");
|
|
1918
|
+
}
|
|
1914
1919
|
function logInstallSummary(targets, targetDirs, skillNames) {
|
|
1915
1920
|
log.blank();
|
|
1916
1921
|
const hasUniversal = targets.ides.some((ide) => ide === "universal");
|
|
@@ -1934,7 +1939,9 @@ function logInstallSummary(targets, targetDirs, skillNames) {
|
|
|
1934
1939
|
log.blank();
|
|
1935
1940
|
}
|
|
1936
1941
|
function registerSkillCommands(program2) {
|
|
1937
|
-
const skill = program2.command("skills").alias("skill").description("Manage AI coding skills")
|
|
1942
|
+
const skill = program2.command("skills", { hidden: true }).alias("skill").description("Manage AI coding skills").hook("preAction", () => {
|
|
1943
|
+
warnSkillHubDeprecated();
|
|
1944
|
+
});
|
|
1938
1945
|
registerGenerateCommand(skill);
|
|
1939
1946
|
skill.command("install").alias("i").alias("add").argument("<repository>", "GitHub repository (/owner/repo)").argument("[skill]", "Specific skill name to install").option("--all", "Install all skills without prompting").option("--all-agents", "Install to all supported agent locations").option("-y, --yes", "Skip confirmation prompts").option("--global", "Install globally instead of current directory").option("--claude", "Claude Code (.claude/skills/)").option("--cursor", "Cursor (.cursor/skills/)").option("--universal", "Universal (.agents/skills/)").option("--antigravity", "Antigravity (.agent/skills/)").description("Install skills from a repository").action(async (project, skillName, options) => {
|
|
1940
1947
|
await installCommand(project, skillName, options);
|
|
@@ -1957,12 +1964,15 @@ function registerSkillCommands(program2) {
|
|
|
1957
1964
|
}
|
|
1958
1965
|
function registerSkillAliases(program2) {
|
|
1959
1966
|
program2.command("si", { hidden: true }).argument("<repository>", "GitHub repository (/owner/repo)").argument("[skill]", "Specific skill name to install").option("--all", "Install all skills without prompting").option("--all-agents", "Install to all supported agent locations").option("-y, --yes", "Skip confirmation prompts").option("--global", "Install globally instead of current directory").option("--claude", "Claude Code (.claude/skills/)").option("--cursor", "Cursor (.cursor/skills/)").option("--universal", "Universal (.agents/skills/)").option("--antigravity", "Antigravity (.agent/skills/)").description("Install skills (alias for: skills install)").action(async (project, skillName, options) => {
|
|
1967
|
+
warnSkillHubDeprecated();
|
|
1960
1968
|
await installCommand(project, skillName, options);
|
|
1961
1969
|
});
|
|
1962
1970
|
program2.command("ss", { hidden: true }).argument("<keywords...>", "Search keywords").description("Search for skills (alias for: skills search)").action(async (keywords) => {
|
|
1971
|
+
warnSkillHubDeprecated();
|
|
1963
1972
|
await searchCommand(keywords.join(" "));
|
|
1964
1973
|
});
|
|
1965
1974
|
program2.command("ssg", { hidden: true }).option("--global", "Install globally instead of current directory").option("--claude", "Claude Code (.claude/skills/)").option("--cursor", "Cursor (.cursor/skills/)").option("--universal", "Universal (.agents/skills/)").option("--antigravity", "Antigravity (.agent/skills/)").description("Suggest skills (alias for: skills suggest)").action(async (options) => {
|
|
1975
|
+
warnSkillHubDeprecated();
|
|
1966
1976
|
await suggestCommand(options);
|
|
1967
1977
|
});
|
|
1968
1978
|
}
|
|
@@ -2053,7 +2063,7 @@ async function installCommand(input2, skillName, options) {
|
|
|
2053
2063
|
const paddedName = s.name.padEnd(maxNameLen);
|
|
2054
2064
|
const popularity = formatPopularity(s.installCount) + " ".repeat(popularityColWidth - 4);
|
|
2055
2065
|
const trust = formatTrust(s.trustScore);
|
|
2056
|
-
const skillUrl = `https://
|
|
2066
|
+
const skillUrl = s.url || `https://github.com${s.project}`;
|
|
2057
2067
|
const skillLink = terminalLink(s.name, skillUrl, pc7.white);
|
|
2058
2068
|
const repoLink = terminalLink(s.project, `https://github.com${s.project}`, pc7.white);
|
|
2059
2069
|
const metadataLines = [
|
|
@@ -2204,11 +2214,7 @@ async function searchCommand(query) {
|
|
|
2204
2214
|
const displayName = nameWithRepo(s) + " ".repeat(maxNameLen - rawLen);
|
|
2205
2215
|
const popularity = formatPopularity(s.installCount) + " ".repeat(popularityColWidth - 4);
|
|
2206
2216
|
const trust = formatTrust(s.trustScore);
|
|
2207
|
-
const skillLink = terminalLink(
|
|
2208
|
-
s.name,
|
|
2209
|
-
`https://context7.com/skills${s.project}/${s.name}`,
|
|
2210
|
-
pc7.white
|
|
2211
|
-
);
|
|
2217
|
+
const skillLink = terminalLink(s.name, s.url || `https://github.com${s.project}`, pc7.white);
|
|
2212
2218
|
const repoLink = terminalLink(s.project, `https://github.com${s.project}`, pc7.white);
|
|
2213
2219
|
const metadataLines = [
|
|
2214
2220
|
pc7.dim("\u2500".repeat(50)),
|
|
@@ -2513,11 +2519,7 @@ async function suggestCommand(options) {
|
|
|
2513
2519
|
const trustLabel = getTrustLabel(s.trustScore);
|
|
2514
2520
|
const trust = formatTrust(s.trustScore) + " ".repeat(trustColWidth - trustLabel.length);
|
|
2515
2521
|
const matched = pc7.yellow(s.matchedDep.padEnd(maxMatchedLen));
|
|
2516
|
-
const skillLink = terminalLink(
|
|
2517
|
-
s.name,
|
|
2518
|
-
`https://context7.com/skills${s.project}/${s.name}`,
|
|
2519
|
-
pc7.white
|
|
2520
|
-
);
|
|
2522
|
+
const skillLink = terminalLink(s.name, s.url || `https://github.com${s.project}`, pc7.white);
|
|
2521
2523
|
const repoLink = terminalLink(s.project, `https://github.com${s.project}`, pc7.white);
|
|
2522
2524
|
const metadataLines = [
|
|
2523
2525
|
pc7.dim("\u2500".repeat(50)),
|
|
@@ -2651,6 +2653,7 @@ var SETUP_AGENT_NAMES = {
|
|
|
2651
2653
|
cursor: "Cursor",
|
|
2652
2654
|
opencode: "OpenCode",
|
|
2653
2655
|
codex: "Codex",
|
|
2656
|
+
antigravity: "Antigravity",
|
|
2654
2657
|
gemini: "Gemini CLI"
|
|
2655
2658
|
};
|
|
2656
2659
|
var AUTH_MODE_LABELS = {
|
|
@@ -2789,6 +2792,33 @@ var agents = {
|
|
|
2789
2792
|
globalPaths: [join7(homedir5(), ".codex")]
|
|
2790
2793
|
}
|
|
2791
2794
|
},
|
|
2795
|
+
// Antigravity is built on Gemini infrastructure and shares ~/.gemini/. Per
|
|
2796
|
+
// the official Codelabs guide, Antigravity 2.0/IDE/CLI read MCP servers from
|
|
2797
|
+
// ~/.gemini/config/mcp_config.json globally; there is no project-level MCP
|
|
2798
|
+
// config, so projectPaths is empty and setupAgent falls back to global.
|
|
2799
|
+
antigravity: {
|
|
2800
|
+
name: "antigravity",
|
|
2801
|
+
displayName: "Antigravity",
|
|
2802
|
+
mcp: {
|
|
2803
|
+
projectPaths: [],
|
|
2804
|
+
globalPaths: [join7(homedir5(), ".gemini", "config", "mcp_config.json")],
|
|
2805
|
+
configKey: "mcpServers",
|
|
2806
|
+
buildEntry: (auth, transport) => transport === "stdio" ? stdioEntry(auth) : withHeaders({ serverUrl: mcpUrl(auth) }, auth)
|
|
2807
|
+
},
|
|
2808
|
+
rule: {
|
|
2809
|
+
kind: "append",
|
|
2810
|
+
file: (scope) => scope === "global" ? join7(homedir5(), ".gemini", "GEMINI.md") : "GEMINI.md",
|
|
2811
|
+
sectionMarker: "<!-- context7 -->"
|
|
2812
|
+
},
|
|
2813
|
+
skill: {
|
|
2814
|
+
name: "context7-mcp",
|
|
2815
|
+
dir: (scope) => scope === "global" ? join7(homedir5(), ".agent", "skills") : join7(".agent", "skills")
|
|
2816
|
+
},
|
|
2817
|
+
detect: {
|
|
2818
|
+
projectPaths: [".agent"],
|
|
2819
|
+
globalPaths: [join7(homedir5(), ".gemini", "antigravity"), join7(homedir5(), ".agent")]
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2792
2822
|
gemini: {
|
|
2793
2823
|
name: "gemini",
|
|
2794
2824
|
displayName: "Gemini CLI",
|
|
@@ -3187,11 +3217,12 @@ function getSelectedAgents(options) {
|
|
|
3187
3217
|
if (options.cursor) agents2.push("cursor");
|
|
3188
3218
|
if (options.opencode) agents2.push("opencode");
|
|
3189
3219
|
if (options.codex) agents2.push("codex");
|
|
3220
|
+
if (options.antigravity) agents2.push("antigravity");
|
|
3190
3221
|
if (options.gemini) agents2.push("gemini");
|
|
3191
3222
|
return agents2;
|
|
3192
3223
|
}
|
|
3193
3224
|
function registerSetupCommand(program2) {
|
|
3194
|
-
program2.command("setup").description("Set up Context7 for your AI coding agent").option("--claude", "Set up for Claude Code").option("--cursor", "Set up for Cursor").option("--
|
|
3225
|
+
program2.command("setup").description("Set up Context7 for your AI coding agent").option("--claude", "Set up for Claude Code").option("--cursor", "Set up for Cursor").option("--antigravity", "Set up for Antigravity (.agent/skills)").option("--opencode", "Set up for OpenCode").option("--codex", "Set up for Codex").option("--gemini", "Set up for Gemini CLI").option("--mcp", "Set up MCP server mode").option("--cli", "Set up CLI + Skills mode (no MCP server)").option("-p, --project", "Configure for current project instead of globally").option("-y, --yes", "Skip confirmation prompts").option("--api-key <key>", "Use API key authentication").option("--oauth", "Use OAuth endpoint (IDE handles auth flow)").option("--stdio", "Configure the MCP server as a local stdio process (default: HTTP)").action(async (options) => {
|
|
3195
3226
|
await setupCommand(options);
|
|
3196
3227
|
});
|
|
3197
3228
|
}
|
|
@@ -3232,7 +3263,7 @@ async function resolveAuth(options) {
|
|
|
3232
3263
|
}
|
|
3233
3264
|
async function resolveMode(options) {
|
|
3234
3265
|
if (options.cli) return "cli";
|
|
3235
|
-
if (options.mcp || options.yes || options.oauth || options.
|
|
3266
|
+
if (options.mcp || options.yes || options.oauth || options.stdio) return "mcp";
|
|
3236
3267
|
return select3({
|
|
3237
3268
|
message: "How should your agent access Context7?",
|
|
3238
3269
|
choices: [
|
|
@@ -3343,7 +3374,7 @@ function resolveEntryToWrite(agent, auth, transport, existingEntry) {
|
|
|
3343
3374
|
}
|
|
3344
3375
|
async function setupAgent(agentName, auth, transport, scope) {
|
|
3345
3376
|
const agent = getAgent(agentName);
|
|
3346
|
-
const mcpCandidates = scope === "global" ? agent.mcp.globalPaths : agent.mcp.projectPaths.map((p) => join8(process.cwd(), p));
|
|
3377
|
+
const mcpCandidates = scope === "global" || agent.mcp.projectPaths.length === 0 ? agent.mcp.globalPaths : agent.mcp.projectPaths.map((p) => join8(process.cwd(), p));
|
|
3347
3378
|
const mcpPath = await resolveMcpPath(mcpCandidates);
|
|
3348
3379
|
let mcpStatus;
|
|
3349
3380
|
try {
|
|
@@ -3545,7 +3576,7 @@ var MODE_LABELS = {
|
|
|
3545
3576
|
cli: "CLI + Skills"
|
|
3546
3577
|
};
|
|
3547
3578
|
function registerRemoveCommand(program2) {
|
|
3548
|
-
program2.command("remove").alias("uninstall").description("Remove Context7 setup from your AI coding agent").option("--claude", "Remove from Claude Code").option("--cursor", "Remove from Cursor").option("--opencode", "Remove from OpenCode").option("--codex", "Remove from Codex").option("--gemini", "Remove from Gemini CLI").option("--all", "Remove both MCP setup and CLI + Skills setup").option("--mcp", "Remove MCP setup").option("--cli", "Remove CLI + Skills setup").option("-p, --project", "Remove from the current project instead of global config").option("-y, --yes", "Skip confirmation prompts").action(async (options) => {
|
|
3579
|
+
program2.command("remove").alias("uninstall").description("Remove Context7 setup from your AI coding agent").option("--claude", "Remove from Claude Code").option("--cursor", "Remove from Cursor").option("--opencode", "Remove from OpenCode").option("--codex", "Remove from Codex").option("--antigravity", "Remove from Antigravity").option("--gemini", "Remove from Gemini CLI").option("--all", "Remove both MCP setup and CLI + Skills setup").option("--mcp", "Remove MCP setup").option("--cli", "Remove CLI + Skills setup").option("-p, --project", "Remove from the current project instead of global config").option("-y, --yes", "Skip confirmation prompts").action(async (options) => {
|
|
3549
3580
|
await removeCommand2(options);
|
|
3550
3581
|
});
|
|
3551
3582
|
}
|
|
@@ -3555,6 +3586,7 @@ function getSelectedAgents2(options) {
|
|
|
3555
3586
|
if (options.cursor) agents2.push("cursor");
|
|
3556
3587
|
if (options.opencode) agents2.push("opencode");
|
|
3557
3588
|
if (options.codex) agents2.push("codex");
|
|
3589
|
+
if (options.antigravity) agents2.push("antigravity");
|
|
3558
3590
|
if (options.gemini) agents2.push("gemini");
|
|
3559
3591
|
return agents2;
|
|
3560
3592
|
}
|
|
@@ -3606,7 +3638,7 @@ async function resolveAgents2(options, scope) {
|
|
|
3606
3638
|
if (detected.length > 0 && options.yes) return detected;
|
|
3607
3639
|
if (detected.length === 0) {
|
|
3608
3640
|
log.warn(
|
|
3609
|
-
"No Context7 setup detected. Pass --claude, --cursor, --opencode, --codex, or --gemini."
|
|
3641
|
+
"No Context7 setup detected. Pass --claude, --cursor, --opencode, --codex, --antigravity, or --gemini."
|
|
3610
3642
|
);
|
|
3611
3643
|
return [];
|
|
3612
3644
|
}
|
|
@@ -3635,6 +3667,7 @@ async function pathExists2(path2) {
|
|
|
3635
3667
|
}
|
|
3636
3668
|
async function hasMcpConfig(agentName, scope) {
|
|
3637
3669
|
const agent = getAgent(agentName);
|
|
3670
|
+
if (scope === "project" && agent.mcp.projectPaths.length === 0) return false;
|
|
3638
3671
|
const candidates = scope === "global" ? agent.mcp.globalPaths : agent.mcp.projectPaths.map((path2) => join9(process.cwd(), path2));
|
|
3639
3672
|
const mcpPath = await resolveMcpPath(candidates);
|
|
3640
3673
|
if (mcpPath.endsWith(".toml")) {
|
|
@@ -3722,6 +3755,9 @@ async function resolveModes(options, agents2, scope) {
|
|
|
3722
3755
|
}
|
|
3723
3756
|
async function uninstallMcp(agentName, scope) {
|
|
3724
3757
|
const agent = getAgent(agentName);
|
|
3758
|
+
if (scope === "project" && agent.mcp.projectPaths.length === 0) {
|
|
3759
|
+
return { status: "not found", path: "" };
|
|
3760
|
+
}
|
|
3725
3761
|
const mcpCandidates = scope === "global" ? agent.mcp.globalPaths : agent.mcp.projectPaths.map((path2) => join9(process.cwd(), path2));
|
|
3726
3762
|
const mcpPath = await resolveMcpPath(mcpCandidates);
|
|
3727
3763
|
try {
|
|
@@ -4364,7 +4400,7 @@ var brand = {
|
|
|
4364
4400
|
dim: pc12.dim
|
|
4365
4401
|
};
|
|
4366
4402
|
var program = new Command();
|
|
4367
|
-
program.name("ctx7").description("Context7 CLI -
|
|
4403
|
+
program.name("ctx7").description("Context7 CLI - Fetch documentation context and configure Context7").version(VERSION).option("--base-url <url>").hook("preAction", (thisCommand) => {
|
|
4368
4404
|
const opts = thisCommand.opts();
|
|
4369
4405
|
if (opts.baseUrl) {
|
|
4370
4406
|
setBaseUrl(opts.baseUrl);
|
|
@@ -4379,21 +4415,10 @@ program.name("ctx7").description("Context7 CLI - Manage AI coding skills and doc
|
|
|
4379
4415
|
"after",
|
|
4380
4416
|
`
|
|
4381
4417
|
Examples:
|
|
4382
|
-
${brand.dim("#
|
|
4383
|
-
${brand.primary("npx ctx7
|
|
4384
|
-
${brand.primary("npx ctx7
|
|
4385
|
-
|
|
4386
|
-
${brand.dim("# Install from a repository")}
|
|
4387
|
-
${brand.primary("npx ctx7 skills install /anthropics/skills")}
|
|
4388
|
-
${brand.primary("npx ctx7 skills install /anthropics/skills pdf")}
|
|
4389
|
-
|
|
4390
|
-
${brand.dim("# Install to specific client")}
|
|
4391
|
-
${brand.primary("npx ctx7 skills install /anthropics/skills --cursor")}
|
|
4392
|
-
${brand.primary("npx ctx7 skills install /anthropics/skills --global")}
|
|
4393
|
-
|
|
4394
|
-
${brand.dim("# List and manage installed skills")}
|
|
4395
|
-
${brand.primary("npx ctx7 skills list --claude")}
|
|
4396
|
-
${brand.primary("npx ctx7 skills remove pdf")}
|
|
4418
|
+
${brand.dim("# Configure Context7 for your coding agent")}
|
|
4419
|
+
${brand.primary("npx ctx7 setup")}
|
|
4420
|
+
${brand.primary("npx ctx7 setup --mcp")}
|
|
4421
|
+
${brand.primary("npx ctx7 setup --cli")}
|
|
4397
4422
|
|
|
4398
4423
|
${brand.dim("# Remove Context7 setup")}
|
|
4399
4424
|
${brand.primary("npx ctx7 remove --cursor")}
|
|
@@ -4404,8 +4429,6 @@ Examples:
|
|
|
4404
4429
|
${brand.dim("# Query library documentation")}
|
|
4405
4430
|
${brand.primary('npx ctx7 library react "how to use hooks"')}
|
|
4406
4431
|
${brand.primary('npx ctx7 docs /facebook/react "useEffect examples"')}
|
|
4407
|
-
|
|
4408
|
-
Visit ${brand.primary("https://context7.com")} to browse skills
|
|
4409
4432
|
`
|
|
4410
4433
|
);
|
|
4411
4434
|
registerSkillCommands(program);
|
|
@@ -4419,14 +4442,13 @@ program.action(() => {
|
|
|
4419
4442
|
console.log("");
|
|
4420
4443
|
const banner = figlet.textSync("Context7", { font: "ANSI Shadow" });
|
|
4421
4444
|
console.log(brand.primary(banner));
|
|
4422
|
-
console.log(brand.dim("
|
|
4445
|
+
console.log(brand.dim(" Documentation context for AI coding agents"));
|
|
4423
4446
|
console.log("");
|
|
4424
4447
|
console.log(" Quick start:");
|
|
4425
|
-
console.log(` ${brand.primary("npx ctx7
|
|
4426
|
-
console.log(` ${brand.primary(
|
|
4448
|
+
console.log(` ${brand.primary("npx ctx7 setup")}`);
|
|
4449
|
+
console.log(` ${brand.primary('npx ctx7 docs /facebook/react "useEffect examples"')}`);
|
|
4427
4450
|
console.log("");
|
|
4428
4451
|
console.log(` Run ${brand.primary("npx ctx7 --help")} for all commands and options`);
|
|
4429
|
-
console.log(` Visit ${brand.primary("https://context7.com")} to browse skills`);
|
|
4430
4452
|
console.log("");
|
|
4431
4453
|
});
|
|
4432
4454
|
await program.parseAsync();
|