# iphone-notes Create real **Apple Notes** on an iPhone from Linux by driving [icloud.com/notes](https://www.icloud.com/notes/) with a **Rust** CLI (`chromiumoxide` + headless Chromium) and a saved browser profile. Also packaged as a Cursor/Goose agent skill (`SKILL.md`). ## Quick start ```bash ./scripts/setup.sh # cargo build --release + Chromium + ~/.local/bin icloud-note login # Apple ID + 2FA once (visible window) icloud-note create --title "Hello" --body "From Linux" icloud-note update --title "Hello" --body "Revised from Linux" ``` ## CLI | Command | Purpose | |---|---| | `icloud-note setup` | Build/install binary + ensure Chromium | | `icloud-note login` | **Only** command that opens a visible browser | | `icloud-note status` | Headless session check | | `icloud-note create` | Headless **new** note (`--title`, `--body` / `--body-file`) | | `icloud-note update` | Headless **update** existing note by title (never creates) | ## Formatting Bodies may be plain text or light Markdown. The CLI rewrites them to match [Apple Notes formatting](https://support.apple.com/guide/iphone/create-and-format-notes-iph1ac0b3a2/ios) ([Mac guide](https://support.apple.com/guide/notes/format-notes-apd1955d3b21/mac), [lists](https://support.apple.com/guide/notes/add-lists-apd93c815aa0/mac)): - First line = **Title**; blank line before the rest - `##` / `###` → **Heading** / **Subheading** (collapsible sections on device) - List shortcuts: `*` → bulleted (`•`), `-` → dashed (`–`), `1.` → numbered - `- [ ]` / `- [x]` → checklist (☐ / ☑) - `---` → divider line; `> …` → block quote; pipe tables → aligned monospaced grid - Inline `**bold**` / links / fences cleaned (rich bold/highlight needs the iOS UI) `ICLOUD_NOTES_DRY_RUN=1` prints a formatted preview without touching iCloud. **Updates and Title size:** Prefer `update` after installing a build that copies TopoText from `createNoteWithTitleText` (first line Title, rest Body). Older updates used `createInitialTopoTextString`, which can mark every line as Title (huge text). You do **not** need a permanent new note — re-`update` with the fixed CLI, or create once and delete the broken copy if you prefer. ## Layout ```text src/ Rust library + CLI (chromiumoxide) scripts/setup.sh Build, install, skill symlinks SKILL.md Agent instructions tests/ cargo test + CLI dry-run + Conventional Commits legacy/nodejs/ Previous Playwright implementation (reference only) ``` Runtime config (**never commit** — see [SECURITY.md](SECURITY.md)): ```text ~/.config/icloud-notes/ browser-profile/ Chromium user-data / cookies (private) session.ok Marker after successful login ``` This public repo contains **no** Apple account credentials. Auth stays in that local XDG directory after `icloud-note login`. Optional: `ICLOUD_NOTES_CHROME=/path/to/chrome` Tests: `ICLOUD_NOTES_DRY_RUN=1` ## Tests ```bash ./tests/run.sh # or cargo test && ./tests/cli.test.sh && ./tests/conventional-commits.test.sh ``` ## Why Rust Single binary, `cargo test` for helpers, and headless Chromium via CDP without a Node/Playwright process flashing a window on Linux. The Notes web app is still driven through JavaScript evaluation — that part is inherent to iCloud. ## License MIT