Skip to content

Comments

feat: add OAuth login command with PKCE flow#93

Merged
birme merged 2 commits intomainfrom
feat/oauth-login
Jan 28, 2026
Merged

feat: add OAuth login command with PKCE flow#93
birme merged 2 commits intomainfrom
feat/oauth-login

Conversation

@birme
Copy link
Contributor

@birme birme commented Jan 28, 2026

Summary

  • Add osc login command that authenticates via OAuth Authorization Code + PKCE flow using the browser
  • Tokens are persisted to ~/.osc/token (with 0600 permissions) and loaded automatically on subsequent commands
  • Add preAction hook that auto-prompts for login when no token is found (env var or saved file)
  • Environment-aware auth URLs: https://app.osaas.io for prod, https://app.<env>.osaas.io for others
  • Update CLI README with authentication docs and examples for all commands

Test plan

  • Run osc login and verify browser opens, OAuth flow completes, and token is saved to ~/.osc/token
  • Run osc --env dev login and verify it uses https://app.dev.osaas.io and saves to ~/.osc/token-dev
  • Unset OSC_ACCESS_TOKEN, remove ~/.osc/token, run osc list <serviceId> and verify auto-prompt triggers
  • Set OSC_ACCESS_TOKEN env var and verify commands work without prompt
  • Verify npx lerna run build passes

🤖 Generated with Claude Code

birme and others added 2 commits January 28, 2026 20:26
Add browser-based OAuth login using Authorization Code + PKCE flow so
users no longer need to manually manage personal access tokens. Tokens
are persisted to ~/.osc and loaded automatically on subsequent commands.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@birme birme merged commit 4ec1a77 into main Jan 28, 2026
1 check 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