mac

Calendar, Reminders, Contacts, Mail, Messages, Notes, Music, TV, Finder, Keynote, Pages, Numbers, Shortcuts and FaceTime, on the command line. One binary, built for AI agents and the humans who drive them.

❯git clone https://github.com/31Carlton7/mac-cli.git && cd mac-cli && make install View on GitHub
mac — zsh

Native frameworks, not screen scraping. Calendar, Reminders and Contacts run on EventKit and Contacts: millisecond calls, typed errors, stable IDs. Mail, Messages, Notes, Music, TV, Finder, the iWork apps and Shortcuts go through AppleScript and a read-only Messages database, because Apple ships no public API for them, and mac is honest about the difference.

Calendar

Dates take ISO, naturals and offsets.

❯ mac calendar list --from today --to +7d
❯ mac calendar add "Dentist" --at "tomorrow 2pm"

Reminders

Add, complete and edit across every list.

❯ mac reminders add "Buy milk" --list Groceries
❯ mac reminders complete <id>

Contacts

Resolve a name to a handle before you send.

❯ mac contacts find "Sarah"
❯ mac contacts find "Sarah" --json

Mail

Drafting is preferred over sending, by design.

❯ mac mail unread --limit 10
❯ mac mail draft --to a@b.com --subject "Hi"

Messages

Read history, send texts. Exact handles only.

❯ mac messages history +15551234567
❯ mac messages send +1555… "On my way"

Notes

List, search, add and append by folder.

❯ mac notes search "brunch"
❯ mac notes append <id> "one more thing"

Music

Playback, search, playlists and star ratings.

❯ mac music play --playlist Workout
❯ mac music rate <track-id> 5

TV

What's playing, pause, resume, play by id.

❯ mac tv list --limit 10
❯ mac tv play <id>

Finder

The GUI state your shell cannot reach. No ls or cp; you already have those.

❯ mac finder selection
❯ mac finder trash ~/Downloads/old-draft.pdf

iWork

Agents that ship documents, not descriptions of documents. A deck, a letter, a sheet: exported to PDF, PowerPoint, Word, Excel.

❯ mac pages append Letter --text "Sincerely,"
❯ mac numbers set-cell Q3 --cell B2 --value 42
❯ mac keynote export Deck --format pdf --out ~/d.pdf

Shortcuts

The escape hatch. Anything you can wrap in a Shortcut.

❯ mac shortcuts list
❯ mac shortcuts run "Get Weather"

Calls

Initiate only. macOS still asks before it dials.

❯ mac call "+1 555 123 4567"
❯ mac facetime user@example.com --audio

Some apps cannot be scripted at all. Podcasts, News, Stocks, Maps, Weather and a dozen more expose no automation surface whatsoever, so no tool can drive them directly and mac does not pretend otherwise. The README names every one. For those, wrap the job in a Shortcut and run that instead.

mac — zsh
❯ mac shortcuts run "Log Weight" --input 176
logged 176 lb
❯ mac call "+1 555 123 4567" --dry-run
tel:+15551234567
would open; macOS confirms before dialing

Built for agents, kind to humans. --json on every command, with sorted keys, ISO 8601 dates and stable schemas. Mutations take exact IDs only, errors are actionable one-liners on stderr, and exit codes are something an agent can actually branch on.

0 success 1 not found 2 permission denied 64 usage error
mac — zsh
❯ mac contacts find "Sarah" --json
{
  "emails": ["sarah@example.com"],
  "id": "AB1C2D3E-4F56-7890-A1B2-C3D4E5F6A7B8",
  "name": "Sarah Chen",
  "phones": ["+15551234567"]
}
❯ mac messages send +15551234567 "Brunch at 11?"
✓ sent to +15551234567

Permissions, diagnosed. macOS prompts once per capability, and mac doctor reports every grant (Calendar, Reminders and Contacts access, Automation consent, Full Disk Access) with fix steps when something is missing. No silent failures, no mystery errors.

mac doctor — zsh
❯ mac doctor
✓ Calendar           access granted
✓ Reminders          access granted
✓ Contacts           access granted
✓ Mail               Automation consent granted
✓ Messages           Automation consent granted
✓ Notes              Automation consent granted
✓ Music              Automation consent granted
✓ TV                 Automation consent granted
✓ Shortcuts Events   Automation consent granted
✓ Finder             Automation consent granted
✓ Keynote            Automation consent granted
✓ Pages              Automation consent granted
✓ Numbers            Automation consent granted
✗ Full Disk Access   missing for Terminal
                     → System Settings › Privacy & Security › Full Disk Access

Next

A Homebrew tap, so installing is one command instead of a clone and a build. Photos, QuickTime Player, Preview and TextEdit are all scriptable and are the likely candidates after that.

Install

❯git clone https://github.com/31Carlton7/mac-cli.git && cd mac-cli && make install
❯mac doctor View on GitHub