diff --git a/Cargo.lock b/Cargo.lock index e8dfe9a..5a5fc2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "agentmail-cli" -version = "1.10.0" +version = "1.10.1" dependencies = [ "agentmail_sdk", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 991574e..062d564 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "agentmail-cli" -version = "1.10.0" +version = "1.10.1" edition = "2021" description = "Command-line interface for the AgentMail API. Send, receive, reply, and manage threaded email conversations from your terminal." license = "MIT" diff --git a/cli/agentmail/custom.rs b/cli/agentmail/custom.rs index 75dc429..180ade3 100644 --- a/cli/agentmail/custom.rs +++ b/cli/agentmail/custom.rs @@ -13,6 +13,10 @@ //! Types are available via `agentmail_sdk::api::*`. use fern_cli_sdk::app::CliApp; +use fern_cli_sdk::auth::TokenPasteLoginFlow; + +/// Where `agentmail auth login` sends people to get an API key. +const API_KEYS_URL: &str = "https://console.agentmail.to/dashboard/api-keys"; /// Register custom commands on the CLI app builder. /// @@ -41,5 +45,12 @@ pub fn register(app: CliApp) -> CliApp { // Ok(()) // }), // ); - app + + // AgentMail authenticates with API keys; there is no OAuth flow to run. + // Without a declared flow, bare `agentmail auth login` fails with + // "No login flow declared for scheme `BearerAuth`". A paste flow makes it + // prompt for a key and say where to get one. It adds no request-time + // provider, so main.rs's BearerAuth binding (AGENTMAIL_API_KEY, then the + // keyring) is untouched. + app.login_flow(TokenPasteLoginFlow::new("BearerAuth").token_paste_url(API_KEYS_URL)) }