auth
Sign in with an API key and inspect the credential. The `machinemail auth` commands: arguments, flags, examples and the API routes they call.
Sign in with an API key and inspect the credential.
| Command | Summary |
|---|---|
auth login | Sign in with the browser (or an API key) and save the key to a profile |
auth logout | Remove the stored key from a profile, and optionally revoke it |
auth me | The credential as the API reports it (GET /v0/auth/me; whoami says more) |
auth status | Show the key, profile and API in use, and check the key |
auth whoami | Show the key, profile and API in use, and check the key |
Every command also takes the global flags.
auth login
Sign in with the browser (or an API key) and save the key to a profile.
Signs in with the browser: prints a code and a link (Enter opens it), you approve the code in the dashboard while signed in, and the API creates an API key named “CLI on <hostname>” (every permission except inbound_raw) that is saved to a profile in the config file (mode 0600). Without a terminal or a browser it prints the link and waits. For CI and scripts, give an existing key instead: —key - (stdin), —api-key -, or MACHINEMAIL_API_KEY; —paste asks for one with a hidden prompt. Given keys are checked against GET /v0/auth/me unless —no-verify. —profile keeps several keys side by side and —base-url points a profile at a local or self-hosted API. Agents without a human can start with machinemail register.
Flags
--browserboolean--pasteboolean--key <key|->string--with-keyboolean--no-verifybooleanExamples
auth logout
Remove the stored key from a profile, and optionally revoke it.
Deletes the stored key from the profile (the profile and its base URL stay), and for a registered agent the credentials that renew it. On a terminal it offers to revoke the key on the server first (DELETE /v0/api-keys/{id}); —revoke (or —yes) revokes without asking, —no-revoke keeps the key valid. Without a terminal the key is only removed locally unless —revoke or —yes is given.
Flags
--revokebooleanExamples
auth me
The credential as the API reports it (GET /v0/auth/me; whoami says more).
The identity and scope of the credential: which organization, pod and inbox it is bound to. Useful with a pod or inbox key to discover its scope.
Examples
API
auth status
Show the key, profile and API in use, and check the key.
Shows the profile, API and key the CLI will use and where each came from (flag, env, profile or default), then checks the key with GET /v0/auth/me. Exits 3 when there is no key or the API rejects it.
Examples
auth whoami
Show the key, profile and API in use, and check the key.
Shows the profile, API and key the CLI will use and where each came from (flag, env, profile or default), then checks the key with GET /v0/auth/me. Exits 3 when there is no key or the API rejects it.