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

# CLI

> Synthesize speech and browse the catalog from your terminal — no code.

`@gekoai/sdk` ships a CLI, so you can synthesize speech and browse the catalog without writing code.

```bash theme={null}
# run without installing
npx @gekoai/sdk say "Сәлеметсіз бе!" --voice Aigerim -o hello.wav

# or install globally → `gekoai`
npm install -g @gekoai/sdk
gekoai say "Сәлем" -o hello.wav
```

Set your key once:

```bash theme={null}
export GEKO_API_KEY=sk-tokay-...
```

## Commands

### `say <text>`

Synthesize text to a `.wav` file.

```bash theme={null}
gekoai say "Тапсырыс нөмірі 152 дайын." --voice Arman --nfe 32 -o order.wav
```

| Option             | Description                                      |
| ------------------ | ------------------------------------------------ |
| `--voice <name>`   | Voice (default: the model's default, `Aigerim`). |
| `--model <id>`     | Model id (default: `tokay-kk-v1`).               |
| `--nfe <n>`        | Diffusion steps: `16` fast, `32` quality.        |
| `--speed <n>`      | Speed multiplier (0.5–2).                        |
| `--no-normalize`   | Disable number/currency/date normalization.      |
| `--out, -o <file>` | Output path (default: `speech.wav`).             |

### `voices`

List voices for a model (no key required).

```bash theme={null}
gekoai voices
gekoai voices --model tokay-kk-v1 --json
```

### `models`

List available models (no key required).

```bash theme={null}
gekoai models
gekoai models --json
```

## Global flags

| Flag               | Description                                        |
| ------------------ | -------------------------------------------------- |
| `--api-key <key>`  | Override `$GEKO_API_KEY`.                          |
| `--base-url <url>` | Override the API base URL.                         |
| `--json`           | Machine-readable output (for `voices` / `models`). |
| `--help, -h`       | Show help.                                         |
| `--version, -v`    | Print the SDK version.                             |

## Exit codes

| Code | Meaning                                                                |
| ---- | ---------------------------------------------------------------------- |
| `0`  | Success.                                                               |
| `1`  | API error (the server responded with an error, or the request failed). |
| `2`  | Usage error (missing text, missing key, unknown command).              |

## Scripting example

Generate a clip per line of a file:

```bash theme={null}
i=0
while IFS= read -r line; do
  gekoai say "$line" --voice Aigerim -o "clip_$i.wav"
  i=$((i + 1))
done < lines.txt
```

## Next steps

<CardGroup cols={2}>
  <Card title="TypeScript SDK" icon="code" href="/sdk/typescript">
    The programmatic client behind the same CLI.
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Create a key and set `GEKO_API_KEY`.
  </Card>

  <Card title="Pick a voice" icon="waveform-lines" href="/voices">
    Browse the catalog and audition each voice.
  </Card>

  <Card title="Errors & retries" icon="shield-check" href="/sdk/errors">
    What each exit code maps to under the hood.
  </Card>
</CardGroup>
