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.

fob-mail or fob-email?

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

ResourceActionsWhat for
mailboxeslist, showThe client mailboxes your key may use, their status and whether they can send
threadslist, show, edit, replyConversations, and the status, assignee and labels Mail keeps on them
messageslist, show, pull, sendSingle messages across threads, the raw .eml, and new mail
attachmentspullDownload an attachment
labelslist, createThe firm's labels
config profiles (alias orgs)list, current, add, use, remove, refreshAPI 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