Authentication

Logout

Revoke the current Envless CLI session and clear local credentials.

The envless command ships in @goenvless/cli. Install it with npm i -g @goenvless/cli@latest.

Usage

bash
envless logout

logout wipes the local environment cache first, then calls /cli/logout to revoke the session server-side, then removes ~/.envless/config.json from disk. That file holds more than the token: it also carries your profile, the workspace selected by envless workspace use, and any workspace keys cached by envless passphrase set, so all of them go with it.

bash
$ envless logout
✔ Signed out jane@acme.dev
› Cleared 3 cached environments from disk.

The Cleared ... line only prints when there was something under ~/.envless/cache to remove, and a single entry reads Cleared 1 cached environment from disk. If the stored session has a token but no email on it, the first line reads Signed out this device instead.

Once the revoke lands, the token is marked deleted server-side and stops matching any active session, so a leaked copy is dead: later calls carrying it come back 401 with auth.cli_token_not_found. The revoke also emits a cli_token.revoked webhook to the workspace, carrying reason: "logout".

Not signed in

If no session is stored locally, logout skips the API call entirely and exits 0. The cache is still cleared, because that runs before the token is read.

bash
$ envless logout
› Not signed in. Nothing to do.
bash
$ envless logout
› Not signed in. Cleared 2 cached environments from disk.

Offline behavior

The local config is cleared even if the server-side revoke call fails (e.g. you're offline), and the exit code is still 0. The token itself stays valid on the server until a successful revoke reaches it. If that matters, run logout again once connectivity returns, or revoke the session from the dashboard.

bash
$ envless logout
⚠ Signed out locally. The server did not confirm (Request timed out).

Switching accounts

Run logout before login when changing users: envless login will not overwrite an active session. It names the account already signed in and exits 0 without contacting the API.

bash
envless logout
envless login