| name | developing-fastmail-cli |
| description | Develops and maintains the fastmail-cli project. Use when adding commands, fixing bugs, or modifying the CLI codebase. |
Developing fastmail-cli
A CLI for FastMail built with Bun + TypeScript, using the JMAP protocol against https://api.fastmail.com/jmap/session.
Running
bun run src/index.ts <command> <subcommand> [flags]
bun run typecheck
bun run lint
bun run format
bun run test
bun run build
Architecture
src/index.ts - Entry point. Routes commands to handler functions. Uses .js import extensions for dynamic imports.
src/cli.ts - Top-level arg parsing, help text, shell completions (bash/zsh/fish).
src/jmap/client.ts - JmapClient class handling session discovery, request batching, and response parsing.
src/jmap/types.ts - JMAP protocol types and capability constants.
src/jmap/*.ts - JMAP method wrappers per resource (email, mailbox, masked-email, thread, blob, submission).
src/args.ts - Shared parseArgs() helper wrapping node:util parseArgs. Provides wantsHelp(), getString(), getNumber(), getBoolean(), getPositional().