iCloud Mail, from the command line

Your inbox.
In your shell.

Search, read, draft, send, and organize iCloud Mail without leaving your terminal. Compact for humans, predictable for scripts, and easy for agents to use.

npm install -g @amxv/icloud-clinpm · macOS · Linux · Windows
icloud — zshlocal-first
~icloud mail threads list
threadthr_… subject="Project update"messages=3unread=1participants=you@example.com,alex@example.com
~icloud mail search invoice --remote
remote-hitrem_… folder=INBOXfrom="Billing <billing@example.com>"subject="August invoice"
~icloud mail reply msg_… --body-file reply.txt --dry-run
reply-previewsmtp_contacted=falseready=true

01 / Mail, end to end

Everything you need to work through your mailbox.

Sync new mail, search across messages and attachments, read complete conversations, compose drafts, reply and forward, manage folders, and save files — all through one consistent icloud mail command tree.

02 / Everyday workflows

From a crowded inbox
to the next action.

01

Read

Sync your mailbox, open complete messages, browse conversations, save attachments

02

Search

Find mail locally in an instant or query iCloud directly when freshness matters

03

Compose

Draft, send, reply, reply-all, forward, use aliases, signatures, and S/MIME

04

Organize

Move, archive, flag, trash, manage folders, and apply reviewed bulk actions

03 / Built for agents

Small outputs. Stable IDs. Deliberate writes.

Routine commands stay compact. JSON and JSONL are there when you need structure. Stable message and thread IDs, dry-run previews, and idempotent writes make multi-step mail workflows dependable in scripts and agents.

Read the agent guide
request.jsonv1
{
  "to": ["client@example.com"],
  "subject": "Project update",
  "body_file": "message.txt",
  "idempotency_key": "update-01"
}
icloud mail send --input-json request.json --dry-run --json

04 / Documentation

Start with a command.
Go deeper when you need to.

Browse all docs

Your mailbox, from anywhere you have a shell.

Put iCloud Mail
on the command line.

Install icloudGitHub