Other commands

div logout

Revoke the saved CLI session and clear local credentials.

div logout

The inverse of div login. Revokes the personal access token saved on this machine, both server-side and locally.

#Synopsis

div logout

No flags. Always safe to run — at worst it tells you you weren't logged in.

#What it does

  1. Reads the saved token from auth.json.
  2. Calls POST /api/cli/logout to delete the token row in the server's database. The same token is now dead everywhere — a second machine using it (if you'd ever copied the file) would also lose access.
  3. Wipes the user block from auth.json. Per-project claim tokens (a separate projects map in the same file, used by the older div deploy flow) are left untouched.
  4. Prints ✓ Logged out (you@example.com).

If you're not signed in, it's a no-op:

div logout
# Not logged in.

#When the server is unreachable

div logout clears your local credentials even if the server-side revoke fails (offline, server hiccup, etc.). You'll see a yellow note about the server call:

Server revoke failed (...). Clearing local credentials anyway.
✓ Logged out (you@example.com).

That keeps your machine in a clean state. The token will linger server-side until you log in from a connected machine and run div logout again — or until it's revoked manually through the (future) account settings page.

#When you'd reach for it

  • You're sharing a machine with someone else.
  • You suspect the token leaked (a stolen laptop, a backup that synced to the wrong place).
  • You're done with div on this device.

#See also