---
title: "ktm logout"
description: "Use the ktm logout command to clear stored OAuth tokens from your keychain and revoke them server-side when possible."
sidebarTitle: "logout"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Clear the stored OAuth token (and revoke it server-side)

## Usage

```bash
ktm logout [flags]
```

## Examples

```bash
# Clear the stored token and revoke it server-side
ktm logout

# Clear only the local store (skip the revoke call)
ktm logout --keep-remote
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--creds-file` | string |  | Path to the fallback credentials file |
| `--keep-remote` | boolean |  | Skip server-side revocation (only clear the local store) |
| `--no-keychain` | boolean |  | Operate on the file fallback instead of the OS keychain |

## Details

Remove the access + refresh tokens from your OS keychain (or the
fallback credentials file), and best-effort revoke them at the
Authorization Server.

Server-side revocation needs the token's issuer to be reachable. If the
network is down, the local tokens are still cleared (use --keep-remote
to skip the revoke call entirely — the tokens will simply expire on
their own schedule).

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
