Skip to content

Commit 268f52f

Browse files
fix(cli): --api-key alone no longer forces MCP mode in setup (#2713)
resolveMode treated --api-key as a non-interactive marker and short-circuited to MCP, but --api-key is equally valid for CLI + Skills mode (which authenticates skill downloads). Users who preferred CLI mode were silently locked into MCP unless they also passed --cli. Remove options.apiKey from the auto-MCP OR-chain. --mcp / --cli / --stdio / --oauth / -y still skip the prompt; --api-key alone now falls through to the interactive mode picker.
1 parent 2affada commit 268f52f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"ctx7": patch
3+
---
4+
5+
`ctx7 setup --api-key <KEY>` (without `--cli`, `--mcp`, or `-y`) now prompts to choose between MCP server and CLI + Skills modes. Previously, passing `--api-key` short-circuited to MCP, locking users out of the CLI + Skills option even though that mode also accepts an API key. Explicit `--mcp` / `--cli` / `--stdio` / `--oauth` / `-y` still skip the prompt as before.

packages/cli/src/commands/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async function resolveAuth(options: SetupOptions): Promise<AuthOptions | null> {
144144

145145
async function resolveMode(options: SetupOptions): Promise<SetupMode> {
146146
if (options.cli) return "cli";
147-
if (options.mcp || options.yes || options.oauth || options.apiKey || options.stdio) return "mcp";
147+
if (options.mcp || options.yes || options.oauth || options.stdio) return "mcp";
148148

149149
return select<SetupMode>({
150150
message: "How should your agent access Context7?",

0 commit comments

Comments
 (0)