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

# CLI

> Install the voiceai CLI and run text to speech, speech to text, and streaming from a terminal.

`voiceai` is a single static binary that wraps the SLNG API. Use it to generate
audio, transcribe files, stream over WebSocket, pipe audio between tools, and
manage agents and other resources from the command line.

## Install

<CodeGroup>
  ```bash curl theme={null}
  curl -fsSL https://slng.ai/install.sh | sh
  ```

  ```bash Homebrew theme={null}
  brew install slng-ai/tap/voiceai
  ```

  ```bash npm theme={null}
  npm install -g voiceai-cli
  ```
</CodeGroup>

Verify the install:

```bash theme={null}
voiceai --help
```

<Note>
  On macOS, the `curl`-installed binary is unsigned. If Gatekeeper blocks the
  first run, run `xattr -d com.apple.quarantine $(which voiceai)`, or right-click
  the binary in Finder and choose Open once.
</Note>

## Authenticate

The quickest way to get started is `voiceai login`. It walks you through the
setup step by step and supports multiple profiles, so you can keep separate keys
for different accounts or environments.

```bash theme={null}
voiceai login
```

Run it again to add another profile. Create a key at
[app.slng.ai](https://app.slng.ai/api-keys), or see
[Create your API key](/guides/get-started/quickstart#create-your-api-key).

For non-interactive setup, such as CI, export the key in your shell instead:

```bash theme={null}
export VOICEAI_API_KEY="slng_cu_..."
```

The CLI reads its config from `~/.config/voiceai/config.json`. Environment
variables take precedence over a saved profile.

## Text to speech

Synthesize audio from text. By default, the CLI plays the audio.

```bash theme={null}
voiceai tts "Hello from sunny Barcelona!" \
  --model slng/deepgram/aura:2-en \
  --voice aura-2-thalia-en \
  --out hello.mp3
```

Pipe raw audio when stdout is not a terminal:

```bash theme={null}
voiceai tts "stream me" --model slng/deepgram/aura:2-en > out.mp3
```

Stream chunks over WebSocket for long text or low-latency playback:

```bash theme={null}
voiceai tts "long passage..." --stream | ffplay -
```

## Speech to text

Transcribe a file:

```bash theme={null}
voiceai stt recording.wav --model slng/deepgram/nova:3-en
```

Stream from the microphone:

```bash theme={null}
voiceai stt --stream
```

Pipe raw PCM from `arecord` or any source:

```bash theme={null}
arecord -f S16_LE -r 16000 -c 1 | voiceai stt --stream --source stdin
```

## Discover models and voices

```bash theme={null}
voiceai models               # list all models
voiceai voices --model slng/deepgram/aura:2-en
```

## Manage agents and resources

Beyond speech, the CLI manages the resources in your account: voice agents,
projects, and the rest. Run `voiceai --help` for the full command list, and each
subcommand's `--help` for its options. To learn what the agent commands do, see
[Create an agent](/guides/get-started/create-a-project/create-agent) and
[Outbound calls](/guides/agents/telephony/outbound).

## Configuration

Defaults the CLI reads from `~/.config/voiceai/config.json`:

| Key                 | Purpose                                       |
| ------------------- | --------------------------------------------- |
| `api-key`           | Default `VOICEAI_API_KEY`                     |
| `default-tts-model` | Model used when `--model` is omitted on `tts` |
| `default-tts-voice` | Voice used when `--voice` is omitted on `tts` |
| `default-stt-model` | Model used when `--model` is omitted on `stt` |
| `base-url`          | Override the API host (rarely needed)         |

Set any of them with `voiceai config set <key> <value>`. Override per invocation
with the matching flag.

## Source and releases

* Source: [github.com/slng-ai/sdks](https://github.com/slng-ai/sdks)
* Releases: [github.com/slng-ai/sdks/releases](https://github.com/slng-ai/sdks/releases).
  Tags prefixed `cli-v*` are CLI builds; the rest are for the SDKs.
