Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions chapters/developer-tools/gladia-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
---
title: Gladia CLI

Check warning on line 2 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L2

Did you really mean 'Gladia'?
description: "Transcribe audio from your terminal with one install, one command, and no boilerplate"
---

Transcribe audio from your terminal. One install, one command, no boilerplate.

The Gladia CLI wraps the [Gladia speech-to-text API](/chapters/pre-recorded-stt/quickstart) for terminals, shell scripts, and pipelines — 100+ languages, speaker diarization, and code switching in a single command.

Check warning on line 8 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L8

Did you really mean 'Gladia'?

Check warning on line 8 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L8

Did you really mean 'diarization'?

<Tip>
Get your API key from the [Gladia dashboard](https://app.gladia.io/apikeys) before running your first transcription.

Check warning on line 11 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L11

Did you really mean 'Gladia'?
</Tip>

## Why use the CLI

- **One command away** — Install the CLI, set your API key, run `gladia transcribe`.
- **Flexible output** — Get plain text, JSON, SRT, or VTT straight to stdout.
- **Full feature set** — Speaker diarization, multilingual configuration, and model selection (`solaria-1`, `solaria-3`).

Check warning on line 18 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L18

Did you really mean 'diarization'?
- **Files or URLs** — Transcribe a local recording or a remote link, with no download step.
- **Pipe-friendly** — Machine-readable output for shell scripts and CI pipelines.

## Install

```bash
# macOS & Linux
curl -fsSL https://github.com/gladiaio/gladia-cli/releases/latest/download/install.sh | sh

# Windows (PowerShell)
powershell -c "irm https://github.com/gladiaio/gladia-cli/releases/latest/download/install.ps1 | iex"
```

Other platforms and binaries are available on [GitHub releases](https://github.com/gladiaio/gladia-cli/releases).

## Quick start

```bash
gladia auth set your_key

gladia transcribe meeting.wav # transcript to stdout
gladia transcribe podcast.mp3 -o srt # subtitles instead
gladia transcribe call.wav --diarize # label who spoke when
gladia languages # list supported language codes
```

### API key setup

Provide your API key in one of three ways (checked in this order):

```bash
export GLADIA_API_KEY=your_key # 1. environment variable
gladia auth set your_key # 2. saved to ~/.gladia (mode 0600)
gladia transcribe meeting.wav --gladia-key your_key # 3. per-command flag
```
Comment on lines +47 to +53

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find all mentions of Gladia-related auth/key handling in docs and code.
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
  -e 'GLADIA_API_KEY' \
  -e -- '--gladia-key' \
  -e 'gladia auth set' \
  -e 'auth set' \
  -e 'API key' \
  chapters . 2>/dev/null | sed -n '1,220p'

echo '--- FILE LIST ---'
fd -a -t f -H -I 'gladia' . | sed -n '1,120p'

Repository: gladiaio/docs

Length of output: 151


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target doc and nearby files.
target='chapters/developer-tools/gladia-cli.mdx'
wc -l "$target"
sed -n '1,140p' "$target"

echo '--- AST OUTLINE IF SUPPORTED ---'
ast-grep outline "$target" --view expanded || true

Repository: gladiaio/docs

Length of output: 5381


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for the CLI source or reference docs mentioning prompt/secret-manager/CI injection paths.
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
  -e 'secret manager' \
  -e 'CI injection' \
  -e 'prompt' \
  -e 'stdin' \
  -e 'env var' \
  -e 'GLADIA_API_KEY' \
  -e '--gladia-key' \
  -e 'gladia auth' \
  . 2>/dev/null | sed -n '1,260p'

Repository: gladiaio/docs

Length of output: 8794


Avoid inline API-key examples in shell commands. gladia auth set your_key and --gladia-key your_key expose secrets through shell history or process arguments; add a warning and steer users toward GLADIA_API_KEY or the saved ~/.gladia path instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@chapters/developer-tools/gladia-cli.mdx` around lines 47 - 53, Update the
API-key guidance near the command examples to warn that inline keys in shell
commands can leak through history or process arguments. Remove the literal-key
examples for `gladia auth set` and `--gladia-key`, and instead recommend
`GLADIA_API_KEY` or the saved `~/.gladia` credential path, mentioning flags only
generically if needed.


## Everyday examples

```bash
# Transcribe a local file or a remote URL
gladia transcribe meeting.wav
gladia transcribe https://example.com/audio.mp3 -o json

# Narrow language detection to a shortlist
gladia transcribe podcast.mp3 --language en,fr,de

# Mixed-language audio: re-detect on every utterance
gladia transcribe mixed.mp3 --code-switching --language en,fr

# Who spoke when, as subtitles
gladia transcribe call.wav --diarize -o srt

# Pick a model
gladia transcribe podcast.mp3 --model solaria-3 --language en

# Machine-readable output in a pipeline
gladia transcribe interview.mp3 -o json | jq '.transcription'
```

## Commands

| Command | Description |
| --- | --- |
| `transcribe <file-or-url>` | Transcribe an audio file or URL |
| `auth set <key>` | Save API key to `~/.gladia` |
| `languages` | List supported ISO 639-1 codes |
| `completion <shell>` | Generate shell tab completion (bash, zsh, fish, powershell) |

Check warning on line 85 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L85

Did you really mean 'zsh'?

Check warning on line 85 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L85

Did you really mean 'powershell'?

## Output formats

Use `-o` or `--output` to control how the transcript is returned:

| Format | Description |
| --- | --- |
| `text` | Plain transcript (default) |
| `json` | Structured JSON transcript |
| `json-full` | Full API response as JSON |
| `srt` | SubRip subtitles |
| `vtt` | WebVTT subtitles |

## Transcription options

| Flag | Default | Description |
| --- | --- | --- |
| `-o`, `--output` | `text` | Output format: `text`, `json`, `json-full`, `srt`, `vtt` |
| `--language` | — | Expected language(s), comma-separated (`en` or `en,fr,de`); narrows detection |
| `--cs`, `--code-switching` | off | Re-detect language on each utterance (mixed-language audio; `solaria-1` only) |
| `--diarize` | off | Identify speakers in the transcript |
| `--model` | — | STT model: `solaria-1` or `solaria-3`. Solaria-3 accepts at most one `--language` (`en`, `fr`, `de`, `es`, or `it`) and does not support code switching. |
| `-v`, `--verbose` | off | Show progress while polling |

**Global flag** (any command): `--gladia-key` — API key if not set in the environment or `~/.gladia`.

### Language

| Goal | What to run |
| --- | --- |
| Auto-detect | `gladia transcribe <file>` |
| Constrain detection | `--language en,fr,de` |
| Code switching | `--code-switching` (+ optional `--language` hints) |

- **`--language`** limits which language(s) Gladia considers. A comma-separated list is a hint list, not per-utterance switching.

Check warning on line 120 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L120

Did you really mean 'Gladia'?
- **`--code-switching`** turns on per-utterance language detection. Add `--language` to restrict which languages may appear. Not available with `solaria-3`.

### Diarization

Check warning on line 123 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L123

Did you really mean 'Diarization'?

Use `--diarize` when you need **who spoke when**. Speaker labels are included in the output (for example, `Speaker 0: …`).

```bash
gladia transcribe meeting.wav --diarize
gladia transcribe panel.mp3 --diarize -o srt
```

## Shell completion

When you install via `install.sh` or `install.ps1`, the script offers to configure tab completion for your shell. To skip the prompt (for example in CI), set `GLADIA_NO_COMPLETION_PROMPT=1`.

You can also set up completion manually:

```bash
# bash
source <(gladia completion bash)

# zsh
mkdir -p ~/.zsh/completions
gladia completion zsh > ~/.zsh/completions/_gladia

# fish
mkdir -p ~/.config/fish/completions
gladia completion fish > ~/.config/fish/completions/gladia.fish
```
Comment on lines +142 to +149

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- file excerpt ---'
nl -ba chapters/developer-tools/gladia-cli.mdx | sed -n '125,175p'

echo
echo '--- search for completion docs and zsh config mentions ---'
rg -n "gladia completion zsh|fpath|compinit|completions" chapters . -g '*.mdx' -g '*.md' -g '*.mdown' -g '*.txt' -g '*.sh' -g '*.yaml' -g '*.yml' || true

Repository: gladiaio/docs

Length of output: 212


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
path = Path('chapters/developer-tools/gladia-cli.mdx')
lines = path.read_text().splitlines()
for i in range(125, 176):
    if i <= len(lines):
        print(f"{i:>4}: {lines[i-1]}")
PY

echo
echo '--- repo search ---'
rg -n "gladia completion zsh|fpath|compinit|_gladia|completion fish|completion zsh" . -g '*.mdx' -g '*.md' -g '*.sh' -g '*.yml' -g '*.yaml' || true

Repository: gladiaio/docs

Length of output: 2086


Complete the zsh completion setup. The manual zsh snippet only writes _gladia; add the fpath/compinit setup or say the installer handles it, otherwise the completion file won’t be loaded.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@chapters/developer-tools/gladia-cli.mdx` around lines 142 - 149, Complete the
zsh setup instructions following the completion file creation in the documented
shell snippet: either add the required fpath configuration and compinit
initialization, or explicitly state that the installer performs this setup.
Ensure the instructions reference the generated _gladia completion file so users
know it will be loaded.


Run `gladia completion --help` for full instructions per shell.

## Next steps

<CardGroup cols={3}>
<Card title="Get your API key" href="https://app.gladia.io/apikeys" icon="key">
Create an API key on the Gladia dashboard

Check warning on line 157 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L157

Did you really mean 'Gladia'?
</Card>
<Card
title="Gladia CLI on GitHub"
icon="github"
href="https://github.com/gladiaio/gladia-cli"
>
Source code, issues, and releases
</Card>
<Card
title="Pre-recorded STT quickstart"
icon="book"
href="/chapters/pre-recorded-stt/quickstart"
>
Learn more about Gladia transcription features

Check warning on line 171 in chapters/developer-tools/gladia-cli.mdx

View check run for this annotation

Mintlify / Mintlify Validation (gladia-95) - vale-spellcheck

chapters/developer-tools/gladia-cli.mdx#L171

Did you really mean 'Gladia'?
</Card>
</CardGroup>
6 changes: 6 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@
"chapters/integrations/n8n"
]
},
{
"group": "Developer tools",
"pages": [
"chapters/developer-tools/gladia-cli"
]
},
{
"group": "Limits & Specifications",
"pages": [
Expand Down