MCPcopy
hub / github.com/upstash/context7 / registerSetupCommand

Function registerSetupCommand

packages/cli/src/commands/setup.ts:80–100  ·  view source on GitHub ↗
(program: Command)

Source from the content-addressed store, hash-verified

78}
79
80export function registerSetupCommand(program: Command): void {
81 program
82 .command("setup")
83 .description("Set up Context7 for your AI coding agent")
84 .option("--claude", "Set up for Claude Code")
85 .option("--cursor", "Set up for Cursor")
86 .option("--antigravity", "Set up for Antigravity (.agent/skills)")
87 .option("--opencode", "Set up for OpenCode")
88 .option("--codex", "Set up for Codex")
89 .option("--gemini", "Set up for Gemini CLI")
90 .option("--mcp", "Set up MCP server mode")
91 .option("--cli", "Set up CLI + Skills mode (no MCP server)")
92 .option("-p, --project", "Configure for current project instead of globally")
93 .option("-y, --yes", "Skip confirmation prompts")
94 .option("--api-key <key>", "Use API key authentication")
95 .option("--oauth", "Use OAuth endpoint (IDE handles auth flow)")
96 .option("--stdio", "Configure the MCP server as a local stdio process (default: HTTP)")
97 .action(async (options: SetupOptions) => {
98 await setupCommand(options);
99 });
100}
101
102async function authenticateAndGenerateKey(): Promise<string | null> {
103 const accessToken = (await getValidAccessToken()) ?? (await performLogin());

Callers 1

index.tsFile · 0.85

Calls 1

setupCommandFunction · 0.85

Tested by

no test coverage detected