earendil-works/pi · error · AuthCommandError
Auth checks require --provider <provider> or --model <model>
Error message
Auth checks require --provider <provider> or --model <model>
What it means
Error "Auth checks require --provider <provider> or --model <model>" thrown in earendil-works/pi.
Source
Thrown at packages/coding-agent/src/cli/auth-command.ts:110
return minExpiryMs === undefined
? { kind, args: commandArgs, json, credentials, noRefresh }
: { kind, args: commandArgs, json, credentials, noRefresh, minExpiryMs };
}
export function validateAuthCommandArgs(args: Args, kind: AuthCommandKind): { provider?: string; model?: string } {
const provider = args.provider?.trim() || undefined;
const model = args.model?.trim() || undefined;
if (args.unknownFlags.size > 0) {
const option = args.unknownFlags.keys().next().value;
throw new AuthCommandError(`Unknown option --${option} for "${getAuthCommandName(kind)}".`);
}
if (args.apiKey !== undefined || args.messages.length > 0 || args.fileArgs.length > 0) {
throw new AuthCommandError("Auth commands only accept --provider and --model");
}
if (kind === "check") {
if (!provider && !model) {
throw new AuthCommandError("Auth checks require --provider <provider> or --model <model>");
}
return { provider, model };
}
if (!provider && !model) {
throw new AuthCommandError("Credential printing requires --provider <provider> or --model <model>");
}
return { provider, model };
}
export function getAuthCredential(auth: AuthResult | undefined): string | undefined {
if (auth?.auth.apiKey) return auth.auth.apiKey;
const authorization = Object.entries(auth?.auth.headers ?? {}).find(
([name]) => name.toLowerCase() === "authorization",
)?.[1];
return typeof authorization === "string" ? /^Bearer\s+(.+)$/iu.exec(authorization)?.[1] : undefined;
}
View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/coding-agent/src/cli/auth-command.ts:110 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/37b1a6ad97e861f1.
Report an issue: GitHub.