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

# Konto

> Anmelden, abmelden und den aktiven CLI-Kontokontext prüfen

Die CLI verwendet für authentifizierte Befehle einen API-Key. Du kannst ihn einmalig mit `youka login` speichern oder ihn in CI und anderen nicht-interaktiven Umgebungen über `YOUKA_API_KEY` bereitstellen.

`youka login` prüft den Key vor dem Speichern gegen die API und cached anschließend die aufgelöste Account-E-Mail in `~/.youka/config.json` für Diagnosezwecke.

## `login`

Speichert einen API-Key in `~/.youka/config.json`.

```bash theme={null}
youka login [token]
```

<ParamField path="token" type="string">
  Der aus dem Youka-Dashboard kopierte API-Key. Falls weggelassen, fordert die
  CLI ihn in einem interaktiven Terminal ab.
</ParamField>

### Beispiele

<CodeGroup>
  ```bash token theme={null}
  youka login yk_live_abcd1234
  ```

  ```bash with-api theme={null}
  youka login yk_live_abcd1234 --api https://staging-api.youka.test --json
  ```
</CodeGroup>

<Tip>In CI ist `YOUKA_API_KEY` zu bevorzugen, statt eine Konfigurationsdatei zu schreiben.</Tip>

## `logout`

Entfernt den gespeicherten API-Key aus `~/.youka/config.json`.

```bash theme={null}
youka logout
youka logout --json
```

## `whoami`

Prüft die aufgelöste Key-Quelle, die API-URL und die Kontenidentität.

```bash theme={null}
youka whoami
youka whoami --json
```

Beispielantwort:

```json theme={null}
{
  "ok": true,
  "data": {
    "authenticated": true,
    "tokenPresent": true,
    "authStatus": "verified",
    "identitySource": "live",
    "keySource": "config",
    "apiUrl": "https://api.youka.io/de/api/v1",
    "apiUrlSource": "default",
    "email": "user@example.com",
    "userId": "user_123",
    "apiKeyId": "key_123",
    "org": null,
    "configPath": "/Users/you/.youka/config.json",
    "apiKeyPreview": "yk_l...1234"
  }
}
```

### Auflösungsreihenfolge

| Feld    | Reihenfolge                                                                   |
| ------- | ----------------------------------------------------------------------------- |
| API key | `YOUKA_API_KEY`, dann `~/.youka/config.json`                                  |
| API URL | `--api`, dann `YOUKA_API_BASE_URL`, dann `~/.youka/config.json`, dann default |

Wenn ein gespeicherter Config-Key aktiv ist, verifiziert `whoami` die Identität über die API und fällt nur dann auf die gecachte Account-E-Mail zurück, wenn die Live-Abfrage nicht verfügbar ist. Für `YOUKA_API_KEY`-Tokens wird keine gecachte Config-Identität verwendet.

## Was kommt als Nächstes

* [Globale Optionen](/de/cli/global-options) - Flags, die von jedem Befehl geteilt werden
* [Projekte](/de/cli/projects) - Karaoke-Projekte erstellen und verarbeiten
