# 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.

## Prerequisites

- Python 3.10 or later
- A Deepgram API key ([get one free](https://console.deepgram.com/signup))

## Quick Start

```bash
```

## Core Workflows

### Transcribe audio

```bash
```

### Text-to-speech

```bash
```

### Text intelligence

```bash
```

### Account management

```bash
```

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

## Output Formats

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](/guides/home-developer-tools-cli-getting-started#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.

## Exit Codes

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
```

:::callout{intent="note"}
Exit codes are enforced as of CLI `0.3.0`. Earlier versions exited `0` regardless of outcome, so a pipeline that ignored the exit code may begin surfacing failures it previously swallowed. `dg listen --mic` and `dg mcp` currently handle Ctrl-C themselves and exit `0`; do not rely on an interrupt exit code for those commands.
:::

## Agent-Friendly Mode

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
```

## Other Commands

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

```bash
```

## Next Steps

- [Install the CLI](/guides/home-developer-tools-cli-installation) — More installation methods including pip, pipx, and Homebrew
- [Authenticate](/guides/home-developer-tools-cli-authentication) — Learn about authentication options
- [Speech-to-Text](/guides/home-developer-tools-cli-speech-to-text) — Full transcription reference
- [Text-to-Speech](/guides/home-developer-tools-cli-text-to-speech) — Full TTS reference

## Related pages

- [Amazon SageMaker](./amazon-sagemaker-index.md)
- [API Reference](./api-reference-index.md)
- [Aura](./aura-index.md)
- [Changelog](../changelog.md)
- [Deepgram's Docs](../index.md)
- [Docker/Podman](./docker-podman-index.md)
- [Flux TTS](./flux-tts-index.md)
- [Guides](./guides-index.md)
- [Home](./home-index.md)
- [Intelligence](./intelligence-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
