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.
ethos login # opens your browser, stores an API keyethos whoami # the profile, scopes and expiry of that keyethos logout # revokes the key and removes itPrerequisites: the CLI (install it), an Ethos profile, and API key access enabled for your account.
ethos login
Section titled “ethos login”- The CLI starts a one-time listener on
127.0.0.1, on a port the system picks, and openshttps://app.ethos.network/cli/loginin your browser. - On that page you log in with a wallet linked to your profile, then choose what the key may do and when it expires.
- You sign one message. The page creates the key and posts it straight to the CLI’s listener, never through a URL.
- 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>.
Without a browser on this machine
Section titled “Without a browser on this machine”On a server or over SSH, run:
ethos login --no-browserThe 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.
Signing in again
Section titled “Signing in again”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.
ethos whoami
Section titled “ethos whoami”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.
ethos logout
Section titled “ethos logout”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.
Where the key lives
Section titled “Where the key lives”| 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 |
The API behind it
Section titled “The API behind it”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.