CLI
The `nextmail` command: your mailbox and every API operation, from a terminal or a script.
What it is
One command for everything Nextmail 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.
npm install -g @nextmail/cliOr run it without installing anything: npx @nextmail/cli <command>.
A 60-second tour
nextmail loginnextmail statusnextmail inbox --unreadnextmail read CAHk7pQ2x9LmZ4nextmail reply CAHk7pQ2x9LmZ4 --text "Thursday works for me."nextmail send --to ada@example.com --subject "Lunch?" --text "Thursday at noon?"nextmail search invoice from:ada has:pdfnextmail domains listnextmail mcp config --client claude-codeloginopens your browser, where you choose the workspace and what the CLI may do, and saves the sign-in.statusshows who you are, the addresses you can send from and the state of each domain.inbox,read,reply,sendandsearchwork the mailbox the way the app does.domains listis a resource command. Every method of the SDK has one, so anything the API can do, the CLI can do.mcp configprints what to add to an AI client so it can use your mailbox.
Two ways to sign in
| Command | What it saves | Verification codes |
|---|---|---|
| nextmail 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 |
| nextmail login --with-token | An API key, for scripts, CI and servers. It acts with the scopes of the key. | Never asked |
In the web app
Billing, creating and switching workspaces, account security, data export, writing calendar events, forwarding and linking a DNS provider happen in the web app. nextmail open takes you to the right page, signed in as whoever is signed in to that browser. open forwarding takes the address whose forwarding you want to change, and open providers, or open dns, opens DNS provider linking.
nextmail open billingnextmail open security --printnextmail open forwarding you@acme.comnextmail open providers
Google Workspace