#2573
feat(web): ASC_WEB_APPLE_ID environment fallback for --apple-id
Summary
Add ASC_WEB_APPLE_ID as the environment fallback for --apple-id on every asc web subcommand, resolved between the explicit flag and the cached-session default introduced in #2572 (flag → ASC_WEB_APPLE_ID → last/sole cached session → usage error).
Motivation
- Non-interactive login already takes
ASC_WEB_PASSWORDandASC_WEB_2FA_CODE_COMMANDfrom the environment; the Apple ID is the only login input that still has to be on the command line. - With #2572, two cached sessions produce a usage error; CI runners need a way to select one without editing every command.
- Precedent:
--appfalls back toASC_APP_ID.
Not a config-file key: config.json holds API-key profiles and web sessions live in their own cache keyed by Apple ID, so a persisted email would be a second source of truth.
Contract
ASC_WEB_APPLE_IDis read only when--apple-idis empty; whitespace-trimmed; an empty value is ignored.- Applies to
web auth loginand to every command using the sharedresolveWebSessionpath;--session-from-envunaffected. - When the env var selects a session, print the same stderr notice as the cached-session default but naming the source (
from ASC_WEB_APPLE_ID). - Never recorded in telemetry.
Acceptance criteria
- resolver unit tests: env precedence over cache, flag precedence over env, empty env ignored
- cmdtest on one command with an isolated session store
- commands/web.mdx and the environment-variable reference updated; docs/COMMANDS.md regenerated if help changed
Depends on #2572 (stack the PR on branch claude/default-apple-id-20260913).
Activity
0No activity yet.