Quick start
Login flow
- Run
ekanos login --host <url> - The CLI prints a short code and a browser URL to stderr
- Open the URL in any browser on any device
- Approve the request
- The CLI polls and confirms when approved
login prints the host it is logging in to (Logging in to https://…), and says so when it picked the only host you are already logged in to — pass --host to choose another. While it waits, it tells you what to do if the browser page shows an error: press Ctrl-C and run ekanos login again. A code on a broken page cannot be approved, and a new login gets a new code.
The device code and URL go to stderr so they’re visible even when stdout is piped. There is nothing to configure on your side: the CLI asks the host for its login configuration, so one binary works against any deployment.
If the code expires before you approve it, login exits 4 with The login code expired before it was approved. — run ekanos login again.
Who can log in
The CLI is for developers.login succeeds only for an account with a verified email address that holds a developer or source admin seat on at least one source (or is an Ekanos super admin). Anyone else gets exit 5 (forbidden) with the reason — ask your administrator for a developer seat.
Session lifetime
A CLI login is a long-lived session on the server, so an agent working for you is not stopped every few hours to ask you to log in again:- Idle timeout: 7 days — a session that has not been used for 7 days ends.
- Maximum age: 30 days — a session ends 30 days after you logged in, however active it is.
- Logout —
ekanos logoutends the session on the server, so no copy of the credentials can be refreshed again.
ekanos login --host <your-host>. The short-lived access token minted before a logout keeps working until it expires (an hour at most).
Host resolution
logout, whoami, status, sources, use, publish, and upgrade resolve the host in this order:
--hostflagEKANOS_HOSTenvironment variablehostfield inekanos.json(the project’s deployment)- Sole stored host (if your credentials file holds exactly one)
ekanos.json or the sole stored login, the CLI names it on stderr.
login is special: it resolves from --host, else EKANOS_HOST, else the sole stored host — never from ekanos.json. Login is the one verb that creates credentials, and ekanos.json is committed to git; if login honored it, anyone could point your device flow at their own tenant just by editing a file.
New hosts
A host you have logged in to before, or one under Ekanos’s own domains (vastlyfusion.site and its subdomains), is a known host. Loopback hosts (localhost, 127.0.0.1, [::1], *.localhost) are known too. Any other host is new, including a Source’s own custom domain the first time you use it.
Logging in to a new host sends your credentials to it, and the browser step proves nothing about the host: a hostile host can name the real Ekanos sign-in page. So login to a new host shows the host and the Auth0 domain it signs in through, then asks before it starts the browser step. With nobody to ask (JSON mode, an agent, no terminal), it refuses unless you pass --trust-host:
--trust-host only for a host you have checked. The sign-in domain must be an Auth0 domain (*.auth0.com); anything else is refused.
Example: single-deployment workflow
Example: multi-deployment workflow
ekanos use and a successful ekanos publish write host to ekanos.json only when it has no host yet; an existing value is never overwritten by a one-off --host. After that, verbs in the project resolve the host from ekanos.json.
No host specified, multiple stored
Credential storage
Credentials are stored in~/.ekanos/credentials.json with mode 0600, inside a ~/.ekanos directory forced to 0700. Writes go to a temporary file that is renamed into place.
File structure
accessToken is the short-lived Ekanos JWT; auth0RefreshToken is the rotating refresh token.
A file that is not valid JSON or not a recognized credentials file is a precondition_failed error (exit 9) rather than a silent logout. It holds only credentials, so deleting it and running ekanos login again is safe.
Relocation
SetEKANOS_HOME to use a different home directory (useful in containers, CI):
$EKANOS_HOME/.ekanos/credentials.json.
Permissions
If the file or directory is group- or world-accessible, the CLI tightens the permissions and warns on stderr, for example:No token in output
Tokens are never printed — not bywhoami, not in error messages, not in --json envelopes, not at any log level.
Idempotence
Login
Runningekanos login with a session that still works verifies it against the server and exits 0 without opening a browser:
data.status is already-authenticated (versus authenticated after a fresh login). Use --force to start a fresh login regardless:
Logout
Logging out twice exits 0 both times:data is { host, cleared, revoked, sessionRevoked }: sessionRevoked is the server-side session ended on the Ekanos host, revoked is the refresh token revoked at Auth0. The second run reports cleared: false. --all signs out of every stored host and reports per-host revoked and sessionRevoked results.
Revocation is attempted but never blocks the local delete: try to revoke, always delete, report both.
Rotation safety
Auth0 rotates the refresh token the moment the server’s exchange succeeds, so from that instant the replacement is the only copy in existence — and/api/auth/cli-refresh can still fail afterwards. It therefore returns the rotated token on its error responses too, and the CLI persists it the moment it is seen, before surfacing any error.
Single process: rotate, then fail
- The CLI refreshes the session
- The refresh token rotates and is saved immediately
- A later step fails
- Retry the command — the saved token is used
Two processes: concurrent rotation
Two CLIs sharing one credentials file both present the same token. Auth0 honors the first; the second gets a clean exit 4 (auth_required). There is no file lock — re-run ekanos login.
Exit codes
0— Success2— No host could be resolved3— You answered no whenloginasked about a host you have never used4— Auth required: no session, an expired one that could not be renewed, or a revoked one. Runekanos login5— Forbidden: the account has no developer seat, or its email address is not verified7—loginto a host you have never used, with nobody to ask and no--trust-host8— Network: the host was unreachable, rate-limited the request, or the refresh rotated but could not complete. Retry; do not log in again9— Precondition: an unreadable credentials file, an invalid--hostURL, a remotehttp://host, a host without CLI login configured, or a login configuration whose sign-in domain is not Auth0
Troubleshooting
Not logged in to a host
ekanos login --host <url>.
When the host is one you have never logged in to and it came from ekanos.json (or --host, or EKANOS_HOST), the hint does not tell you to log in there. It says where the host came from and asks you to check it first:
ekanos.json is committed, so anyone who can change the repo can change its host. A coding agent follows hints, and this one would otherwise sign you in to whatever the file named.
Logging in to a host you have never used
login asks instead.
Several hosts stored and none chosen
See No host specified, multiple stored. Fix: Use--host or set EKANOS_HOST:
Revocation failed during logout
logout still exits 0 and reports revoked: false.
Fix: Nothing urgent — the token is off your machine. If the machine is compromised, ask your Ekanos operator to revoke the session.
Session expired and could not be renewed
ekanos logout or an administrator), or Auth0 asking for multi-factor authentication on renewal, which a refresh cannot answer. Without a specific reason the refresh token was revoked, or already spent by another process sharing the credentials file. Exit 4. A related message is The session for https://your-ekanos-host could not be renewed.
Fix: Re-authenticate:
No developer seat
ekanos login again.
Plaintext HTTP host refused
login and every verb that sends credentials refuse a remote http:// host (exit 9). Loopback hosts stay allowed, because local development needs them. logout is the one exception: it still removes a session stored for a remote http:// host, with a warning.
Fix: Use the https:// URL.