fix(cli): drop --remote-config from auth and skip reading it for unsupported commands

Merged
SA
5d ago
+65-9

Summary

Implements option (a) from #4887: drop remoteConfig from auth so every session-less command rejects --remote-config, and skip reading --remote-config files before flag validation rejects unsupported commands. Closes #4887.

  • Remove remoteConfig from auth.supportedFlags in packages/command-surface/src/schema/command-overrides.ts (auth was the only command with session: false and remoteConfig: true).
  • Guard shouldApplyRemoteConfigDefaults in src/cli/resolve-cli-options.ts with isFlagSupportedForCommand('remoteConfig', command) so unsupported commands reject --remote-config without reading the file.
  • Update and add parser, resolver, CLI, and leased-session tests covering valid, invalid-JSON, and missing profiles plus help auth.

Before / after

Built CLI, fresh state directory:

  • auth status --remote-config ok.json: before succeeded and ignored the profile; after exits 1 with INVALID_ARGS (Flag --remote-config is not supported for command auth.).
  • auth status --remote-config bad.json / missing.json and web doctor --remote-config missing.json: before failed with JSON or file-not-found errors; after reject --remote-config as unsupported without reading the file.

Validation

  • Head 019972943: pnpm check:affected --run passed (exactCommit=true: format, lint, typecheck, layering, fallow, build, vitest-related, full unit), plus eager-closure-budgets (919/919), check:command-docs, check:doc-prose, and check:doc-links.
  • Controlled revert failed all 5 regression test files.
  • Independent Claude Opus 5.5 verification passed.

Reviewed with sol-loop: 1 round with gpt-6.2-sol. Sol verdict: approved.
Created with Claude Opus 5.5 and Gemini 4 Neon in T3 Code.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.