---
title: "ktm whoami"
description: "Check which identity the ktm CLI authenticates as using ktm whoami, revealing API key or stored OAuth token details."
sidebarTitle: "whoami"
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 */}

Show the identity the CLI authenticates as (API key or stored OAuth token)

## Usage

```bash
ktm whoami [flags]
```

## Examples

```bash
# Show the identity behind the effective credentials
ktm whoami

# Machine-readable envelope for scripts
ktm whoami -o json
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--creds-file` | string |  | Path to the fallback credentials file |
| `--no-keychain` | boolean |  | Operate on the file fallback instead of the OS keychain |

## Details

Display the identity behind the CLI's effective credentials, mirroring the
same resolution order every other command uses:

  1. API key (--api-key-file, then KAPPTIVATE_API_KEY) — exchanged against the
     platform for a JWT; identity claims are decoded from it (one network call).
  2. Stored OAuth token from 'ktm login' — local-only read, no network.

Exit code 0 means the CLI has working credentials; 2 means it does not
(no credentials, expired token, or a rejected API key). Claims are shown as
unverified display values decoded from the JWT payload.

<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>
