Skip to content

Make bare auth login prompt for an API key (1.10.1) - #62

Merged
duharry0915 merged 1 commit into
mainfrom
fix/auth-login-paste-prompt
Nov 17, 2026
Merged

duharry0915 merged 1 commit into
mainfrom
fix/auth-login-paste-prompt

Conversation

@duharry0915

Copy link
Copy Markdown
Contributor

Problem

A user ran agentmail auth login expecting a browser login and got:

error[validation]: No login flow declared for scheme `BearerAuth`. Use `auth login --with-token` to paste a token directly.

AgentMail authenticates with API keys only. The CLI declared no login flow, so plain auth login had nothing to run. The error doesn't say what token to paste or where to get one.

Change

cli/agentmail/custom.rs registers a token-paste login flow for BearerAuth that links to the console's API-keys page. This file is hand-maintained and listed in .fernignore, so regeneration won't overwrite it. Plain auth login now prints:

Get your token at: https://console.agentmail.to/dashboard/api-keys
Paste your token (input will be read from stdin):

A paste flow adds nothing to how requests get their credentials, so AGENTMAIL_API_KEY and the keyring work exactly as before. --with-token now shows the same link.

The version goes to 1.10.1 so this ships without regenerating: ci.yml won't publish unless the tag matches Cargo.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):

  • Plain auth login with empty input shows the link, then "No token provided".
  • Plain auth login with a key stores it. auth status shows logged_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-token and auth logout behave as before.
  • cargo build: the binary reports agentmail 1.10.1.
  • cargo test: 1967 + 1 pass, 0 fail.

Release

After merge, tag v1.10.1 on the merge commit.

🤖 Generated with Claude Code

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>
@duharry0915
duharry0915 merged commit 4149cd6 into main Nov 17, 2026
11 checks passed
@duharry0915
duharry0915 deleted the fix/auth-login-paste-prompt branch November 17, 2026 23:55
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.

2 participants