Releases: noc0dev/fastmail-cli
v0.2.3
What's new
email.get --fetch-all-body-values (#11)
Exposes JMAP's fetchAllBodyValues: true (RFC 8621) as a CLI flag. Without this, bodyValues always returned {} even when included in --properties.
email.read convenience command (#11)
New command that returns subject, from, to, plain text body, and attachment metadata in a single call — the most common "read an email" use case.
blob.download command (#12)
Downloads a blob to a local file using the JMAP downloadUrl template (RFC 8620 §6.2). Returns a JSON envelope with bytesWritten, sha256, and output path. URI template variables are properly percent-encoded per RFC 6570.
Agent workflow: read email + download attachments
# Step 1: Read email, discover attachments
fastmail-cli email.read --id M123
# → data.attachments[0] = {blobId: "G...", name: "invoice.pdf", ...}
# Step 2: Download
fastmail-cli blob.download --blob-id "G..." --name "invoice.pdf" \
--type "application/pdf" --output "./invoice.pdf"Bug fixes
pipeline.runno longer crashes when--jsonis omitted (#11)- Proper percent-encoding of
downloadUrltemplate variables (#12)
Full changelog: v0.2.2...v0.2.3
v0.2.2
Security
- Redact API token from JSON output. The
envelope()function previously included the rawapi_tokenin every response's"args"field. All output now shows"**REDACTED**"instead of the actual token value. (#10)
Docs
- Expanded
AGENTS.mdwith project structure, security conventions, and contribution guidance.
v0.2.0
What's New
Draft Commands (Safe for AI Agents)
email.draft- Create new draft emails without sendingemail.draft-reply- Create draft replies to existing emails with auto-threading
Features
- Auto-sets
In-Reply-ToandReferencesheaders for proper threading - Auto-prefixes
Re:to subject when replying --reply-allflag to include all original recipients--fromflag to specify sender identity--toand--subjectoverrides
Safety Model
Drafts are created using Email/set only - never EmailSubmission/set. Even with a write-enabled token, the CLI cannot send emails. Humans review drafts in Fastmail UI before sending.
Other Changes
- Renamed
FASTMAIL_READONLY_API_TOKEN→FASTMAIL_API_TOKEN(backwards compatible) - Fixed
@file/@-body input to read plain text (not JSON) - CLI help now shows
fastmail-cliinstead ofjmapc-cli
Example Usage
# Create a draft reply
fastmail-cli email.draft-reply \
--id "M12345" \
--body "Thanks for reaching out..." \
--from "[email protected]"
# Create a new draft
fastmail-cli email.draft \
--to "[email protected]" \
--subject "Hello" \
--body @message.txtFull Changelog: v0.1.1...v0.2.0
v0.1.1 - Fix PyPI README images
Changes
- Fix README images on PyPI by using absolute
raw.githubusercontent.comURLs - PyPI doesn't support relative image paths in README
Full Changelog: v0.1.0...v0.1.1
v0.1.0 - Initial Release
Initial Release
Read-only CLI for AI agents to access Fastmail via JMAP.
Features
email.query- Query emails with filters and limitsemail.get- Get email by ID with full contentemail.changes- Track email changes since a statemailbox.query- List mailboxesthread.get- Get email threadssearchsnippet.get- Get search snippetsevents.listen- Stream real-time events (SSE)pipeline.run- Run raw JMAP pipelines
Installation
uv add fastmail-cliOr run without installing:
uvx fastmail-cli help