BUILD / sign-out-of-grok-build

Build

Sign out of Grok Build

Sign out of Grok Build

/logout signs out of the current Grok Build account in the TUI. From the shell, grok logout signs out and clears cached credentials. Official: Modes and Commands, CLI Reference.

From the TUI

  1. Open a Grok Build session.
  2. Type /logout and send.
  3. Confirm you are signed out (welcome / login prompts return on the next start).
/logout

From the shell

grok logout

That clears the cached session on this machine. Next interactive start runs browser OIDC again (grok login), or you can use device-code login on headless hosts — see Log in to Grok Build with device code.

When to use which path

Goal Use
Leave this TUI session’s account /logout
Clear credentials on this machine grok logout
Sign in again locally grok login
Sign in over SSH / no browser grok login --device-auth
CI / scripts without OIDC XAI_API_KEY (does not refresh like OIDC)

Pitfalls

  • API-key auth (XAI_API_KEY) is separate from the OIDC cache — logging out OIDC does not erase an exported API key in your shell profile.
  • Signing out does not delete sessions under ~/.grok/sessions/ — use grok sessions delete when you need that.