Skip to main content

Gmail

Gmail from the command line.

Search, read, file and draft mail from a terminal or an assistant.

Reading is one grant and changing is another, so a client can search a mailbox for months without ever being able to touch it. Sending is a third, and most setups never turn it on: a draft lands in Drafts and waits for a person to press send.

Four commands

Each of the last three opens a browser tab, does one thing, and hands the terminal back.

curl -sSL https://gbrainio.terminalwire.sh | bash   # install it
gbrainio terminal connect                           # set the terminal up and connect it
gbrainio tool gmail open                            # connect the account
gbrainio terminal open                              # turn Gmail on for the terminal

The installer is a shell script for macOS and Linux. Read it before you run it.

Every Gmail command

This is gbrainio tool gmail, run for real. The page and the CLI print from the same code, so the cheatsheet is what the CLI answers to today.

gbrainio tool gmail
Search, read, file and draft mail.

USAGE
  gbrainio tool gmail <command> [arguments]

COMMANDS
  message  show, search, send, reply, forward, mark, move, label, trash
  thread   show
  draft    ls, new, edit, send, reply
  label    ls
  send-as  ls
  open     Open its page in the browser

LEARN MORE
  gbrainio tool gmail <command> -h  What one command takes
  https://gbrain.io/docs/tools      The manual
gbrainio tool gmail message
Messages in your mailbox.

USAGE
  gbrainio tool gmail message <command> [arguments]

COMMANDS
  show     Read a message
  search   Search your email
  send     Send email
  reply    Reply to a message
  forward  Forward an email
  mark     Mark a message
  move     Move a message
  label    File a message
  trash    Trash a message

LEARN MORE
  gbrainio tool gmail message <command> -h  What one command takes
  https://gbrain.io/docs/tools              The manual
gbrainio tool gmail draft
Mail written and not yet sent.

USAGE
  gbrainio tool gmail draft <command> [arguments]

COMMANDS
  ls     See your drafts
  new    Write a draft
  edit   Change a draft
  send   Send a draft
  reply  Draft a reply

LEARN MORE
  gbrainio tool gmail draft <command> -h  What one command takes
  https://gbrain.io/docs/tools            The manual
gbrainio tool gmail label
Your labels.

USAGE
  gbrainio tool gmail label <command> [arguments]

COMMANDS
  ls  See your labels

LEARN MORE
  gbrainio tool gmail label <command> -h  What one command takes
  https://gbrain.io/docs/tools            The manual
gbrainio tool gmail send-as
The addresses you can send from.

USAGE
  gbrainio tool gmail send-as <command> [arguments]

COMMANDS
  ls  See the addresses you send as

LEARN MORE
  gbrainio tool gmail send-as <command> -h  What one command takes
  https://gbrain.io/docs/tools              The manual
gbrainio tool gmail thread
A conversation, every message in it.

USAGE
  gbrainio tool gmail thread <command> [arguments]

COMMANDS
  show  Read a conversation

LEARN MORE
  gbrainio tool gmail thread <command> -h  What one command takes
  https://gbrain.io/docs/tools             The manual

Same tools, any assistant

Claude Code, Cursor and Codex reach the same Gmail through MCP, on the same permission and the same record.

Gmail over MCP

How the whole thing fits

One permission, one daily ceiling, one record, across every client that asks.

Tools