Skip to content

Commit 5f4cd2a

Browse files
committed
feat(cli): add claude command to status output and enhance claude --help
- Show claude and claude --model in the commands section of default output - List available models and usage examples in claude --help - Document --model behavior with ANTHROPIC_MODEL/ANTHROPIC_CUSTOM_MODEL_OPTION
1 parent 1ded0d4 commit 5f4cd2a

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

packages/x402-proxy/src/commands/claude.ts

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ import { startServeServer } from "./serve.js";
66

77
const DEFAULT_MODEL = "stepfun/step-3.5-flash";
88

9+
const AVAILABLE_MODELS = [
10+
"stepfun/step-3.5-flash",
11+
"minimax/minimax-m2.5",
12+
"minimax/minimax-m2.7",
13+
"z-ai/glm-5",
14+
"z-ai/glm-5-turbo",
15+
"moonshotai/kimi-k2.5",
16+
];
17+
const modelList = AVAILABLE_MODELS.map((id) => ` ${id}`).join("\n");
18+
919
type ClaudeFlags = {
1020
model: string;
1121
upstream: string | undefined;
@@ -23,12 +33,22 @@ function normalizeClaudeArgs(args: string[]): string[] {
2333
export const claudeCommand = buildCommand<ClaudeFlags, string[], CommandContext>({
2434
docs: {
2535
brief: "Run Claude Code through a paid local proxy",
26-
fullDescription: `Start a local x402-proxy server and launch Claude Code with ANTHROPIC_BASE_URL pointed at it.
36+
fullDescription: `Starts a local x402-proxy server and launches Claude Code with
37+
ANTHROPIC_BASE_URL pointed at it. All inference requests go through
38+
the proxy, which handles payments automatically via MPP.
39+
40+
Usage:
41+
$ x402-proxy claude Start with default model
42+
$ x402-proxy claude --model z-ai/glm-5 Use a specific model
43+
$ x402-proxy claude -- --print "explain this" Pass args to Claude Code
44+
$ x402-proxy claude -- -p "summarize *.ts" Print mode (non-interactive)
45+
46+
Available models (via surf.cascade.fyi):
47+
${modelList}
2748
28-
Examples:
29-
$ x402-proxy claude
30-
$ x402-proxy claude --model z-ai/glm-5
31-
$ x402-proxy claude -- --print "explain this codebase"`,
49+
The --model value is passed as ANTHROPIC_MODEL and ANTHROPIC_CUSTOM_MODEL_OPTION
50+
to Claude Code. Any model supported by the upstream endpoint will work, even if
51+
not listed above.`,
3252
},
3353
parameters: {
3454
flags: {

packages/x402-proxy/src/commands/fetch.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ Examples:
147147
console.log(
148148
` ${pc.cyan("$ npx x402-proxy mcp <url>")} MCP proxy for AI agents`,
149149
);
150+
console.log(
151+
` ${pc.cyan("$ npx x402-proxy claude")} Run Claude Code via paid proxy`,
152+
);
153+
console.log(` ${pc.cyan("$ npx x402-proxy claude --model <id>")} Use a specific model`);
150154
console.log(` ${pc.cyan("$ npx x402-proxy setup")} Reconfigure wallet`);
151155
console.log(` ${pc.cyan("$ npx x402-proxy wallet")} Addresses and balances`);
152156
console.log(` ${pc.cyan("$ npx x402-proxy wallet history")} Full payment history`);
@@ -171,6 +175,9 @@ Examples:
171175
console.log(
172176
` ${pc.cyan("$ npx x402-proxy mcp <url>")} MCP proxy for AI agents`,
173177
);
178+
console.log(
179+
` ${pc.cyan("$ npx x402-proxy claude")} Run Claude Code via paid proxy`,
180+
);
174181
console.log(` ${pc.cyan("$ npx x402-proxy wallet")} Addresses and balances`);
175182
console.log(` ${pc.cyan("$ npx x402-proxy wallet history")} Payment history`);
176183
console.log(` ${pc.cyan("$ npx x402-proxy --help")} All options`);

0 commit comments

Comments
 (0)