Skip to content

feat(auth): add non-interactive --oauth flag to auth login#52

Merged
troycdc merged 1 commit into
mainfrom
feat/non-interactive-auth-login
Jun 10, 2026
Merged

feat(auth): add non-interactive --oauth flag to auth login#52
troycdc merged 1 commit into
mainfrom
feat/non-interactive-auth-login

Conversation

@troycdc

@troycdc troycdc commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds --oauth flag to cdcx auth login for non-interactive browser-based OAuth
  • Skips raw terminal mode and ESC key detection, making it safe for background/agent contexts
  • Supports optional --env (default: production) and --profile (default: default) flags
  • Extracts reusable save_profile() function for programmatic config writes

Usage

cdcx auth login --oauth                          # production, default profile
cdcx auth login --oauth --env uat                # UAT, default profile
cdcx auth login --oauth --profile trading        # production, "trading" profile
cdcx auth login --oauth --env uat --profile sandbox  # UAT, "sandbox" profile

Test plan

  • cargo build passes
  • cargo test -p cdcx-cli — 97 tests pass
  • Manual: cdcx auth login --oauth opens browser and saves credentials
  • Manual: cdcx auth login --oauth --env uat targets UAT environment
  • Manual: cdcx auth login --oauth --profile myprofile saves to named profile

🤖 Generated with Claude Code

Enables headless OAuth login for background/agent contexts by skipping
raw terminal mode and ESC key detection. Supports optional `--env` and
`--profile` flags (defaulting to production and default profile).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@troycdc troycdc merged commit f605e2f into main Jun 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant