Use Claude Code with your ChatGPT, Kimi, Cursor or Grok subscription via a local Anthropic-compatible proxy
Rust
compact startup model listing
Raine Virta0f66c52ecca3
diff --git a/src/cli.ts b/src/cli.tsindex a09af7b..9122cd7 100755--- a/src/cli.ts+++ b/src/cli.ts@@ -8,7 +8,6 @@ import {} from "./config.ts";import { existsSync } from "node:fs";import {- allSupportedModels,getProvider,groupSupportedModelsByProvider,listProviders,@@ -52,6 +51,11 @@ async function main() {return;}+ if (first === "models") {+ printSupportedModels({ full: rest.includes("--full") });+ return;+ }+if (listProviders().includes(first)) {const provider = getProvider(first);await runProviderCommand(provider.name, provider.cli, rest);@@ -93,12 +97,12 @@ async function runProviderCommand(name: string, cli: CliHandlers, args: string[]function usageAndExit(): never {const providers = listProviders().join("|");- const models = allSupportedModels()- .map((m) => `${m.model} (${m.provider})`)- .join(", ");+ const models = compactSupportedModelsSummary();console.log(`Usage:claude-code-proxy serve Run proxy (PORT env or config.json port, default 18765)Upstream is chosen per-request from ANTHROPIC_MODEL.+ claude-code-proxy models Show compact model list+ claude-code-proxy models --full Show every supported model aliasclaude-code-proxy <provider> auth login Browser OAuthclaude-code-proxy <provider> auth device Device-code OAuthclaude-code-proxy <provider> auth status Show current auth@@ -106,19 +110,56 @@ function usageAndExit(): never {claude-code-proxy --version Show versionProviders: ${providers}-Models: ${models}+Models:+${models}`);process.exit(2);}-function printSupportedModels(): void {+function printSupportedModels(opts: { full?: boolean } = {}): void {const groups = groupSupportedModelsByProvider();for (const provider of listProviders()) {const models = groups.get(provider) ?? [];- console.log(` ${provider}: ${models.join(", ")}`);+ console.log(` ${provider}: ${formatProviderModels(provider, models, opts)}`);}}+function compactSupportedModelsSummary(): string {+ const groups = groupSupportedModelsByProvider();+ return listProviders()+ .map((provider) => ` ${provider}: ${formatProviderModels(provider, groups.get(provider) ?? [])}`)+ .join("\n");+}++function formatProviderModels(provider: string, models: string[], opts: { full?: boolean } = {}): string {+ if (opts.full || provider !== "cursor") return models.join(", ");+ return formatCursorModels(models);+}++function formatCursorModels(models: string[]): string {+ const legacy = models.filter((model) => !model.includes(":"));+ const rawIds = new Set<string>();+ for (const model of models) {+ for (const prefix of ["cursor:", "cursor-plan:", "cursor-ask:"]) {+ if (model.startsWith(prefix)) rawIds.add(model.slice(prefix.length));+ }+ }++ const examples = [+ "cursor:gemini-3.1-pro",+ "cursor:gpt-5.5-high",+ "cursor-plan:gpt-5.5-high",+ "cursor-ask:gpt-5.5-high",+ ].filter((model) => models.includes(model));++ return [+ ...legacy,+ examples.length ? `examples: ${examples.join(", ")}` : undefined,+ `${rawIds.size} Cursor catalog models via cursor:<id>, cursor-plan:<id>, cursor-ask:<id>`,+ "run `claude-code-proxy models --full` for all aliases",+ ].filter(Boolean).join("; ");+}+function printConfigSummary(): void {const path = configPath();if (existsSync(path)) {