# kzaremski/apple-notes-exporter architecture

> Architecture diagram of the GitHub repository kzaremski/apple-notes-exporter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kzaremski/apple-notes-exporter
- Repository: https://github.com/kzaremski/apple-notes-exporter

## Overview

Apple Notes Exporter reads notes and their hierarchy from the macOS Notes store, lets users select and filter them, converts note content and attachments into many export formats, then delivers them as a folder tree, archive, or joined file. The same export engine is exposed through the GUI, CLI, Shortcuts, and an MCP server; incremental runs track changes and prune removed notes. The graph preserves documented capabilities, but some format and delivery internals are unsampled, so uncertain connections are omitted.

Main entry points: [`Apple Notes Exporter/Apple Notes Exporter CLI/CLIExportEngine.swift`](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20CLI/CLIExportEngine.swift) (CLI export engine), [`Apple Notes Exporter/Apple Notes Exporter/Repository/NotesRepository.swift`](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Repository/NotesRepository.swift) (Notes repository), [`Apple Notes Exporter/Apple Notes Exporter/ViewModels/ExportViewModel.swift`](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ViewModels/ExportViewModel.swift) (GUI export), [`Apple Notes Exporter/Apple Notes Exporter/AppleNotesExporterView.swift`](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppleNotesExporterView.swift) (Exporter app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User interfaces"]
  node_app_view["Exporter app"]
  node_notes_vm["Note selection"]
  node_selector["Hierarchy selector"]
  node_export_vm["GUI export"]
  node_cli["CLI commands"]
end

subgraph group_reading["Notes access"]
  node_repository[("Notes repository")]
  node_apple_notes_kit["Notes database bridge<br/>[AppleNotesKit.h]"]
  node_table_parser["Table parser<br/>[TableParser.swift]"]
end

subgraph group_conversion["Export and conversion"]
  node_cli_engine["CLI export engine"]
  node_note_formats["Note formatters"]
  node_html_generator["HTML generator"]
  node_attachment_processor["Attachment processing"]
end

subgraph group_delivery["Delivery and sync"]
  node_export_support["Output delivery"]
  node_sync_manifest["Sync manifest<br/>[SyncManifest.swift]"]
end

subgraph group_integrations["Automation interfaces"]
  node_shortcuts["Shortcuts actions<br/>[AppIntents.swift]"]
  node_mcp_server["MCP server"]
  node_mcp_handlers["MCP tools"]
end

node_gui_user(("GUI user"))
node_cli_user(("CLI user"))
node_ai_client(("AI assistant"))
node_notes_store[("Apple Notes store")]

node_gui_user -->|"uses"| node_app_view
node_app_view -->|"loads notes"| node_notes_vm
node_app_view -->|"starts export"| node_export_vm
node_app_view -->|"presents selection"| node_selector
node_notes_vm -->|"fetches notes"| node_repository
node_repository -.->|"reads store"| node_apple_notes_kit
node_repository -->|"queries"| node_notes_store
node_repository -->|"generates HTML"| node_html_generator
node_cli_user -->|"runs command"| node_cli
node_cli -->|"requests export"| node_cli_engine
node_cli_engine -->|"fetches notes"| node_repository
node_export_vm -->|"fetches note HTML"| node_repository
node_export_vm -->|"processes attachments"| node_attachment_processor
node_export_vm -->|"tracks incremental runs"| node_sync_manifest
node_cli_engine -->|"tracks incremental runs"| node_sync_manifest
node_cli_engine -->|"processes attachments"| node_attachment_processor
node_export_vm -.->|"delivers files"| node_export_support
node_cli_engine -.->|"delivers files"| node_export_support
node_shortcuts -->|"uses shared engine"| node_cli_engine
node_ai_client -->|"connects"| node_mcp_server
node_mcp_server -->|"dispatches tools"| node_mcp_handlers
node_mcp_handlers -->|"exports notes"| node_cli_engine
node_note_formats -.->|"parses embedded tables"| node_table_parser

click node_app_view "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppleNotesExporterView.swift"
click node_notes_vm "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ViewModels/NotesViewModel.swift"
click node_selector "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/NoteSelectorView.swift"
click node_export_vm "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ViewModels/ExportViewModel.swift"
click node_repository "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Repository/NotesRepository.swift"
click node_apple_notes_kit "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppleNotesKit/AppleNotesKit.h"
click node_table_parser "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/TableParser.swift"
click node_cli "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20CLI/Commands/ExportCommand.swift"
click node_cli_engine "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20CLI/CLIExportEngine.swift"
click node_note_formats "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Models/NotesNote%2BExport.swift"
click node_html_generator "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/NoteHTMLGenerator.swift"
click node_attachment_processor "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/HTMLAttachmentProcessor.swift"
click node_export_support "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ExportSupport.swift"
click node_sync_manifest "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Models/SyncManifest.swift"
click node_shortcuts "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppIntents.swift"
click node_mcp_server "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20MCP/NotesMCPServer.swift"
click node_mcp_handlers "https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20MCP/MCPToolHandlers.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_view,node_notes_vm,node_selector,node_export_vm,node_cli,node_gui_user,node_cli_user toneBlue
class node_repository,node_apple_notes_kit,node_table_parser,node_notes_store toneAmber
class node_cli_engine,node_note_formats,node_html_generator,node_attachment_processor toneMint
class node_export_support,node_sync_manifest toneRose
class node_shortcuts,node_mcp_server,node_mcp_handlers,node_ai_client toneIndigo
```

## Components

### User interfaces

- [Exporter app](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppleNotesExporterView.swift): `Apple Notes Exporter/Apple Notes Exporter/AppleNotesExporterView.swift`
- [Note selection](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ViewModels/NotesViewModel.swift): `Apple Notes Exporter/Apple Notes Exporter/ViewModels/NotesViewModel.swift`
- [Hierarchy selector](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/NoteSelectorView.swift): `Apple Notes Exporter/Apple Notes Exporter/NoteSelectorView.swift`
- [GUI export](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ViewModels/ExportViewModel.swift): `Apple Notes Exporter/Apple Notes Exporter/ViewModels/ExportViewModel.swift`
- [CLI commands](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20CLI/Commands/ExportCommand.swift): `Apple Notes Exporter/Apple Notes Exporter CLI/Commands/ExportCommand.swift`

### Notes access

- [Notes repository](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Repository/NotesRepository.swift): `Apple Notes Exporter/Apple Notes Exporter/Repository/NotesRepository.swift`
- [Notes database bridge](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppleNotesKit/AppleNotesKit.h): `Apple Notes Exporter/Apple Notes Exporter/AppleNotesKit/AppleNotesKit.h`
- [Table parser](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/TableParser.swift): `Apple Notes Exporter/Apple Notes Exporter/TableParser.swift`

### Export and conversion

- [CLI export engine](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20CLI/CLIExportEngine.swift): `Apple Notes Exporter/Apple Notes Exporter CLI/CLIExportEngine.swift`
- [Note formatters](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Models/NotesNote%2BExport.swift): `Apple Notes Exporter/Apple Notes Exporter/Models/NotesNote+Export.swift`
- [HTML generator](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/NoteHTMLGenerator.swift): `Apple Notes Exporter/Apple Notes Exporter/NoteHTMLGenerator.swift`
- [Attachment processing](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/HTMLAttachmentProcessor.swift): `Apple Notes Exporter/Apple Notes Exporter/HTMLAttachmentProcessor.swift`

### Delivery and sync

- [Output delivery](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/ExportSupport.swift): `Apple Notes Exporter/Apple Notes Exporter/ExportSupport.swift`
- [Sync manifest](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/Models/SyncManifest.swift): `Apple Notes Exporter/Apple Notes Exporter/Models/SyncManifest.swift`

### Automation interfaces

- [Shortcuts actions](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter/AppIntents.swift): `Apple Notes Exporter/Apple Notes Exporter/AppIntents.swift`
- [MCP server](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20MCP/NotesMCPServer.swift): `Apple Notes Exporter/Apple Notes Exporter MCP/NotesMCPServer.swift`
- [MCP tools](https://github.com/kzaremski/apple-notes-exporter/blob/main/Apple%20Notes%20Exporter/Apple%20Notes%20Exporter%20MCP/MCPToolHandlers.swift): `Apple Notes Exporter/Apple Notes Exporter MCP/MCPToolHandlers.swift`

### Other components

- **GUI user**
- **CLI user**
- **AI assistant**
- **Apple Notes store**

## Connections

- GUI user → Exporter app: uses (evidence: `README.md`)
- Exporter app → Note selection: loads notes (evidence: `Apple Notes Exporter/Apple Notes Exporter/AppleNotesExporterView.swift`)
- Exporter app → GUI export: starts export (evidence: `Apple Notes Exporter/Apple Notes Exporter/AppleNotesExporterView.swift`)
- Exporter app → Hierarchy selector: presents selection (evidence: `Apple Notes Exporter/Apple Notes Exporter/AppleNotesExporterView.swift`)
- Note selection → Notes repository: fetches notes (evidence: `Apple Notes Exporter/Apple Notes Exporter/ViewModels/NotesViewModel.swift`)
- Notes repository → Notes database bridge: reads store
- Notes repository → Apple Notes store: queries (evidence: `Apple Notes Exporter/Apple Notes Exporter/Repository/NotesRepository.swift`)
- Notes repository → HTML generator: generates HTML (evidence: `Apple Notes Exporter/Apple Notes Exporter/Repository/NotesRepository.swift`)
- CLI user → CLI commands: runs command (evidence: `README.md`)
- CLI commands → CLI export engine: requests export (evidence: `Apple Notes Exporter/Apple Notes Exporter CLI/Commands/ExportCommand.swift`)
- CLI export engine → Notes repository: fetches notes (evidence: `Apple Notes Exporter/Apple Notes Exporter CLI/CLIExportEngine.swift`)
- GUI export → Notes repository: fetches note HTML (evidence: `Apple Notes Exporter/Apple Notes Exporter/ViewModels/ExportViewModel.swift`)
- GUI export → Attachment processing: processes attachments (evidence: `Apple Notes Exporter/Apple Notes Exporter/ViewModels/ExportViewModel.swift`)
- GUI export → Sync manifest: tracks incremental runs (evidence: `Apple Notes Exporter/Apple Notes Exporter/ViewModels/ExportViewModel.swift`)
- CLI export engine → Sync manifest: tracks incremental runs (evidence: `Apple Notes Exporter/Apple Notes Exporter CLI/CLIExportEngine.swift`)
- CLI export engine → Attachment processing: processes attachments (evidence: `Apple Notes Exporter/Apple Notes Exporter CLI/CLIExportEngine.swift`)
- GUI export → Output delivery: delivers files
- CLI export engine → Output delivery: delivers files
- Shortcuts actions → CLI export engine: uses shared engine (evidence: `README.md`)
- AI assistant → MCP server: connects (evidence: `README.md`)
- MCP server → MCP tools: dispatches tools (evidence: `Apple Notes Exporter/Apple Notes Exporter MCP/NotesMCPServer.swift`)
- MCP tools → CLI export engine: exports notes (evidence: `Apple Notes Exporter/Apple Notes Exporter MCP/MCPToolHandlers.swift`)
- Note formatters → Table parser: parses embedded tables
