fob-mail: Mail CLI
fob-mail is the command-line tool and Node.js client for Mail. It reads, labels, assigns and
replies to the client mailboxes your firm has connected in Mail, from the terminal, an AI agent
or your own code. It calls the Mail API with an API key.
Use fob-mail for client mailboxes your firm has connected in Mail. Use fob-email for your own mailbox over IMAP.
Install
npm install -g @finopsbricks/fob-mail
fob-mail --version
Requires Node.js 18 or later. With the fob dispatcher (@finopsbricks/fob-cli),
fob mail … and fob-mail … are the same command.
Then set up a profile with an API key, or run fob-mail getting-started
for the steps.
What a session looks like
$ fob-mail threads list --status open
ID STATUS FROM SUBJECT LAST LABELS
--------------------------------------------------------------------------------------------
th9a8b7c6d5e open Vendor Billing Invoice INV-2291 for October 2026-11-17 08:12 bill
th2b3c4d5e6f open Bank Alerts Bank statement, October 2026-11-16 11:02 —
$ fob-mail threads edit th9a8b7c6d5e --status waiting --assignee me --add-label chased
$ fob-mail threads reply th9a8b7c6d5e --body "Received, thank you."
Output from a stand-in API with sample data.
Commands
| Resource | Actions | What for |
|---|---|---|
mailboxes | list, show | The client mailboxes your key may use, their status and whether they can send |
threads | list, show, edit, reply | Conversations, and the status, assignee and labels Mail keeps on them |
messages | list, show, pull, send | Single messages across threads, the raw .eml, and new mail |
attachments | pull | Download an attachment |
labels | list, create | The firm's labels |
config profiles (alias orgs) | list, current, add, use, remove, refresh | API key profiles, one per firm |
Every command has --help with examples, and every read command takes --json. The
command reference lists every flag.
What it doesn't do
Mail keeps its own copy of each mailbox, plus each thread's status, assignee and labels. So
fob-mail doesn't move, delete or mark mail in the client's mailbox, and has no drafts or
folders. Connecting a mailbox takes the client's sign-in, so it happens in Mail
(Settings → Mailboxes), not in the CLI.
Sending (threads reply, messages send) is plain text, from Google mailboxes only, with no
attachments yet. A reply goes to the sender of the last message.
As a library
The same package is a Node.js client. The CLI calls the same code.
import { fobMail } from '@finopsbricks/fob-mail';
const mail = fobMail({ api_key: process.env.FOB_MAIL_API_KEY, api_secret: process.env.FOB_MAIL_API_SECRET });
const open = await mail.threads.getAll({ status: 'open', label: 'bill' });
The library never reads the environment or the CLI's config: pass credentials in.
Next
- Setup: API key, profiles, several firms
- Command reference: every command and flag
- Use with AI agents: a paste-in block for Claude Code, Cursor or Codex
- Troubleshooting: the errors you're likely to see and the fix