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
- Reads the saved token from
auth.json. - Calls
POST /api/cli/logoutto 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. - Wipes the user block from
auth.json. Per-project claim tokens (a separateprojectsmap in the same file, used by the olderdiv deployflow) are left untouched. - 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
div login— the inverse.div whoami— the email the current saved token belongs to.- Authentication — where credentials live and how they work.