Fastmail in your terminal. Manage email, masked addresses, calendars, contacts, files, and vacation auto-replies.
- Authentication - credentials stored securely in keychain
- Calendar - manage calendars and events, send invitations
- Contacts - create, update, and search contacts
- Email - send, receive, search, and organize emails
- Files - upload, download, and manage files via WebDAV
- Masked email - create disposable addresses to protect your inbox
- Multiple accounts - manage multiple Fastmail accounts
- Vacation - set out-of-office auto-reply messages
Fastmail's public API provides limited access. Not all CLI commands work with standard Fastmail accounts.
These commands use Fastmail's standard JMAP API scopes:
| Command | Description | API Scope |
|---|---|---|
email |
Send, receive, search, organize emails | urn:ietf:params:jmap:mail |
masked |
Create and manage masked email addresses | https://www.fastmail.com/dev/maskedemail |
These commands require additional API access that is not available to standard Fastmail accounts:
| Command | Description | Status |
|---|---|---|
calendar |
Calendars, events, invitations | Requires CalDAV/JMAP Calendar scope |
contacts |
Contact management | Requires CardDAV/JMAP Contacts scope |
vacation |
Auto-reply settings | Requires VacationResponse scope |
files |
File storage via WebDAV | Requires Files scope |
quota |
Storage quota information | Requires Quota scope |
These features may become available through:
- Fastmail business/enterprise accounts
- Future API expansions
- Direct CalDAV/CardDAV access (not yet implemented in this CLI)
For the latest on API availability, see Fastmail's developer documentation.
brew install salmonumbrella/tap/fastmailChoose one of two methods:
Browser:
fastmail auth loginTerminal:
fastmail auth add you@fastmail.com
# You'll be prompted securely for your API tokenfastmail auth statusSpecify the account using either a flag or environment variable:
# Via flag
fastmail email list --account you@fastmail.com
# Via environment
export FASTMAIL_ACCOUNT=you@fastmail.com
fastmail email listFASTMAIL_ACCOUNT- Default account email to useFASTMAIL_OUTPUT- Output format:text(default) orjsonFASTMAIL_COLOR- Color mode:auto(default),always, ornever
Credentials are stored securely in your system's keychain:
- macOS: Keychain Access
- Linux: Secret Service (GNOME Keyring, KWallet)
- Windows: Credential Manager
fastmail auth login # Authenticate via browser (recommended)
fastmail auth add <email> # Add account manually (prompts securely)
fastmail auth list # List configured accounts
fastmail auth status # Show active account
fastmail auth remove <email> # Remove accountfastmail email list [--limit <n>] [--mailbox <name>]
fastmail email search <query> [--limit <n>]
fastmail email get <emailId>
fastmail email send --to <email> --subject <text> --body <text> [--cc <email>]
fastmail email move <emailId> --to <mailbox>
fastmail email mark-read <emailId> [--unread]
fastmail email delete <emailId>
fastmail email thread <threadId>
fastmail email attachments <emailId>
fastmail email download <emailId> <blobId> [output-file]
fastmail email import <file.eml>
fastmail email mailboxes
fastmail email mailbox-create <name>
fastmail email mailbox-rename <oldName> <newName>
fastmail email mailbox-delete <name>
# Bulk operations
fastmail email bulk-delete <emailId>...
fastmail email bulk-move <emailId>... --to <mailbox>
fastmail email bulk-mark-read <emailId>... [--unread]fastmail masked create <domain> [description]
fastmail masked list [domain]
fastmail masked get <email>
fastmail masked enable <email>
fastmail masked disable <email>
fastmail masked enable --domain <domain> # Bulk enable all aliases for domain
fastmail masked disable --domain <domain> # Bulk disable all aliases for domain
fastmail masked disable --domain <domain> --dry-run
fastmail masked description <email> <text>
fastmail masked delete <email>Aliases: mask, alias
fastmail calendar list
fastmail calendar events [--calendar-id <id>] [--from <date>] [--to <date>]
fastmail calendar event-get <eventId>
fastmail calendar event-create --title <text> --start <datetime> --end <datetime> ...
fastmail calendar event-update <eventId> [--title <text>] [--start <datetime>] ...
fastmail calendar event-delete <eventId>
fastmail calendar invite --title <text> --start <datetime> --end <datetime> --attendees <email>...fastmail contacts list
fastmail contacts search <query>
fastmail contacts get <contactId>
fastmail contacts create --first-name <name> --last-name <name> --email <email> ...
fastmail contacts update <contactId> [--first-name <name>] [--email <email>] ...
fastmail contacts delete <contactId>
fastmail contacts addressbooksfastmail files list [path]
fastmail files upload <local-file> <remote-path>
fastmail files download <remote-path> [local-file]
fastmail files delete <remote-path>
fastmail files mkdir <remote-path>
fastmail files move <source> <destination>fastmail vacation get
fastmail vacation set --subject <text> --body <text> [--from <date>] [--to <date>]
fastmail vacation disableAliases: vr, auto-reply
fastmail quota # Show quotas with human-readable sizes
fastmail quota --format bytes # Show raw byte valuesAliases: storage, usage
Human-readable tables with formatting:
$ fastmail email list --limit 3
ID FROM SUBJECT DATE
Mf123abc... alice@example.com Meeting tomorrow 2024-01-15 14:30
Mf456def... bob@example.com Invoice #2024-001 2024-01-15 12:15
Mf789ghi... team@company.com Weekly update 2024-01-15 10:00
$ fastmail masked list example.com
EMAIL STATE DESCRIPTION
user.abc123@fastmail.com enabled Shopping account
user.def456@fastmail.com disabled Newsletter signupMachine-readable output:
$ fastmail --output json email list --limit 1
[
{
"id": "Mf123abc...",
"from": {"email": "alice@example.com", "name": "Alice"},
"subject": "Meeting tomorrow",
"receivedAt": "2024-01-15T14:30:00Z"
}
]Data goes to stdout, errors and progress to stderr for clean piping.
# Send simple email
fastmail email send \
--to colleague@example.com \
--subject "Project update" \
--body "Here's the latest status..."
# Send with CC
fastmail email send \
--to alice@example.com \
--cc bob@example.com \
--subject "Team sync" \
--body "Let's discuss the roadmap"# Create alias for shopping site
fastmail masked create shop.example.com "Amazon account"
# Later, disable all aliases for that domain
fastmail masked disable --domain shop.example.com# Search for emails with "invoice"
fastmail email search "invoice" --limit 10
# List attachments for an email
fastmail email attachments <emailId>
# Download specific attachment
fastmail email download <emailId> <blobId> invoice.pdf# List mailboxes
fastmail email mailboxes
# Move email to Archive
fastmail email move <emailId> --to Archive
# Mark as read
fastmail email mark-read <emailId># Delete multiple emails
fastmail email bulk-delete <emailId1> <emailId2> <emailId3>
# Move multiple emails to a folder
fastmail email bulk-move <emailId1> <emailId2> --to Archive
# Mark multiple emails as read
fastmail email bulk-mark-read <emailId1> <emailId2> <emailId3># Set out-of-office message
fastmail vacation set \
--subject "Out of office" \
--body "I'm away until Jan 20. For urgent matters, contact team@company.com" \
--from 2024-01-15 \
--to 2024-01-20
# Check current settings
fastmail vacation get
# Disable when back
fastmail vacation disable# Create meeting with attendees
fastmail calendar invite \
--title "Team standup" \
--start "2024-01-20T10:00:00" \
--end "2024-01-20T10:30:00" \
--attendees alice@example.com bob@example.com# Check personal account
fastmail email list --account personal@fastmail.com
# Check work account
fastmail email list --account work@fastmail.com
# Or set default
export FASTMAIL_ACCOUNT=work@fastmail.com
fastmail email listEnable verbose output for troubleshooting:
fastmail --debug email list
# Shows: API requests, responses, and internal operationsPreview bulk operations before executing:
fastmail masked disable --domain example.com --dry-run
# Output:
# [DRY-RUN] Would disable 3 masked emails:
# user.abc123@fastmail.com
# user.def456@fastmail.com
# user.ghi789@fastmail.com
# No changes made (dry-run mode)All commands support these flags:
--account <email>- Account to use (overrides FASTMAIL_ACCOUNT)--output <format>- Output format:textorjson(default: text)--color <mode>- Color mode:auto,always, ornever(default: auto)--debug- Enable debug output (shows API operations)--help- Show help for any command--version- Show version information
Generate shell completions for your preferred shell:
# macOS (Homebrew):
fastmail completion bash > $(brew --prefix)/etc/bash_completion.d/fastmail
# Linux:
fastmail completion bash > /etc/bash_completion.d/fastmail
# Or source directly in current session:
source <(fastmail completion bash)# Save to fpath:
fastmail completion zsh > "${fpath[1]}/_fastmail"
# Or add to .zshrc for auto-loading:
echo 'autoload -U compinit; compinit' >> ~/.zshrc
echo 'source <(fastmail completion zsh)' >> ~/.zshrcfastmail completion fish > ~/.config/fish/completions/fastmail.fish# Load for current session:
fastmail completion powershell | Out-String | Invoke-Expression
# Or add to profile for persistence:
fastmail completion powershell >> $PROFILENote: Shell completions are currently disabled. To enable, set DisableDefaultCmd: false in internal/cmd/root.go.
After cloning, install git hooks:
make setupThis installs lefthook pre-commit and pre-push hooks for linting and testing.
MIT