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

# Use Nuntly from the CLI

> Give an AI agent or a CI job the Nuntly API as shell commands, with JSON output and documented exit codes, from npm, Homebrew or PowerShell.

The CLI gives an agent the same operations as the MCP server as shell commands, with JSON output and documented exit codes. Use it when your agent runs shell commands rather than MCP tools, or in a CI job.

Check the [prerequisites](https://nuntly.com/docs/guides/ai-agents.md#prerequisites) first: an API key and, for the npm install, Node.js 20 or later.

## Create an API key

In the dashboard, go to **API Keys** and create a key with the **Sending only** permission, and leave **Restrict to domains** empty. Copy it. Pick **Full access** instead for an agent that manages domains, inboxes, webhooks or agent memory. See [API keys](https://nuntly.com/docs/guides/api-keys.md).

## Install

Install it with npm, Homebrew or the PowerShell installer:

```bash npm theme={null}
npm install -g @nuntly/cli
```

```bash Homebrew theme={null}
brew install nuntly/tap/nuntly
```

```powershell PowerShell theme={null}
irm https://raw.githubusercontent.com/nuntly/nuntly-cli/main/scripts/install.ps1 | iex
```

## Save your key and send an email

```bash theme={null}
nuntly login
nuntly emails send --from hello@onboarding.nuntly.com --to you@example.com --subject "Hello" --text "Sent from the CLI"
```

`nuntly login` asks for the key without echoing it, then for an API base URL: leave it empty. It saves both to `~/.nuntly/config.json` (`%USERPROFILE%\.nuntly\config.json` on Windows). An agent or a CI job sets the `NUNTLY_API_KEY` environment variable instead, which the CLI reads when no profile is selected.

The onboarding sender `hello@onboarding.nuntly.com` only delivers to the email address of your Nuntly account (the organization owner). Add a domain to send to anyone else.

## Confirmations

Destructive commands and `broadcasts send` ask for confirmation, and refuse to run without a terminal unless you pass `--yes`. Run `nuntly <command> --help` for every option, and see [CLI](https://nuntly.com/docs/api-reference/cli.md) for the other install methods.

When a command fails with a `401` or a `403`, see [Troubleshooting](https://nuntly.com/docs/guides/ai-agents-troubleshooting.md#a-tool-returns-iserror-true) for what each error means.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.