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

# Loops CLI

> The official Loops command-line interface. Manage contacts, send events, workflows, and deliver transactional emails directly from your terminal.

## Installation

### One-line installer

```bash theme={"dark"}
curl -fsSL https://install.loops.so/cli | sh
```

To install a specific version or to a custom path, add `-s -- <version> <path>` after `sh` in the command above. The default installation path is `~/.local/bin`.

> [!TIP]
>
> Using a coding agent? Install the Loops CLI and agent skills together with
> `curl -fsSL https://install.loops.so/wizard | sh`, or connect the
> [Loops MCP server](https://loops.so/docs/mcp-server.md) if your agent cannot run a terminal.

### Homebrew

```bash theme={"dark"}
brew install loops-so/tap/loops
```

### Script for Windows PowerShell

```powershell theme={"dark"}
irm https://raw.githubusercontent.com/loops-so/cli/main/install.ps1 | iex
```

### Go install

```bash theme={"dark"}
go install github.com/loops-so/cli/cmd/loops@latest
```

### Verify

```bash theme={"dark"}
loops --version
```

## Authentication

The CLI requires a Loops API key. Get one from [Settings > API](https://app.loops.so/settings?page=api) in Loops.

There are two ways to authenticate the CLI.

### Keyring storage

Store a key locally with `loops auth login`:

```bash theme={"dark"}
loops auth login my-team
```

You can store keys for multiple teams and switch between them:

* `loops auth use <name>` — set a stored key as the default
* `loops auth list` — list stored keys and see which is the default
* `loops auth get <name>` — print a stored API key
* `--team <name>` on any command — use a specific stored key for that command

See [Auth commands](https://loops.so/docs/cli/auth.md) for the full reference.

### Environment variable

Set `LOOPS_API_KEY` to use a key directly — useful for CI or when keyring storage isn't available.

```bash theme={"dark"}
export LOOPS_API_KEY=your_api_key
```

### Precedence

When multiple keys are available, the CLI resolves them in this order:

1. `LOOPS_API_KEY` environment variable
2. `--team` flag
3. The current default (set via `loops auth use`)

## Global flags

These flags can be used with any command.

| Flag | Short | Description |
| - | - | - |
| `--debug` | | Print API request details before sending |
| `--output` | `-o` | Output format: `text` (default) or `json` |
| `--team` | `-t` | Team key name to use |
| `--help` | `-h` | Show help for any command |

## Commands

> [card] [auth](https://loops.so/docs/cli/auth.md)
>
> Log in, switch teams, and manage stored API keys.

> [card] [campaigns](https://loops.so/docs/cli/campaigns.md)
>
> Create, target, schedule, and update draft campaigns.

> [card] [audience-segments](https://loops.so/docs/cli/audience-segments.md)
>
> Read and create audience segments.

> [card] [campaign-groups](https://loops.so/docs/cli/campaign-groups.md)
>
> Organize campaigns into groups.

> [card] [contact-properties](https://loops.so/docs/cli/contact-properties.md)
>
> Create and list contact properties.

> [card] [contacts](https://loops.so/docs/cli/contacts.md)
>
> Create, update, find, and delete contacts.

> [card] [completion](https://loops.so/docs/cli/completion.md)
>
> Set up shell autocompletion.

> [card] [components](https://loops.so/docs/cli/components.md)
>
> View, create, and update email components.

> [card] [email-messages](https://loops.so/docs/cli/email-messages.md)
>
> Get, preview, and update draft email messages.

> [card] [events](https://loops.so/docs/cli/events.md)
>
> Send events to trigger workflows.

> [card] [event-patterns](https://loops.so/docs/cli/event-patterns.md)
>
> Read event patterns.

> [card] [lists](https://loops.so/docs/cli/lists.md)
>
> View your mailing lists.

> [card] [themes](https://loops.so/docs/cli/themes.md)
>
> View, create, and update email themes.

> [card] [transactional](https://loops.so/docs/cli/transactional.md)
>
> Send and manage transactional emails.

> [card] [transactional-groups](https://loops.so/docs/cli/transactional-groups.md)
>
> Organize transactional emails into groups.

> [card] [uploads](https://loops.so/docs/cli/uploads.md)
>
> Upload files as email assets.

> [card] [workflows](https://loops.so/docs/cli/workflows.md)
>
> List, create, and edit workflows and their nodes.

## Utility commands

### `loops api-key`

Validate your current API key.

```bash theme={"dark"}
loops api-key
```

### `loops dedicated-sending-ips`

List the dedicated sending IP addresses assigned to your team.

```bash theme={"dark"}
loops dedicated-sending-ips
```

### `loops skill install`

Install the [Loops CLI skill](https://loops.so/docs/skills.md) so AI coding agents can discover and use the CLI. Pass `--all` to install every Loops skill, `--global` to install it globally, and `-y` to skip confirmation prompts.

```bash theme={"dark"}
loops skill install
```

### `loops --version`

Print the CLI version.

```bash theme={"dark"}
loops --version
```

### `loops agent-context`

Print a JSON description of every command, subcommand, and flag in the CLI. Designed for AI coding agents (and other tools) that need to discover what the CLI can do without scraping `--help` output.

```bash theme={"dark"}
loops agent-context
```


## Related topics

- [Agent skills for Loops](https://loops.so/docs/skills.md)
- [Loops SDKs](https://loops.so/docs/sdks.md)
- [Events: trigger automated emails with Loops](https://loops.so/docs/events.md)
- [Set up Loops in Next.js](https://loops.so/docs/guides/nextjs.md)
- [Quickstart for agents](https://loops.so/docs/quickstart-agents.md)
