Apple PIM CLI Tools

GitHub: github.com/omarshahine/Apple-PIM-Agent-Plugin
Native macOS integration for Calendar, Reminders, Contacts, and Mail using EventKit, Contacts, and JXA frameworks. Works with Claude Code (via MCP) and OpenClaw (via native tool registration).
Features
- Calendar Management: List calendars, create/read/update/delete events, search by date/title, attendee support (add/replace attendees via CalDAV invitation emails)
- Reminder Management: List reminder lists, create/complete/update/delete reminders, search
- Contact Management: List groups, create/read/update/delete contacts, search by name/email/phone, birthday support (with or without year)
- Mail Integration: List accounts/mailboxes, read/search/send/reply/move/delete messages, update flags, attachment support (metadata, save-to-disk, send/reply with attachments), verify sender authentication (via Apple Mail.app + JXA/AppleScript)
- Recurrence Rules: Create recurring events and reminders (daily, weekly, monthly, yearly)
- Batch Operations: Create multiple events or reminders in a single efficient transaction
- Per-Domain Control: Enable or disable entire domains (calendars, reminders, contacts, mail) independently
- Multi-Agent Isolation: Per-call config/profile overrides for workspace isolation
- Works with Claude Code and OpenClaw: Same Swift CLIs, different integration layers
Prerequisites
- macOS 13.0 or later
- Swift 5.9 or later (comes with Xcode 15+)
- Node.js 18+ (for MCP server or OpenClaw plugin)
- Mail.app must be running for mail commands (it is not launched automatically)
Installation
Swift CLI Tools (Required for both platforms)
# Build the Swift CLIs
./setup.sh
# Optional: install to PATH for system-wide access
./setup.sh --install
# Add to your shell profile (if not already there)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
The --install flag creates symlinks in ~/.local/bin/, so rebuilding (swift build -c release) automatically updates the global commands.
Claude Code Plugin
Inside Claude Code, run:
/plugin marketplace add omarshahine/Apple-PIM-Agent-Plugin
/plugin install apple-pim@apple-pim
Then build the Swift CLIs (once, from a shell):
~/.claude/plugins/cache/apple-pim/apple-pim/*/setup.sh
Restart Claude Code to load the MCP server. The pim-assistant agent triggers automatically when you mention scheduling, reminders, contacts, or email.
OpenClaw Plugin
# Install from ClawHub
openclaw plugins install apple-pim-cli
# Or install from npm
npm install -g apple-pim-cli
Under the hood, the plugin spawns native macOS Swift binaries (calendar-cli, reminder-cli, contacts-cli, mail-cli) that interact with EventKit, Contacts, and Mail.app via Apple's frameworks.
Prerequisites: Swift CLIs must be on PATH (run ./setup.sh --install first).
Optionally, configure the binary location if the CLIs are not on PATH:
# In your OpenClaw config:
# plugins.entries.apple-pim-cli.config.binDir = "/path/to/swift/.build/release"
Post-Installation (both platforms)
Grant permissions: On first use, macOS will prompt for Calendar, Reminders, and Contacts access. Grant these permissions in System Settings > Privacy & Security.
Mail.app Automation: For mail features, you also need to grant Automation permission:
- System Settings > Privacy & Security > Automation
- Allow Terminal (or your IDE) to control Mail.app
Development Installation
git clone https://github.com/omarshahine/Apple-PIM-Agent-Plugin.git
cd Apple-PIM-Agent-Plugin
./setup.sh
Then inside Claude Code, add the local checkout as a marketplace:
/plugin marketplace add /absolute/path/to/Apple-PIM-Agent-Plugin
/plugin install apple-pim@apple-pim
For OpenClaw (loads TypeScript directly, no build step):
openclaw plugins install -l ./openclaw
Configuration
The plugin includes a full access control system (PIMConfig) that lets you restrict which calendars, reminder lists, and domains each agent can see. This is useful for:
- Access control — allowlist or blocklist specific calendars and reminder lists
- Privacy — hide calendars you don't need the agent to see
- Reducing noise — only show relevant reminder lists
- Avoiding conflicts — disable mail here if you use a separate email MCP
- Multi-agent setups — give each agent a profile with different access
- Read-only calendars — let agents see but not modify certain calendars
Interactive Setup (Claude Code)