feat(auth): add headless OAuth login mode#13
Conversation
Add a headless login path that prints the authorization URL and accepts a pasted callback URL, so OAuth can complete without a local listener. This keeps PKCE/state validation and token persistence aligned with the existing login flow. Co-authored-by: Cursor <cursoragent@cursor.com>
Document where to find the vc-cli skill reference and add explicit guidance for using `auth login --headless` in agent/server contexts so users can complete OAuth pasteback reliably. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Adds a headless OAuth login mode to vc-cli auth login so authentication can complete on hosts that can’t open a browser or run a local callback listener, while keeping PKCE/state validation and token persistence aligned with the existing flow.
Changes:
- Introduces
--headlessflag to print the authorization URL and prompt for a pasted redirect callback URL. - Adds parsing/validation helpers for pasted callbacks and redirect URI path validation.
- Updates CLI docs/tests (README + skill docs) to describe and cover the new mode.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/commands/auth_login.rs | Implements headless pasteback flow, callback parsing, and redirect URI path validation; adds unit tests. |
| src/cli/mod.rs | Adds --headless flag wiring from clap CLI args into command execution; adds parsing test. |
| skills/vc-cli/SKILL.md | Documents auth login --headless behavior for agent usage. |
| README.md | Adds quick-start guidance and notes for headless login and skill docs location. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Skip listener-timeout validation in headless mode and reuse a single redirect URI parser for both headless and listener flows. Also reject redirect URIs that use port 0 to prevent impossible callback targets. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed all unresolved review threads. Fixed
Not fixed
Validation
|
|
@copilot review |
All three review items are correctly addressed in commit
No issues found. The implementation is clean and |
Summary
auth login --headlessso login can complete without a local callback listenercodeandstateTest plan
cargo fmtcargo testcargo run -- auth login --headless(manual verification of headless prompt and callback handling)Made with Cursor