---
title: "CLI"
description: "The `openemail` command: your mailbox and every API operation, from a terminal or a script."
url: "https://openemail.uk/docs/cli"
area: "CLI"
category: "Getting started"
---

# CLI

The `openemail` command: your mailbox and every API operation, from a terminal or a script.

## What it is

One command for everything OpenEmail does outside the browser. It reads, searches, sends and files mail, runs every operation of the REST API, translates, writes and summarises mail with AI, and connects MCP clients such as Claude and Cursor to your mailbox. It is a single file with no dependencies, and runs on Node.js 20.12 or later on macOS, Linux and Windows.

**Install**

_npm_

```text
npm install -g @openemail/cli
```

_pnpm_

```text
pnpm add -g @openemail/cli
```

_bun_

```text
bun add -g @openemail/cli
```

_yarn_

```text
yarn global add @openemail/cli
```

Or run it without installing anything: `npx @openemail/cli <command>`.

## A 60-second tour

**Terminal**

```
openemail login
openemail status
openemail inbox --unread
openemail read CAHk7pQ2x9LmZ4
openemail reply CAHk7pQ2x9LmZ4 --text "Thursday works for me."
openemail send --to ada@example.com --subject "Lunch?" --text "Thursday at noon?"
openemail search invoice from:ada has:pdf
openemail domains list
openemail mcp config --client claude-code
```

1. `login` opens your browser, where you choose the workspace and what the CLI may do, and saves the sign-in.
2. `status` shows who you are, the addresses you can send from and the state of each domain.
3. `inbox`, `read`, `reply`, `send` and `search` work the mailbox the way the app does.
4. `domains list` is a resource command. Every method of the SDK has one, so anything the API can do, the CLI can do.
5. `mcp config` prints what to add to an AI client so it can use your mailbox.

## Two ways to sign in

| Command | What it saves | Verification codes |
| --- | --- | --- |
| openemail login | A browser sign-in, for a person at a terminal. It acts as you, limited to what you approve, and can use the AI tools and the MCP server. | Asked before a few sensitive changes, as in the web app |
| openemail login --with-token | An API key, for scripts, CI and servers. It acts with the scopes of the key. | Never asked |

## What it does not do yet

A few things need a browser session, so in `0.0.1` only the web app does them: billing, creating and switching workspaces, account security, data export, writing calendar events, forwarding, and linking a DNS provider. `openemail open` takes you to the right page, signed in as whoever is signed in to that browser.

**Terminal**

```
openemail open billing
openemail open security --print
```

## Where to go

- [Install](https://openemail.uk/docs/cli/install.md): Every package manager, npx, updates and shell completion.
- [Authentication](https://openemail.uk/docs/cli/authentication.md): Browser sign-in, API keys, profiles and verification codes.
- [Commands](https://openemail.uk/docs/cli/commands.md): The grammar, the global flags and every command.
- [Mail](https://openemail.uk/docs/cli/mail.md): Send, read, search, reply and file threads.
- [AI and MCP](https://openemail.uk/docs/cli/ai-and-mcp.md): Translate and write with AI, and connect AI clients.
- [Scripting](https://openemail.uk/docs/cli/scripting.md): JSON, streams, exit codes and CI.
- [Changelog](https://openemail.uk/docs/cli/changelog.md): Every release, newest first.
