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

# Telnyx CLI Quickstart

> Install the Telnyx CLI, configure authentication, and run your first command in five minutes — send a message, list numbers, or place a call.

This quickstart guide will help you install the Telnyx CLI, configure authentication, and run your first commands.

## Prerequisites

* [Go 1.22+](https://go.dev/doc/install) installed
* A [Telnyx account](https://portal.telnyx.com/)
* A [Telnyx API key](https://portal.telnyx.com/#/app/api-keys)

## Step 1: Install the CLI

```bash theme={null}
go install github.com/team-telnyx/telnyx-cli/cmd/telnyx@latest
```

Ensure Go's bin directory is in your PATH:

```bash theme={null}
export PATH="$PATH:$(go env GOPATH)/bin"
```

Verify the installation:

```bash theme={null}
telnyx --version
```

## Step 2: Configure Authentication

Set your API key as an environment variable. You can get your API key from the [Telnyx Portal](https://portal.telnyx.com/#/app/api-keys).

```bash theme={null}
export TELNYX_API_KEY=KEY_xxxxxxxxxxxxx
```

<Tip>
  Add this line to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.) to persist it across sessions.
</Tip>

### Verify Authentication

Test that your credentials are working:

```bash theme={null}
telnyx balance retrieve
```

You should see your account balance information.

## Step 3: Run Your First Commands

### Check Your Balance

```bash theme={null}
telnyx balance retrieve
```

### List Your Phone Numbers

```bash theme={null}
telnyx phone-numbers list
```

### Search for Available Numbers

```bash theme={null}
telnyx available-phone-numbers list --filter.country-code US --filter.limit 5
```

### Send a Test Message

<Note>
  You'll need a [messaging-enabled phone number](https://portal.telnyx.com/#/app/numbers/my-numbers) and a configured [messaging profile](https://portal.telnyx.com/#/app/messaging).
</Note>

```bash theme={null}
telnyx messages send \
  --from +15551234567 \
  --to +15559876543 \
  --text "Hello from the Telnyx CLI!"
```

## Step 4: Explore Commands

### Get Help

```bash theme={null}
# List all commands
telnyx --help

# Get help for a specific resource
telnyx phone-numbers --help
telnyx messages --help

# Get help for a specific action
telnyx messages send --help
```

## Common Commands

| Command                                | Description               |
| -------------------------------------- | ------------------------- |
| `telnyx phone-numbers list`            | List your phone numbers   |
| `telnyx available-phone-numbers list`  | Search available numbers  |
| `telnyx number-orders create`          | Purchase phone numbers    |
| `telnyx messages send`                 | Send an SMS/MMS message   |
| `telnyx calls dial`                    | Initiate an outbound call |
| `telnyx balance retrieve`              | Check account balance     |
| `telnyx messaging-10dlc:brand list`    | List 10DLC brands         |
| `telnyx messaging-10dlc:campaign list` | List 10DLC campaigns      |
| `telnyx ai:chat create-completion`     | Chat with AI models       |
| `telnyx ai:assistants list`            | List AI assistants        |

## Output Formats

The CLI supports multiple output formats:

```bash theme={null}
# Auto format (default, interactive exploration)
telnyx phone-numbers list

# JSON format (for scripting)
telnyx phone-numbers list --format json

# YAML format
telnyx phone-numbers list --format yaml

# Pretty-print JSON
telnyx phone-numbers list --format pretty

# Filter output with GJSON
telnyx phone-numbers list --format json --transform "0.phone_number"
```

## Debug Mode

To see full HTTP request/response details:

```bash theme={null}
telnyx phone-numbers list --debug
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/development/cli/getting-started/authentication">
    Learn about authentication options
  </Card>

  <Card title="General Usage" icon="book-open" href="/development/cli/general-usage">
    Output formats, scripting, and CI/CD integration
  </Card>
</CardGroup>

***
