Skip to main content
Deepgram's Docs

Search documentation

Type to search this documentation.

On this pageOverview

Deepgram CLI — Getting Started

The dg CLI lets you transcribe files, stream live audio, synthesize speech, analyze text, and manage your Deepgram account from the terminal.

Bash
Bash
Bash
Bash
Bash

Account commands are flag-based. Run dg keys --help or dg projects --help for the full set.

The CLI defaults to human-readable output in the terminal. Use -o or --output to switch formats:

Bash

-o belongs to dg itself, so it goes before the subcommand name. After the subcommand it fails to parse and exits 1. On dg speak the collision is quieter: there, a bare -o is the output file path, not a format.

Agent-friendly mode selects JSON on its own, without -o. A piped stdout alone does not trigger it.

For dg -o json listen, parse errors and progress output go to stderr, so redirecting stderr leaves stdout carrying the payload:

Bash

Some command-level errors still print to stdout — an authentication failure is the common one — so check the exit code rather than assuming stdout parses.

Most command and usage outcomes use these exit codes, so scripts and CI steps can branch on them:

Code Meaning
0 Success
1 Command, execution, or usage error, such as an unknown command or invalid flag
2 Root-level user interrupt
Bash

The CLI auto-detects AI agent environments, including Claude Code, Aider, and OpenAI Codex, and adjusts its behavior:

  • Disables interactive prompts
  • Defaults to JSON output

To force the mode on:

Bash

--agent-friendly does something different on a subcommand: it prints that command’s parameter documentation as JSON and exits without running it.

Bash

The CLI also includes commands for models, requests, profiles, updates, debugging, starter scaffolding, audio probing, and coding-assistant skills:

Bash
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu