> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gavai.io/llms.txt
> Use this file to discover all available pages before exploring further.

# gavai logout

> Delete the local credentials file.

export const ErrorTable = ({errors}) => <div className="gv-error-table" role="table" aria-label="Errors and fixes">
    <div className="gv-error-table__head" role="row">
      <span className="gv-error-table__col-head" role="columnheader">Error</span>
      <span className="gv-error-table__col-head" role="columnheader">Cause</span>
      <span className="gv-error-table__col-head" role="columnheader">Fix</span>
    </div>
    {errors.map((err, i) => <div className="gv-error-table__row" role="row" key={i}>
        <code className="gv-error-table__code" role="cell">{err.code}</code>
        <div className="gv-error-table__cause" role="cell">{err.cause}</div>
        <div className="gv-error-table__fix" role="cell">{err.fix}</div>
      </div>)}
  </div>;

export const ExpectedOutput = ({caption = "Expected output", children}) => <div className="gv-output">
    <div className="gv-output__label">
      <svg className="gv-output__icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
        <polyline points="15 10 20 15 15 20" />
        <path d="M4 4v7a4 4 0 0 0 4 4h12" />
      </svg>
      <span>{caption}</span>
    </div>
    <div className="gv-output__body">{children}</div>
  </div>;

export const Eyebrow = ({label, tone = "default"}) => <div className={`gv-eyebrow gv-eyebrow--${tone}`}>
    <span className="gv-eyebrow__bar" aria-hidden="true" />
    <span className="gv-eyebrow__label">{label}</span>
  </div>;

<Eyebrow label="CLI" />

This page covers `gavai logout`, which removes `~/.config/gavai/credentials.json` from the local machine. After running it, any command that needs authentication will exit with code `3` until you run `gavai login` again.

## Synopsis

```bash theme={null}
gavai logout
```

## Arguments

None.

## Flags

<Note>
  Run `gavai logout --help` for the authoritative flag list. The CLI is the source of truth.
</Note>

## Behavior

The command deletes the credentials file on disk. It does **not** revoke the tokens server-side — if you suspect the refresh token leaked, revoke the session from the **Sessions** tab at [console.gavai.app](https://console.gavai.app) instead of, or in addition to, running this command.

## Examples

Clear the local session:

```bash theme={null}
gavai logout
```

Verify nothing is stored:

```bash theme={null}
gavai whoami
```

<ExpectedOutput caption="Output when no credentials file exists (exit code 3)">
  ```text theme={null}
  Error: not authenticated. Run `gavai login`.
  ```
</ExpectedOutput>

Roll a session without leaving an authenticated gap:

```bash theme={null}
gavai logout && gavai login
```

## Exit codes

<ErrorTable
  errors={[
{ code: "0", cause: "Credentials file removed (or already absent).", fix: "—" },
{ code: "1", cause: "File present but could not be deleted.", fix: "Check filesystem permissions on `~/.config/gavai/`. Remove the file manually." },
]}
/>

See [CLI overview — exit codes](/cli/overview#exit-codes) for the full table.

<Card title="gavai login" href="/cli/commands/login">
  Re-authenticate after logging out.
</Card>
