Repository navigation
Description
User outcome and triage
Users can discover Claude's sign-in state in Settings, launch the unmodified Claude Code CLI's own login, then return to a refreshed, accurate status.
Priority: P2 (normal); type: enhancement; status: ready after the shared status contract. This is an improvement to Modex's existing Claude CLI backend. A new general-purpose third-party Claude OAuth registration has not been verified and is not a prerequisite for this work.
Evidence and scope
The official CLI reference documents claude auth login, logout and JSON status. Authentication explains subscription versus Console/profile credentials and credential precedence. The provider's credential-use guidance distinguishes an end user signing into an unmodified Claude Code binary from an application collecting or intermediating Claude.ai tokens.
The existing Claude backend runs claude -p; Settings currently exposes binary/model settings. Preserve CLI ownership of credentials and execution.
Acceptance criteria
- Add a Settings action described as signing into Claude Code. Use the configured executable and its supported login/status commands; detect command/version support and give an actionable older-CLI fallback.
- Launch the official login through a dedicated, user-visible interaction. Let the CLI and provider browser flow own passwords, tokens and persistence. Do not scrape credential files, proxy subscription inference, or ask the user to paste setup-token output into Modex.
- Show pending/cancelled/failed/expired/signed-out outcomes and refresh status after completion or return. Do not treat process launch, browser launch or model catalog success as authenticated service access.
- Show the effective credential method when available. Make subscription versus Console/API-billed login explicit; configured environment credentials must not silently override the user's expected billing route.
- Keep sign-in as an immediate action with clear feedback, separate from unsaved Settings edits. Prevent duplicate concurrent login attempts and stale completion events. Cancelling one Modex-owned attempt must not kill an unrelated Claude process or ongoing turn.
- Define whether logout/account switching is included. If exposed, show its shared-CLI scope and protect active work before invoking it. Never clear global credentials merely because a dialog closes.
- Reuse Auth: distinguish CLI installation, sign-in status, and verified backend access #75 and the final PR #68 sign-in remedy/terminal lifecycle. Opening or reopening a terminal must not repeatedly execute the login command; both entry points must converge on one attempt.
- Cover configured executable paths with spaces, missing CLI, unsupported status command, signed-out state, cancel/timeout, failed login, successful status refresh, credential precedence and concurrent turns. Record a separately authorized real login plus completed Claude turn on the supported release platform.
- Update docs/status.md and README; pass build, units and UI e2e.
Dependencies and exclusions
Depends on #75. Reconcile overlapping PR #68 changes before landing. This issue adds no general Anthropic OAuth client, new API coding mode, hosted credential service, or token migration. Console/WIF capabilities should be reported accurately when already configured; configuring an enterprise identity provider is separate work.
Suggested labels: enhancement. Priority and dependency triage are recorded above.
Activity