Fluxmail

CLI reference

Work with email and manage the Fluxmail server from the command line.

The Fluxmail CLI reads and manages email through a selected local or remote instance. It also starts MCP and REST servers and handles instance administration. Run fluxmail setup for a new local instance, or use fluxmail login to add an existing instance. See Authentication and instances for profiles, sessions, and remote URL rules.

See Use the CLI for email, setup, and administration workflows. This page is the complete command reference.

Install the CLI

Install Fluxmail globally:

npm install -g fluxmail

To run a command without a global installation, replace fluxmail with npx -y fluxmail@latest. Pin an exact version instead of @latest to stay on one release.

If Fluxmail runs under Docker, prefix each command with docker compose exec fluxmail. For example:

docker compose exec fluxmail fluxmail accounts list

Command reference

CommandDescription
fluxmail setupCreate the first local administrator or claim a migrated administrator
fluxmail loginLog in to a local or remote instance
fluxmail logoutRevoke the current CLI session
fluxmail instancesManage local and remote CLI instances
fluxmail instances listList configured instances
fluxmail instances useSelect the default instance
fluxmail instances removeRemove a CLI profile and its local session
fluxmail authManage interactive authentication
fluxmail auth recover-adminReset an administrator password using local filesystem access
fluxmail auth sessionsList sessions for the current member
fluxmail auth revoke-sessionRevoke one of the current member's sessions
fluxmail serveRun the HTTP server (MCP at /mcp and REST at /api/v1)
fluxmail stdioRun as a stdio MCP server (for Claude Desktop / Claude Code local config)
fluxmail accountsManage connected email accounts
fluxmail accounts addConnect a Gmail, Outlook, or IMAP account
fluxmail accounts configureSet special folder paths for an IMAP account
fluxmail accounts listList connected accounts
fluxmail accounts removeDisconnect an account and delete its stored tokens
fluxmail accounts assignChange mailbox ownership
fluxmail accounts accessSet who can access a mailbox
fluxmail membersManage members (people using this instance)
fluxmail members addAdd a member (subject to the plan seat limit)
fluxmail members listList members with their mailbox and API key counts
fluxmail members removeRemove a member after reassigning or removing their mailboxes
fluxmail members roleChange a member role
fluxmail members statusActivate or suspend a member
fluxmail members inviteIssue a new enrollment code
fluxmail members password-resetIssue a password reset code
fluxmail members sessionsList sessions for a member
fluxmail members revoke-sessionRevoke a member session
fluxmail apikeyManage API keys for the HTTP MCP and REST APIs
fluxmail apikey capabilitiesList capabilities for API key permission policies
fluxmail apikey createCreate an API key (shown once)
fluxmail apikey listList API keys
fluxmail apikey accountsReplace or clear an API key mailbox allowlist
fluxmail apikey permissionsChange the permissions for an API key
fluxmail apikey revokeRevoke an API key
fluxmail licenseManage the paid-tier license
fluxmail license activateStore a license key and validate it with the license server
fluxmail license statusShow the configured license and cached lease
fluxmail license deactivateRelease the license from this instance and remove the stored key and cached lease
fluxmail configInspect and initialize deployment configuration
fluxmail config initCreate config.toml in the Fluxmail data directory
fluxmail config showShow effective configuration, sources, paths, and restart requirements
fluxmail config migrateImport settings from an env file without deleting it
fluxmail oauthManage OAuth applications
fluxmail oauth statusShow OAuth application status without secrets
fluxmail oauth configureConfigure an OAuth application
fluxmail oauth configure googleConfigure a custom Google OAuth application
fluxmail oauth configure outlookConfigure a custom Microsoft OAuth application
fluxmail oauth resetRemove a stored OAuth application
fluxmail logsShow recent local log entries
fluxmail telemetryManage anonymous usage telemetry
fluxmail telemetry disableStop sending anonymous usage telemetry
fluxmail telemetry enableAllow anonymous usage telemetry
fluxmail telemetry statusShow whether anonymous usage telemetry is enabled
fluxmail foldersWork with navigable mailbox folders
fluxmail folders listList folders in an email account
fluxmail labelsWork with Gmail labels and Outlook categories
fluxmail labels listList Gmail user labels or Outlook categories
fluxmail emailsRead, send, and organize email
fluxmail emails listList and filter messages
fluxmail emails searchSearch messages
fluxmail emails getGet a complete message
fluxmail emails sendSend or schedule a message
fluxmail emails forwardForward a message
fluxmail emails modifyApply one action to one or more messages
fluxmail threadsRead email threads
fluxmail threads getGet a complete thread
fluxmail draftsCreate and manage drafts
fluxmail drafts createCreate a draft
fluxmail drafts updateReplace the content of a draft
fluxmail drafts deleteDelete a draft
fluxmail scheduledManage scheduled sends
fluxmail scheduled listList scheduled sends
fluxmail scheduled cancelCancel a scheduled send and keep its draft
fluxmail attachmentsDownload message attachments
fluxmail attachments downloadDownload an attachment
fluxmail statusShow mailbox and provider status for the selected instance

Add --help to a command to view its usage in the terminal. For example, run fluxmail accounts add --help.

Gmail and Outlook connections

Fluxmail uses the hosted browser flow when FLUXMAIL_PUBLIC_URL is a non-loopback address. Otherwise, it uses the local loopback flow. Hosted links expire after 10 minutes and work once.

The --hosted and --local options override the automatic choice. You cannot combine them or use them with an IMAP account. The provider name microsoft is an alias for outlook.

IMAP account options

fluxmail accounts add imap accepts separate settings for incoming and outgoing mail. Without a password environment variable, Fluxmail prompts for the password in an interactive terminal.

See Connect IMAP/SMTP for a complete setup example and help with folder detection.

MCP permission options

The named profiles are read-only, read-write, and full. Use repeated --allow options to build a custom policy. You cannot combine --profile and --allow on the same command.

Permissions passed to fluxmail stdio apply to that process. HTTP permissions are stored with the API key and can be changed with fluxmail apikey permissions. See Permissions for the capability list and workflow requirements.

Last updated