Knowledge base
Command line
Your mailbox and every API operation, from a terminal or a script.
Details
- The
nextmailcommand, installed from npm as@nextmail/cli. It is one file with no dependencies and needs Node.js 20.12 or later.npm i -g @nextmail/cliinstalls it, andnpx @nextmail/cli <command>runs it without an install. - There are two ways to sign in.
nextmail loginopens your browser, where you pick the workspace, the permissions and how long the access lasts, and each browser sign-in is listed under Account → Command line, where you can change its access or sign it out. An API key, saved withnextmail login --with-tokenor set asNEXTMAIL_API_KEY, never opens a browser and never asks for a code, which suits scripts and CI. - A browser sign-in acts as you, so a sensitive change, such as adding a webhook or removing a domain, asks for the same verification code the web app asks for. One code covers that sign-in for 60 minutes, and
nextmail verifyasks for it before a script runs. inbox,search,read,replyandsendwork the mailbox the way the app does, with the same search syntax, attachments, scheduled sends, undo and translation.archive,star,snoozeand the other thread actions take several thread ids at once.- Every method of the SDK is a command,
nextmail <resource> <verb>, so anything the REST API can do, the command line can do.nextmail apicalls any path directly, with the same sign-in. ai translate,ai composeandai summarizebring the AI features to the terminal.nextmail mcp configprints the setup for Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and Codex, andnextmail mcp servelets such a client reuse the sign-in of the command line.- It is made for scripts: data goes to stdout and everything else to stderr,
--jsonprints only JSON,--allwalks every page of a list, each kind of failure has its own exit code, and nothing prompts in CI or without a terminal.nextmail tempmakes a disposable inbox with no account and no key, andtemp watch --firstwaits for its first message. - Billing, creating and switching workspaces, account security, data export, writing calendar events, forwarding and linking a DNS provider happen in the web app, and
nextmail openopens the right page of it.
Google Workspace