CLI for FastMail via JMAP.
brew tap aliou/toolbox
brew install fastmail-cligit clone https://github.com/aliou/fastmail-cli
cd fastmail-cli
bun install
bun run startnix run github:aliou/fastmail-cli-
Get an API token from FastMail under Settings > Privacy & Security > Integrations > API tokens.
-
Store the token without putting it in command arguments:
fastmail auth login --token-file /path/to/token
Or pipe it through stdin:
fastmail auth login --token-file - < /path/to/token
Interactive login is available on a TTY with fastmail auth login. --token and FASTMAIL_API_TOKEN are deprecated; use token files or the stored config instead.
fastmail auth status
fastmail email list --mailbox Inbox --limit 10
fastmail email get <id>
fastmail email send --to person@example.com --subject "Hello" --body "Hi"
fastmail email search "from:person@example.com" --after 7d
fastmail mailbox list
fastmail mailbox create <name>
fastmail masked create --for-domain example.com
fastmail unsubscribe execute <id> --autoRun fastmail help, fastmail help <command>, or fastmail help <command> <subcommand> for help. Usage errors exit 2; runtime failures exit 1.
Structured commands accept --json. Stdout contains data such as JSON and URLs. Progress, confirmations, warnings, and errors go to stderr.
# Bash
source <(fastmail completion bash)
# Zsh
source <(fastmail completion zsh)
# Fish
fastmail completion fish | sourcefastmail skill pathRead the printed SKILL.md path for the bundled FastMail CLI agent instructions and command references.
Config file: ~/.config/fastmail-cli/config.json
All commands run inside the Nix development shell:
nix develop
bun run start
bun test
bun run lint
bun run typecheck
bun run buildMIT