Skip to main content

CLI Commands

Matcha provides several subcommands for non-interactive use. These work without launching the TUI and are ideal for scripts, cron jobs, and AI agent integration.

matcha send

Send an email directly from the command line.

matcha send --to <recipients> --subject <subject> [flags]

Flags

FlagDescription
--toRecipient(s), comma-separated (required)
--subjectEmail subject (required)
--bodyEmail body (Markdown supported). Use "-" to read from stdin
--fromSender account email. Defaults to first configured account
--ccCC recipient(s), comma-separated
--bccBCC recipient(s), comma-separated
--attachAttachment file path. Can be repeated for multiple files
--signatureAppend default signature (default: true). Use --signature=false to disable
--sign-smimeSign with S/MIME. Uses account default if not set
--encrypt-smimeEncrypt with S/MIME
--sign-pgpSign with PGP. Uses account default if not set

Examples

Simple email:

matcha send --to alice@example.com --subject "Meeting tomorrow" --body "Can we meet at 2pm?"

Send from a specific account:

matcha send --from work@company.com --to client@example.com --subject "Invoice" \
--body "Please find the invoice attached." --attach ~/Documents/invoice.pdf

Multiple recipients with CC:

matcha send --to alice@example.com,bob@example.com --cc manager@example.com \
--subject "Project update" --body "The project is on track."

Read body from stdin (useful for piping):

cat ~/notes/report.md | matcha send --to team@example.com --subject "Weekly Report" --body -

Multiple attachments:

matcha send --to alice@example.com --subject "Files" --body "Here are the files." \
--attach report.pdf --attach data.csv

Without signature:

matcha send --to alice@example.com --subject "Quick note" --body "Thanks!" --signature=false

Account Selection

The --from flag matches against both the login email and fetch email of your configured accounts. If omitted, the first configured account is used.

# Use your work account
matcha send --from work@company.com --to someone@example.com --subject "Hi" --body "Hello"

Exit Codes

CodeMeaning
0Email sent successfully
1Error (missing flags, bad config, send failure)

matcha update

Check for and install the latest version of Matcha.

matcha update

Automatically detects your installation method (Homebrew, Snap, Flatpak, WinGet, or binary) and updates accordingly.

matcha gmail

Manage Gmail OAuth2 authorization.

matcha gmail auth <email>     # Authorize a Gmail account (opens browser)
matcha gmail token <email> # Print a fresh access token
matcha gmail revoke <email> # Revoke and delete stored tokens

Requires OAuth2 client credentials in ~/.config/matcha/oauth_client.json. See the Gmail setup guide for details.

matcha version

Print the current version.

matcha --version
matcha -v
matcha version