Skip to content

feat: support OAuth subscription auth for Claude, ChatGPT Codex, and Gemini #6

Description

@roninjin10

Summary

Crush currently supports OAuth-backed auth flows for Copilot and Hyper, plus API-key-based auth for providers like Anthropic, OpenAI, and Gemini. We should add first-class OAuth subscription auth support for:

  • Claude / Anthropic subscription auth
  • ChatGPT Plus/Pro Codex auth
  • Gemini / Google Cloud Code Assist auth

Motivation

Users increasingly authenticate coding agents with subscription-backed OAuth instead of raw API keys. Supporting these flows would let Crush match tools like pi-mono for personal interactive use while preserving API-key flows for production and automation.

Current state

  • internal/oauth/ has provider-specific OAuth implementations for Copilot and Hyper.
  • internal/config.ProviderConfig already supports oauth tokens alongside api_key.
  • internal/config/store.go already persists and refreshes OAuth tokens, but refresh is hard-coded to Copilot and Hyper.
  • internal/cmd/login.go and the TUI OAuth dialog are currently oriented around device-code flows.
  • internal/config/load.go currently removes Anthropic OAuth config entirely because Claude subscription support is not supported anymore.

Requested outcome

Implement provider-specific OAuth subscription support for Anthropic, OpenAI Codex, and Gemini in a way that:

  1. integrates with existing provider config and token refresh plumbing,
  2. supports browser callback flows plus manual fallback when necessary,
  3. preserves provider-specific metadata where needed (for example Gemini project ID), and
  4. surfaces clear UX / billing semantics to users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions