CASOONopen source · Rust + AppleScript/JXA
Safe, deterministic macOS automation & migration.
MacFly puts a read-side data firewall, SHA-256 plan approval, and two-way migration pipelines between AI agents (or local Markdown knowledge bases) and your Apple Notes, Mail, Contacts, Calendar, Reminders, Safari, and Shortcuts.
cargo install macflymacfly doctormacfly notes export --output ./backup$ macfly doctor ✓ MacFly Doctor OS: macos osascript: OK Config: ~/.config/macfly/config.json (loaded) Profile: default • macOS Adapters (2) ✓ Apple Notes: ok (1 account, 240 notes) ✓ Apple Mail: ok (2 accounts, 14 unread, 2 signatures) $ macfly plan create --input cleanup.json ! Change Plan plan-1795352400-8f4a21c0 Status: PendingApproval Risk: Medium Approval code: 8F4A21 • Planned operations (3) • [notes.move] Note 'Q4 Roadmap' → '10 · Work/Projects' • [mail.create_draft] Draft to team@example.org (Apple Mail signature) • [shortcuts.run] Shortcut 'Office Focus' (allowlisted) Next steps: - Review and approve interactively $ macfly plan approve plan-1795352400-8f4a21c0
- Notes, Mail, Contacts, Calendar, Reminders, Safari, and Shortcuts under one typed CLI & MCP
- 7 macOS apps
- two-way migrations across Markdown, Plaintext, HTML, JSON, JSONL, and RFC-4180 CSV
- 6 formats
- canonical plan hash binding with interactive TTY approval and JSONL audit journal
- SHA-256
- 100% Rust core + stdin-only JXA — no Swift toolchain, no Xcode project, no private DB hacks
- 0 SDK drift
Safety & migration lifecycle
No blind writes — every change and import goes through four steps
Whether triggered by a multi-format migration, a local LLM, an MCP client, or a shell script, mutations are validated, hashed, reviewed, and journaled.
Step 1
plan.json / importPropose or import
An agent proposes operations over MCP, or
notes/reminders importparses.md,.csv,.json,.htmlfiles.Step 2
sha256 + 0600Validate & hash
Rust checks scopes, allowlists, and revisions, then locks the plan with a SHA-256 hash and TTL.
Step 3
TTY + 6-char codeApprove
You review the
runemarkplan report in an interactive terminal and confirm the hash code.Step 4
journal.jsonlApply & audit
MacFly verifies integrity pre-flight, executes losslessly, and appends every result to the audit log.
Why Rust + AppleScript/JXA — for AI agents and migrations alike
Two-way migrations (Apple ⇄ Markdown, CSV, JSON, HTML)
Export Apple Notes trees, project emails, contacts, reminders, calendar schedules, and open Safari tabs into clean Markdown files with YAML frontmatter. Import notes and tasks from Markdown, HTML, JSON, JSONL, or CSV (Notion, Evernote, Obsidian, Todoist) safely through hashed plans.
Deterministic core, thin macOS edge
Policy evaluation, DLP redaction, HTML normalization, multi-format import parsers, note fidelity checks, SHA-256 plan hashing, and the audit journal live in pure, memory-safe Rust — tested offline in milliseconds with
cargo testand immune to yearly macOS SDK drift.Read-side Data Firewall (DLP) & Local AI ready
Pair MacFly with local LLMs (Ollama, LM Studio, MLX) so private data never leaves your Mac. When using cloud models, profile denylists, automatic regex redaction (IBAN, API keys, OTPs), and untrusted_external mail framing protect every read.
Fidelity guard & cleanup audits
notes auditandcontacts audituncover empty folders, single-note folders, duplicate titles, and duplicate contacts. When reorganizing Apple Notes, MacFly protects attachments, tables, checklists, and applenotes:// links from destructive edits.Single Point of Truth for Mail, Safari & Shortcuts
No duplicate IMAP passwords and no second copy of your email footer — signatures are pulled straight from Apple Mail. Capture open Safari research tabs directly into Apple Notes, and trigger allowlisted Shortcuts for Focus modes or HomeKit scenes.
Consistent terminal UX powered by runemark
Human-readable output uses
runemarkfor semantic verdicts, grouped findings, actionable error blocks, and NO_COLOR compliance — while--format json,--format agent, andmacfly mcpdeliver pure machine-readable JSON.
| Topic | Direct provider integrationCloud OAuth Connectors | Local-first on macOSMacFly + Local AIPrivacy-first |
|---|---|---|
| Mail & app coverage | Usually Gmail or Microsoft 365 only; separate OAuth setup per account. | Every account in Apple Mail (iCloud, Gmail, Exchange, custom IMAP) plus Notes, Contacts, Calendar, Reminders, Safari & Shortcuts. |
| Migrations & backups | Locked into vendor cloud silos. | Two-way Markdown/CSV/JSON/HTML pipelines for Git knowledge bases, Obsidian, Notion, and local archives. |
| Data residency | Emails and notes are transmitted to cloud AI servers. | 100% local on Apple Silicon with Ollama/MLX; DLP firewall when using cloud models. |
| Write & send safety | Broad OAuth scopes (Mail.Send) exposed to indirect prompt injection. | Drafts by default, SHA-256 plan approval in interactive TTY, MCP read + plan-only. |
Mail & app coverage
Cloud OAuth ConnectorsUsually Gmail or Microsoft 365 only; separate OAuth setup per account.
MacFly + Local AIEvery account in Apple Mail (iCloud, Gmail, Exchange, custom IMAP) plus Notes, Contacts, Calendar, Reminders, Safari & Shortcuts.
Migrations & backups
Cloud OAuth ConnectorsLocked into vendor cloud silos.
MacFly + Local AITwo-way Markdown/CSV/JSON/HTML pipelines for Git knowledge bases, Obsidian, Notion, and local archives.
Data residency
Cloud OAuth ConnectorsEmails and notes are transmitted to cloud AI servers.
MacFly + Local AI100% local on Apple Silicon with Ollama/MLX; DLP firewall when using cloud models.
Write & send safety
Cloud OAuth ConnectorsBroad OAuth scopes (Mail.Send) exposed to indirect prompt injection.
MacFly + Local AIDrafts by default, SHA-256 plan approval in interactive TTY, MCP read + plan-only.
Get started in two minutes
Install from crates.io, verify macOS permissions, and audit, automate, or migrate your Apple apps.
- Install the binary:
cargo install macfly - Check macOS access & create config:
macfly doctor·macfly config init - Audit & clean up:
macfly notes audit·macfly contacts audit - Export or import:
macfly notes export --output ./backup·macfly notes import --input ./docs --folder "00 · Inbox" --recursive - Connect an MCP client: point stdio to
macfly mcp --profile default
# 1. Install from crates.io & verify macOS access
cargo install macfly
macfly doctor
macfly config init
# 2. Audit & reorganize Notes, Mail, Contacts, Calendar, Reminders & Safari
macfly notes audit
macfly contacts audit
macfly mail overview
macfly safari tabs
macfly context daily-brief
# 3. Migrate & back up (Markdown, CSV, JSON, JSONL, HTML)
macfly notes export --output ./notes-backup --folder "10 · Work"
macfly notes import --input ./notion-or-evernote --folder "00 · Inbox" --recursive
macfly mail export --output ./mail-archive --query "Invoice"
# 4. Cross-app 360° dossiers, Typst reports, SKILL.md & launchd schedules
macfly context person "Acme"
macfly context meeting-prep --query "Kickoff" --create-note
macfly context weekly-review
macfly report person "Acme" --output ./dossier-acme.typ
macfly skill export --output ./.claude/skills/macfly