Skip to content
This repository was archived by the owner on Jun 7, 2026. It is now read-only.
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions proxy/start-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ const BACKEND_DEFS = {
fireworks: { url: 'https://api.fireworks.ai/inference/v1', keyEnv: 'FIREWORKS_API_KEY' },
};

// Legacy mode: start-proxy.js <targetUrl> <apiKey> (used by deepclaude.sh/ps1)
const targetUrl = process.argv[2] || process.env.CHEAPCLAUDE_TARGET_URL;
const apiKey = process.argv[3] || process.env.CHEAPCLAUDE_API_KEY;
// Legacy mode: start-proxy.js <targetUrl> <apiKey> (used by deepclaude.sh/ps1).
// Only treat the first two args as url/key when they are NOT flags, so standalone
// flag usage (--mode/--port) isn't misread as legacy mode and crashed by
// `new URL('--mode')`.
const isFlag = (s) => typeof s === 'string' && s.startsWith('-');
const targetUrl = (!isFlag(process.argv[2]) && process.argv[2]) || process.env.CHEAPCLAUDE_TARGET_URL;
const apiKey = (!isFlag(process.argv[3]) && process.argv[3]) || process.env.CHEAPCLAUDE_API_KEY;

if (targetUrl && apiKey) {
// Legacy single-backend mode
Expand Down