Repository navigation
Make bare auth login prompt for an API key (1.10.1) - #62
Merged
Merged
Conversation
AgentMail authenticates with API keys and has no OAuth flow, so the CLI declared no login flow and `agentmail auth login` failed with "No login flow declared for scheme `BearerAuth`" unless `--with-token` was passed. Register a token-paste flow for BearerAuth in custom.rs (fernignored, so it survives regeneration). Bare `auth login` now prints where to get a key (console.agentmail.to/dashboard/api-keys) and reads it from stdin. Paste flows add no request-time provider, so AGENTMAIL_API_KEY and the keyring resolve exactly as before. Bump to 1.10.1 so this can ship without a regeneration: the publish job requires the tag to match Cargo.toml, and the next regeneration restamps the version anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shalim786
approved these changes
Nov 17, 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.
Problem
A user ran
agentmail auth loginexpecting a browser login and got:AgentMail authenticates with API keys only. The CLI declared no login flow, so plain
auth loginhad nothing to run. The error doesn't say what token to paste or where to get one.Change
cli/agentmail/custom.rsregisters a token-paste login flow forBearerAuththat links to the console's API-keys page. This file is hand-maintained and listed in.fernignore, so regeneration won't overwrite it. Plainauth loginnow prints:A paste flow adds nothing to how requests get their credentials, so
AGENTMAIL_API_KEYand the keyring work exactly as before.--with-tokennow shows the same link.The version goes to 1.10.1 so this ships without regenerating:
ci.ymlwon't publish unless the tag matchesCargo.toml, and the next regeneration restamps the version anyway. Regenerating would also pull in 3+ weeks of API changes, which need their own validation pass.Verified locally
The auth checks used a throwaway credential store (
HOME=<tmp> FERN_CLI_CREDENTIAL_STORE=file):auth loginwith empty input shows the link, then "No token provided".auth loginwith a key stores it.auth statusshowslogged_in: true,login_flow: token-paste, and the keyring source active. The next request sends the key (a fake key gets a 403 from the API).auth login --with-tokenandauth logoutbehave as before.cargo build: the binary reportsagentmail 1.10.1.cargo test: 1967 + 1 pass, 0 fail.Release
After merge, tag
v1.10.1on the merge commit.🤖 Generated with Claude Code