---
title: "Reloop CLI"
description: "Send, schedule and receive email from your terminal, CI or a coding agent. Every command supports --json."
canonical: "https://reloop.sh/features/cli"
---

# Reloop CLI

> For the site documentation index, see [llms.txt](/llms.txt). Docs index: [llms-docs.txt](/llms-docs.txt). Marketing corpus: [llms-full.txt](/llms-full.txt). Docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Product skill: [skill.md](/skill.md). Prefer markdown URLs (append `.md`) when available.

> Send, schedule and receive email from your terminal, CI or a coding agent. Every command supports --json.

HTML: https://reloop.sh/features/cli
Docs: https://reloop.sh/docs/integrations/ai-tools/cli-agents

## Install and sign in

```bash
npx -y reloop-cli init --all --browser
```

## Agent skill

```bash
npx skills add reloop/reloop-cli
```

## Send an email

```bash
reloop emails send \
  --from "you@yourdomain.com" \
  --to "user@example.com" \
  --subject "Hello from Reloop" \
  --text "It works."
```

## JSON output for agents

Add --json to any command. Output goes to stdout with no spinners, exit codes are 0 for success and 1 for errors, and every error has a message and a code.

```json
{
  "error": {
    "message": "No API key found",
    "code": "auth_error"
  }
}
```

## Pipe content from stdin

Pass - to any file flag to read from stdin. Works with --text-file, --html-file and --file.

```bash
echo "Your order has shipped." | reloop emails send \
  --from "Acme <onboarding@example.com>" \
  --to delivered@example.com \
  --subject "Order update" \
  --text-file -
```

## Batch sending

Send up to 100 emails in one request from a JSON file or a pipe.

```bash
cat emails.json | reloop emails batch --file -
```

## Safe retries

Retry a failed send with the same --idempotency-key and Reloop won't deliver it twice. Supported on emails send and emails batch.

```bash
reloop emails send \
  --from "Acme <onboarding@example.com>" \
  --to delivered@example.com \
  --subject "Welcome" \
  --text "Hello!" \
  --idempotency-key "welcome-user-123"
```

## Scheduling

Schedule with --scheduled-at, then cancel or reschedule by id.

```bash
reloop emails send \
  --from "Acme <onboarding@example.com>" \
  --to delivered@example.com \
  --subject "Your trial ends soon" \
  --text "Your free trial expires in 3 days." \
  --scheduled-at "tomorrow at 9am ET"

reloop emails cancel <id>
reloop emails update <id> --scheduled-at <datetime>
```

## Read inbound email

Stream new inbound email as JSON from a long-running process, or fetch one by id. Needs a verified domain with receiving enabled.

```bash
reloop emails receiving listen --json

reloop emails receiving get <email-id>
```

## Webhooks in your terminal

Subscribe to webhook events and stream them to your terminal, or forward them to a local server. The webhook is removed when you disconnect.

```bash
reloop webhooks listen \
  --url https://hostname.tailnet-name.ts.net \
  --events email.delivered email.bounced email.received

reloop webhooks listen \
  --url https://hostname.tailnet-name.ts.net \
  --forward-to http://localhost:4321/api/webhook
```

## FAQ

### How do I install the Reloop CLI?

Run npx -y reloop-cli init --all --browser. It sets up the CLI and opens your browser so you can authorize your workspace.

### How do AI agents use the CLI?

Install the agent skill with npx skills add reloop/reloop-cli so Claude Code, Codex and other skill-aware agents know the commands. Agents pass --json to get machine-readable output, exit code 0 on success and 1 on errors, and errors with a message and a code.

### Can I send email in bulk?

Yes. reloop emails batch sends up to 100 emails in a single request. Pass a JSON file, or use --file - to read it from stdin.

### How do I avoid duplicate sends when retrying?

Pass --idempotency-key with a stable value, such as welcome-user-123. Retrying with the same key won't send the email again. It works on emails send and emails batch.

### Can the CLI receive email?

Yes. reloop emails receiving listen --json streams new inbound email, and reloop emails receiving get fetches one by id. You need a verified domain with receiving enabled.

### How do I test webhooks locally?

Run reloop webhooks listen with a public --url (Tailscale Funnel, ngrok or similar) and the events you want. Add --forward-to to send them to a local server. The webhook is removed when you press Ctrl+C.
