Skip to the documentation
CLI

Install

npm, pnpm, Bun or Yarn, or no install at all with npx.

Install

The current release is 0.0.5. It needs Node.js 20.12 or later.

npm install -g @nextmail/cli

The package is one bundled file with no dependencies, and it puts one command on your PATH: nextmail. The SDK it calls the API with is built in, so the CLI always runs with the SDK it was tested against. nextmail version prints the version of both, and of the runtime.

Check it
nextmail --versionnextmail --help

Run it without installing

npx fetches the package into a cache and runs it, which suits a one-off command, a CI job, or an MCP client that starts the local bridge.

Terminal
npx @nextmail/cli --helpnpx -y @nextmail/[email protected] whoaminpx -y @nextmail/cli mcp serve

Pin the version in CI, as in npx -y @nextmail/[email protected], so a new release never changes a pipeline under you.

Updates

The CLI never updates itself. It remembers for a day what the npm registry said about the latest release. When that is older, it asks again in the background while your command runs, and once the command is done it waits a fifth of a second at most for the answer. When a newer release exists, it prints a notice on stderr after your command has finished:

Update notice
Update available! 0.0.4 → 0.0.5Changelog: https://openemail.uk/docs/cli/changelogRun `npm i -g @nextmail/cli@latest` to update. Disable this notice with NEXTMAIL_NO_UPDATE_CHECK=1
  • The install command in the notice matches the package manager you installed with.
  • There is no notice with --help, --version or --json, for help, version, update or completion, when stdout or stderr is not a terminal, or in CI.
  • Set NEXTMAIL_NO_UPDATE_CHECK=1 to turn it off everywhere. NEXTMAIL_DISABLE_UPDATE_NOTICE=1 does the same.
  • The only request goes to the npm registry, and its answer is kept in ~/.nextmail/update-check.json for a day.

nextmail update checks straight away, ignoring the daily cache, and prints either the command to run or that you are on the latest version.

npm i -g @nextmail/cli@latest

Shell completion

nextmail completion <shell> prints a completion script for bash, zsh or fish, built from every command, subcommand and flag of the version you have. Run it again after an update.

echo 'eval "$(nextmail completion bash)"' >> ~/.bashrc

Uninstall

Sign out first, so every browser sign-in is revoked on the server, then remove the package and the folder the CLI keeps its sign-ins in.

Terminal
nextmail logout --allnpm uninstall -g @nextmail/clirm -rf ~/.nextmail