# 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 **Apple Notes style** before writing: - First line = Title; blank line before the rest - `##` / `###` → Heading / Subheading (no `#` markers) - `-` / `*` bullets → `•`; `1.` lists kept; `- [ ]` / `- [x]` → ☐ / ☑ - Inline `**bold**`, links, and outer code fences cleaned up - Short paragraphs and list blocks spaced like Notes (not a Markdown dump) `ICLOUD_NOTES_DRY_RUN=1` prints a formatted preview without touching iCloud. ## 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