|
| 1 | +--- |
| 2 | +name: fastmail |
| 3 | +description: Complete reference for fastmail-cli — all commands, flags, config, and common patterns |
| 4 | +--- |
| 5 | + |
| 6 | +# fastmail-cli — Complete Reference |
| 7 | + |
| 8 | +fastmail-cli is a Rust CLI for Fastmail via JMAP (email) and CardDAV (contacts). All output is JSON: `{"success": true, "data": {...}}`. |
| 9 | + |
| 10 | +## Setup |
| 11 | + |
| 12 | +```bash |
| 13 | +fastmail-cli auth fmu1-YOUR-TOKEN |
| 14 | +``` |
| 15 | + |
| 16 | +Config lives at `~/.config/fastmail-cli/config.toml`: |
| 17 | +```toml |
| 18 | +[core] |
| 19 | +api_token = "fmu1-..." |
| 20 | + |
| 21 | +[contacts] |
| 22 | +username = "you@fastmail.com" |
| 23 | +app_password = "xxxx..." |
| 24 | +``` |
| 25 | + |
| 26 | +Or via env: `FASTMAIL_API_TOKEN`, `FASTMAIL_USERNAME`, `FASTMAIL_APP_PASSWORD` |
| 27 | + |
| 28 | +Debug: `RUST_LOG=debug fastmail-cli [cmd]` |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +## Command Reference |
| 33 | + |
| 34 | +### List |
| 35 | + |
| 36 | +```bash |
| 37 | +fastmail-cli list emails [-m MAILBOX] [-l LIMIT] # default: INBOX, 50 |
| 38 | +fastmail-cli list mailboxes |
| 39 | +fastmail-cli list identities # sender aliases for --from |
| 40 | +``` |
| 41 | + |
| 42 | +### Get & Thread |
| 43 | + |
| 44 | +```bash |
| 45 | +fastmail-cli get EMAIL_ID # full email with body |
| 46 | +fastmail-cli thread EMAIL_ID # entire conversation |
| 47 | +``` |
| 48 | + |
| 49 | +### Search |
| 50 | + |
| 51 | +```bash |
| 52 | +fastmail-cli search [OPTIONS] |
| 53 | + --text/-t STR # full-text (from/to/subject/body) |
| 54 | + --from/--to/--cc/--bcc/--subject/--body STR |
| 55 | + --mailbox/-m STR |
| 56 | + --before/--after STR # ISO 8601: 2024-01-15 |
| 57 | + --unread --flagged --has-attachment |
| 58 | + --min-size/--max-size BYTES |
| 59 | + --limit/-l N # default 50 |
| 60 | +``` |
| 61 | + |
| 62 | +### Compose |
| 63 | + |
| 64 | +```bash |
| 65 | +fastmail-cli send --to ADDR --subject SUBJ --body BODY [--cc] [--bcc] [--from IDENTITY] [--draft] |
| 66 | +fastmail-cli reply EMAIL_ID --body BODY [--all] [--cc] [--bcc] [--from IDENTITY] [--draft] |
| 67 | +fastmail-cli forward EMAIL_ID --to ADDR [--body STR] [--cc] [--bcc] [--from IDENTITY] [--draft] |
| 68 | +``` |
| 69 | + |
| 70 | +### Manage |
| 71 | + |
| 72 | +```bash |
| 73 | +fastmail-cli move EMAIL_ID --to MAILBOX |
| 74 | +fastmail-cli mark-read EMAIL_ID [--unread] |
| 75 | +fastmail-cli spam EMAIL_ID [-y] |
| 76 | +``` |
| 77 | + |
| 78 | +### Attachments |
| 79 | + |
| 80 | +```bash |
| 81 | +fastmail-cli download EMAIL_ID [-o OUTPUT_DIR] [-f raw|json] [--max-size 1M] |
| 82 | +``` |
| 83 | + |
| 84 | +### Masked Email |
| 85 | + |
| 86 | +```bash |
| 87 | +fastmail-cli masked list |
| 88 | +fastmail-cli masked create [--domain URL] [--description STR] [--prefix STR] |
| 89 | +fastmail-cli masked enable/disable/delete ID [-y] |
| 90 | +``` |
| 91 | + |
| 92 | +### Contacts |
| 93 | + |
| 94 | +```bash |
| 95 | +fastmail-cli contacts list |
| 96 | +fastmail-cli contacts search QUERY # name, email, or org |
| 97 | +``` |
| 98 | + |
| 99 | +### Other |
| 100 | + |
| 101 | +```bash |
| 102 | +fastmail-cli completions bash|zsh|fish|powershell |
| 103 | +fastmail-cli mcp # start MCP server for Claude Desktop |
| 104 | +``` |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## Common Patterns |
| 109 | + |
| 110 | +```bash |
| 111 | +# Find unread emails from a sender |
| 112 | +fastmail-cli search --from boss@company.com --unread |
| 113 | + |
| 114 | +# Get a thread then reply |
| 115 | +fastmail-cli thread abc123 |
| 116 | +fastmail-cli reply abc123 --body "Thanks, will do." --from work@me.com |
| 117 | + |
| 118 | +# Save draft instead of sending |
| 119 | +fastmail-cli send --to x@y.com --subject "Draft" --body "..." --draft |
| 120 | + |
| 121 | +# Download all attachments from an email |
| 122 | +fastmail-cli download abc123 -o ~/Downloads |
| 123 | + |
| 124 | +# Move to folder after reading |
| 125 | +fastmail-cli move abc123 --to "Archive" |
| 126 | +``` |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## Subcommand Skills |
| 131 | + |
| 132 | +- `/fastmail/search` — search workflows and filter combinations |
| 133 | +- `/fastmail/compose` — send, reply, forward, drafts, identities |
| 134 | +- `/fastmail/conversations` — threading, listing, reading |
| 135 | +- `/fastmail/attachments` — downloading and extracting attachments |
| 136 | +- `/fastmail/masked` — masked email management |
| 137 | +- `/fastmail/contacts` — contact search |
0 commit comments