Skip to content

Log in from the CLI

The Ethos CLI gets its own API key from a page on the Ethos app, so you never handle a private key or write a SIWE message yourself.

Terminal window
ethos login # opens your browser, stores an API key
ethos whoami # the profile, scopes and expiry of that key
ethos logout # revokes the key and removes it

Prerequisites: the CLI (install it), an Ethos profile, and API key access enabled for your account.

  1. The CLI starts a one-time listener on 127.0.0.1, on a port the system picks, and opens https://app.ethos.network/cli/login in your browser.
  2. On that page you log in with a wallet linked to your profile, then choose what the key may do and when it expires.
  3. You sign one message. The page creates the key and posts it straight to the CLI’s listener, never through a URL.
  4. The CLI checks the key with the API, saves it, and prints the profile, address, scopes and expiry it signed in as.
Choice on the page Options
What the key may do Everything your profile can do (all:all), or admin announcements only
Expires after 30, 90 or 180 days

The CLI waits 5 minutes for the browser. Allow more with --timeout <seconds>.

On a server or over SSH, run:

Terminal window
ethos login --no-browser

The CLI prints the sign-in link. Open it on any device, sign in, copy the key the page shows, and paste it into the terminal. The key is shown once.

Running ethos login while signed in replaces the stored key and revokes the old one, so repeated logins don’t use up the 25 active keys a profile may hold.

Shows the key the CLI uses: its profile, address, scopes, expiry, and where it came from (env or the credentials file). Add --json for the full answer.

If the key has expired or been revoked, whoami says so and asks you to run ethos login again.

Revokes the stored key with the API, then removes it from this machine. If the API can’t be reached, the key is kept so you can try again. A key the API already refuses is removed.

What Where
Stored key ~/.config/ethos/credentials.json (mode 0600), one per API URL
ETHOS_API_KEY Takes precedence over the stored key. logout leaves it as it is.
ETHOS_CONFIG_DIR Moves the config folder, credentials included

whoami and logout call GET and DELETE /api/v2/api-keys/me with the key in X-Ethos-Api-Key. Any key may read and revoke itself, whatever its scopes, so you can use the same endpoints from your own scripts. Their requests and responses are in the API reference.