Date: 2026-03-24 Status: Draft Scope: jd-cli — configurable JDex backend, Apple Notes sync, zero naming
- Bidirectional sync between
.jd-index.yamland Apple Notes - Configurable JDex backend (yaml, markdown, or future backends)
- Configurable standard zero names
- Apple Notes folder structure mirrors JD areas/categories
jdex:
backend: yaml # yaml | markdown
path: .jd-index.yaml # for yaml backend
notes:
enabled: true
backend: apple-notes # apple-notes | obsidian | none
sync:
enabled: true
direction: bidirectional # push | pull | bidirectional
auto: false # true = sync on every jd mv/create
filter:
exclude_zeros: true # skip .00-.09 standard zero IDs
exclude_status: [archived]
include_categories: all # or [26, 43, 61] for specific cats
folders:
style: area # area = "20-29 People", category = nested "20-29 People/26 Jen & Divorce"
standard_zeros:
ids:
'00':
purpose: jdex
name: JDex for category {category} # configurable
'01':
purpose: inbox
name: Inbox for category {category} # configurable
# ... etc
categories:
x0:
purpose: area-meta
name: Management of area {area_range} # FIX: currently says "Meta - {area}"For each YAML entry matching the filter:
- Determine target folder: area-level (
20-29 People) or category-level - Ensure folder exists in Apple Notes (create if missing)
- Check if note with title
XX.YY Titleexists - If missing: create note with metadata body (Location, Status, etc.)
- If exists: update title if changed (rename via JXA)
For each Apple Note in JD-named folders:
- Parse the note title for JD ID (
XX.YY) - Find the matching YAML entry
- Read the note's plain text content
- Store in YAML entry's
notesfield (plain text snapshot) - If no YAML entry exists: warn (orphan note in Apple Notes)
- Title mismatch: YAML wins (it's the registry)
- Content: Apple Notes wins (it's where humans write)
- ID existence: YAML wins (jd mv/create/delete manage IDs)
jd notes sync # bidirectional sync per config
jd notes sync --push # YAML → Apple Notes only
jd notes sync --pull # Apple Notes → YAML only
jd notes sync --dry-run # show what would change
jd notes sync --category 26 # sync one category only
Existing commands continue to work:
jd notes create XX.YY # create note in Apple Notes + YAML
jd notes open XX.YY # open in Notes.app
jd notes scan # compare state
- Config schema — add
jdexandnotessections to config parser - Backend selection —
get_jdex()readsjdex.backendfrom config - Fix standard zero names —
categories.x0.nametemplate; rename command respects config - Sync engine —
johnnydecimal/sync/notes.pywith push/pull/conflict logic - CLI wiring —
jd notes synccommand with options - Tests — mock Apple Notes JXA calls; test push/pull/conflict scenarios
apple-notes-pyfor JXA read/write (or use jd-cli's ownjohnnydecimal/notes.py)- Existing
YamlJDexBackendfor YAML read/write
- Should
jd mvauto-sync (rename note when ID renumbers)? Probably yes ifnotes.sync.auto: true. - Should
jd notes syncbe a plugin or core? Core for now. - Should we store Apple Notes note ID (CoreData UUID) in YAML for reliable matching? Title-based matching is fragile if user renames note.