paperclipai/paperclip · warning · Error

Choose either --oauth-only or --cli-only, not both.

Error message

Choose either --oauth-only or --cli-only, not both.

What it means

Thrown by the Claude quota-probe CLI main() when both --oauth-only and --cli-only flags are passed. The two flags are mutually exclusive because they restrict the probe to a single quota source; passing both is a contradictory instruction with no valid interpretation, so the CLI refuses rather than picking one arbitrarily.

Source

Thrown at packages/adapters/claude-local/src/cli/quota-probe.ts:36

}

function parseArgs(argv: string[]): ProbeArgs {
  return {
    json: argv.includes("--json"),
    includeRawCli: argv.includes("--raw-cli"),
    oauthOnly: argv.includes("--oauth-only"),
    cliOnly: argv.includes("--cli-only"),
  };
}

function stringifyError(error: unknown): string {
  return error instanceof Error ? error.message : String(error);
}

async function main() {
  const args = parseArgs(process.argv.slice(2));
  if (args.oauthOnly && args.cliOnly) {
    throw new Error("Choose either --oauth-only or --cli-only, not both.");
  }

  const authStatus = await readClaudeAuthStatus();
  const token = await readClaudeToken();

  const result: Record<string, unknown> = {
    timestamp: new Date().toISOString(),
    authStatus,
    tokenAvailable: token != null,
  };

  if (!args.cliOnly) {
    if (!token) {
      result.oauth = {
        ok: false,
        error: "No Claude OAuth access token found in local credentials files.",
        windows: [],
      };

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Pass at most one of --oauth-only or --cli-only; omitting both runs both probes (the default).
  2. Audit the calling script/wrapper for logic that can set both flags simultaneously.
  3. Use --json to get structured output and filter the section you want client-side instead of restricting in-process.

Example fix

// before
node quota-probe.js --oauth-only --cli-only
// after
node quota-probe.js --oauth-only
Defensive patterns

Strategy: validation

Validate before calling

if (args.oauthOnly && args.cliOnly) {
  console.error("Pass at most one of --oauth-only / --cli-only");
  process.exit(2);
}

Prevention

When it happens

Trigger: Invoking the quota-probe binary with both flags: `node quota-probe.js --oauth-only --cli-only`. parseArgs sets both booleans true and main() throws before doing any work.

Common situations: A wrapper script that concatenates flags conditionally and ends up setting both; copy-paste from two example invocations; a cron/job template that listed both options.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/14ded2676238d4d2. Report an issue: GitHub.