garrytan/gstack · error · ProxyConfigError

--proxy requires a URL value

Error message

--proxy requires a URL value

What it means

Error "--proxy requires a URL value" thrown in garrytan/gstack.

Source

Thrown at browse/src/cli.ts:796

/**
 * Strip the global --proxy and --headed flags from args, validate cred policy,
 * and return the resolved config. Exits 1 with a clear hint on policy
 * violations (D9 cred mixing, malformed URL, unsupported scheme).
 *
 * Exported for unit tests.
 */
export function extractGlobalFlags(rawArgs: string[], env: NodeJS.ProcessEnv): GlobalFlags {
  const out: string[] = [];
  let proxyUrl: string | null = null;
  let headed = false;

  for (let i = 0; i < rawArgs.length; i++) {
    const arg = rawArgs[i];
    if (arg === '--proxy') {
      const value = rawArgs[i + 1];
      if (!value) {
        throw new ProxyConfigError(
          'usage: --proxy <scheme://[user:pass@]host:port>',
          '--proxy requires a URL value',
        );
      }
      proxyUrl = value;
      i++;
      continue;
    }
    if (arg.startsWith('--proxy=')) {
      proxyUrl = arg.slice('--proxy='.length);
      continue;
    }
    if (arg === '--headed') { headed = true; continue; }
    out.push(arg);
  }

  // Compose the canonical proxyUrl with creds resolved from argv+env.
  let canonicalProxyUrl: string | null = null;

View on GitHub (pinned to 94993f7401)

When it happens

Trigger: Thrown at browse/src/cli.ts:796 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of garrytan/gstack@94993f7401 (2026-08-12). Data as JSON: /api/errors/b66f801be4de9317. Report an issue: GitHub.