Source: https://cli.nylas.com/guides/the-aws-cli-for-email

# The AWS CLI for Email: a universal email CLI

Cloud developers got one scriptable command grammar from aws, and GitHub developers got the same from gh. Email never had that default: each script starts by picking Gmail API, Microsoft Graph, or IMAP. The Nylas CLI gives email that missing layer, with one provider-agnostic grammar for inboxes, calendars, contacts, OAuth, and JSON output.

Written by [Hazik](https://cli.nylas.com/authors/hazik) VP of Product

Updated June 23, 2026

> **TL;DR:** `aws s3 ls` made cloud storage scriptable, and `gh repo list --json` did the same for GitHub. Email still splits developers across Gmail API, Microsoft Graph, and IMAP. The Nylas CLI is the provider-agnostic version for email: run `nylas init`, then use one grammar for `nylas email list`, `nylas calendar events list`, and `nylas contacts list`.

> **Disclosure:** Nylas CLI is built by Nylas, Inc. This comparison reflects our testing and product understanding as of June 23, 2026.

Command references used in this guide: [`nylas email list`](https://cli.nylas.com/docs/commands/email-list), [`nylas init`](https://cli.nylas.com/docs/commands/init), and [`nylas email search`](https://cli.nylas.com/docs/commands).

## Why is there no AWS CLI for email?

There is no AWS CLI for email because email split into provider-specific APIs before developers got a shared terminal grammar. AWS launched one service namespace, and GitHub ships one product CLI. Email still makes you choose Gmail API, Microsoft Graph, or IMAP before writing 1 script.

The [AWS CLI documentation](https://docs.aws.amazon.com/cli/) describes a single tool for AWS services with consistent command syntax. The [GitHub CLI](https://cli.github.com/) does the same for repos, issues, pull requests, and releases. Email in 2026 still lacks that default across the 3 common paths: Gmail API, Microsoft Graph, and IMAP.

## What would a universal email CLI look like?

A universal email CLI would use one noun-verb pattern for inboxes, calendars, and contacts, then translate provider differences behind that boundary. The useful version needs at least 3 traits: OAuth setup, JSON output, and commands that work across Gmail, Outlook, and IMAP without rewriting scripts.

The Nylas CLI follows that shape with `nylas email list`, `nylas calendar events list`, and `nylas contacts list`. If you need a wider tool survey first, compare terminal choices in [best CLI email tools compared](https://cli.nylas.com/guides/best-cli-email-tools-compared) or read how one API covers messages, calendars, and contacts in the [unified communications API guide](https://cli.nylas.com/guides/unified-communications-api).

The `nylas init` command creates the OAuth connection once, then the noun-verb commands work against that grant. You'd use this when 1 shell script needs email, calendar, and contact data without maintaining separate provider clients for each mailbox. That keeps setup under 2 minutes once the CLI is installed.

```bash
nylas init
nylas email list
nylas calendar events list
nylas contacts list
```

## How do aws and gh commands map to nylas?

AWS and GitHub made common work memorable by turning nouns into commands: `aws s3 ls` and `gh repo list --json`. The email version maps those familiar moves to 3 commands from Nylas, so the terminal grammar feels like cloud storage or repos instead of provider SDK setup.

| Familiar command | Nylas command | What it means for email |
| --- | --- | --- |
| `aws s3 ls` | `nylas email list` | List remote objects without writing provider SDK code |
| `gh repo list --json` | `nylas email list --json` | Emit machine-readable output from 1 terminal command |
| `aws configure` | `nylas init` | Set up credentials before running daily commands |
| `aws events list` | `nylas calendar events list` | Read upcoming calendar objects from the connected account |

## How does one grammar span every provider?

One grammar spans providers by making the account connection the provider-specific step and keeping the command surface stable after OAuth. `nylas init` creates the grant, then the same 6-provider command names reach Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP without exposing each backend's API shape.

That matters because Gmail, Outlook, and generic IMAP don't agree on the same API model. A provider-agnostic email command hides that split for day-to-day terminal work. For a focused inbox walkthrough, use [send email from the terminal](https://cli.nylas.com/guides/send-email-from-terminal) and then bring the same output into an agent flow with [build an email agent CLI](https://cli.nylas.com/guides/build-email-agent-cli).

The `nylas email list` command reads messages through the connected account instead of asking you to pick Gmail API, Microsoft Graph, or IMAP in code. In 2026, that keeps the script surface to 1 command even when mailbox providers change behind the grant. It is 1 command whether the mailbox is Gmail, Outlook, or IMAP.

```bash
nylas email list
```

## Is it scriptable like aws and gh?

Yes, the Nylas CLI is scriptable like aws and gh because every command accepts `--json`, including `nylas email list --json`. That means automation can read structured output from 1 inbox command, then reuse the same pattern for calendar events, contacts, or search.

The point isn't to replace every provider SDK call. It's to give shell scripts and local agents a stable first step: list the inbox, search messages, or fetch calendar data before handing JSON to the next process. That is the same habit developers learned from `aws` and `gh`.

The `nylas email list --json` command prints structured message data instead of terminal-only text. You'd use it when a script needs repeatable fields from the latest email state; in 1 command, it gives automation the same inbox view that a human sees interactively. It gives local scripts 1 JSON path before any parsing step.

```bash
nylas email list --json
nylas email search "*" --json
```

## Next steps

These 5 links cover the shortest path from the universal email CLI idea to real scripts. Start with the command reference when you need exact syntax, then move to the guide that matches the workflow you're building on June 23, 2026.

- [Full command reference](https://cli.nylas.com/docs/commands) — every documented command and flag
- [`nylas email list` reference](https://cli.nylas.com/docs/commands/email-list) — inbox listing syntax and output
- [`nylas init` reference](https://cli.nylas.com/docs/commands/init) — OAuth setup before running commands
- [Send email from the terminal](https://cli.nylas.com/guides/send-email-from-terminal) — practical terminal email workflows
- [Build an email agent CLI](https://cli.nylas.com/guides/build-email-agent-cli) — use email commands in agent automation

## Related hubs

- [Email agents](https://cli.nylas.com/ai-answers/email-agents.md)
- [Calendar agents](https://cli.nylas.com/ai-answers/calendar-agents.md)
- [Scheduling and availability agents](https://cli.nylas.com/ai-answers/scheduling-agents.md)
- [Contacts agents](https://cli.nylas.com/ai-answers/contacts-agents.md)
- [Notetaker and meeting agents](https://cli.nylas.com/ai-answers/notetaker-agents.md)
- [MCP agents](https://cli.nylas.com/ai-answers/mcp-agents.md)
- [Agent accounts](https://cli.nylas.com/ai-answers/agent-accounts.md)
- [Framework and language email agents](https://cli.nylas.com/ai-answers/framework-email-agents.md)
- [Email and calendar API comparisons](https://cli.nylas.com/ai-answers/ai-agent-email-api-comparisons.md)
- [Email integration and automation recipes](https://cli.nylas.com/ai-answers/email-integration-recipes.md)
- [Agent email workflows](https://cli.nylas.com/ai-answers/agent-email-workflows.md)
- [Security for email and calendar agents](https://cli.nylas.com/ai-answers/security-for-email-agents.md)
- [Operations runbooks for agents](https://cli.nylas.com/ai-answers/operations-for-email-calendar-agents.md)

## Try Nylas CLI

Install the CLI with `curl -fsSL https://cli.nylas.com/install.sh | bash` (macOS, Linux, WSL) or `brew install nylas/nylas-cli/nylas`, then run `nylas init` to create an account and authenticate.

**Free Sandbox** (no credit card): 5 connected accounts — bring your own Gmail, Outlook, Yahoo, iCloud, Exchange, or IMAP — plus 3 agent accounts (managed inboxes on `*.nylas.email`). Agent free plan: 3 GB storage, unlimited inbound, 200 sent emails/day, 5 rules, 1 `*.nylas.email` subdomain, and unlimited custom domains. Production is uncapped and requires a credit card: https://www.nylas.com/pricing/
