feat: add --non-interactive and --complete flags to stripe login#1511
Merged
bernerd-stripe merged 4 commits intomasterfrom Mar 25, 2026
Merged
feat: add --non-interactive and --complete flags to stripe login#1511bernerd-stripe merged 4 commits intomasterfrom
bernerd-stripe merged 4 commits intomasterfrom
Conversation
Enables agent- and script-driven login without a TTY: - `--non-interactive`: calls GetLinks, prints JSON with browser_url, verification_code, and a next_step command, then exits immediately. Also activates automatically when stdin is not a terminal. - `--complete <url>`: polls the given URL from a prior --non-interactive run until the user approves in the browser, then saves credentials. The existing default browser+poll flow and --interactive flag are unchanged. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Committed-By-Agent: claude
64da879 to
c2fdeb4
Compare
Collaborator
|
this is great! i have two small things --
|
Make it clear that --non-interactive and --complete form a required two-step sequence by updating the flag usage string and long description to prompt users to immediately run the next_step command from the output. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Committed-By-Agent: claude
Contributor
Author
Discussed out of band; the server doesn't currently return this info so we'd be hard-coding it into the CLI. It's a good improvement, though, so I'll separately working on exposing that info to the client and then wire it up in a later PR!
How does this look in 3a350f1 |
Collaborator
|
looks good, ty! |
tomer-stripe
approved these changes
Mar 25, 2026
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.
Reviewers
r?
cc @stripe/developer-products
Summary
Adds two new flags to
stripe loginto support agent- and script-driven login flows:--non-interactive: calls the Stripe auth endpoint, prints a JSON object withbrowser_url,verification_code, and a ready-to-runnext_stepcommand, then exits immediately. Also activates automatically when stdin is not a terminal.--complete <url>: polls the given URL (fromnext_step) until the user approves in the browser, then saves credentials to the config file.Together these enable a clean two-step flow for agents:
```
Step 1 – get links and exit
$ stripe login --non-interactive
{
"browser_url": "https://dashboard.stripe.com/stripecli/confirm_auth?t=...",
"verification_code": "excels-champ-wins-quaint",
"next_step": "stripe login --complete 'https://dashboard.stripe.com/stripecli/auth/...'"
}
Step 2 – complete after user approves in browser
$ stripe login --complete 'https://dashboard.stripe.com/stripecli/auth/...'
The existing default browser+poll flow (
stripe login) and--interactiveflag are unchanged.pkg/login/login.goaddsInitiateLoginandPollForLogin, reusing existingGetLinks,keys.PollForKey,keys.RAKConfigurer, andSuccessMessage.pkg/cmd/login.goregisters the flags, adds TTY auto-detection viagolang.org/x/term, and updates the command'sLong/Exampledocs.