Repository navigation
Log in through the browser instead of pasting an API key - #48
Merged
Merged
Conversation
'pegasus auth login' now starts a device-code login, prints the link and code, opens the browser, and waits for approval before saving the new key. It never reads stdin, so agents can run it. The old paste flow is still available as --with-key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A 429, a dropped connection or a 5xx during a deploy no longer ends the login: the CLI waits (for Retry-After, on a 429) and polls again until the login expires. Non-JSON or incomplete responses now give a clean error instead of a traceback, and a 429 when starting says when to retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Browser login no longer asks before replacing an existing key, so an agent re-running it can't hang or abort on the prompt (--with-key still asks). - Warn when PEGASUS_API_KEY is set, since it overrides the saved key. - Don't try to open a browser on Linux without a display, where Python falls back to terminal browsers like lynx, and say to open the link by hand when no browser opened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CLI side of https://github.com/czue/pegasus-site/pull/356.
pegasus auth/pegasus auth loginnow:--no-browserto skip opening it.~/.pegasus/credentials.It never reads stdin, so an agent can run it directly instead of telling the user to open a separate terminal. The old paste flow is still available as
--with-key, andPEGASUS_API_KEYworks as before.The server's RFC 8628 errors are handled:
authorization_pendingkeeps polling,slow_downbacks off, andaccess_denied/expired_token/invalid_grantexit with a message. On a server without the endpoint (404), the error points to--with-key.Testing
tests/test_device_login.pycovers polling, backoff, error codes, expiry, and the command itself (browser open,--no-browser, saving the key, denial). The existing auth test now uses--with-key.--with-keyfallback message.Merge order
Merge and deploy pegasus-site#356 before releasing this. Until then, bare
pegasus authwould fail with the fallback message.🤖 Generated with Claude Code