From 5c61196f27b9342e5f25414c11df5710f956f406 Mon Sep 17 00:00:00 2001 From: Christopher Warner Date: Sat, 10 Oct 2026 18:47:24 -0400 Subject: feat!: rewrite icloud-note CLI in Rust with chromiumoxide Replace the Node/Playwright driver with a single Rust binary so create/status stay headless without a visible browser. Move the previous implementation to legacy/nodejs for reference. BREAKING CHANGE: the supported CLI is the Rust `icloud-note` binary; the Node entrypoint is no longer installed by setup.sh. Co-authored-by: Cursor --- README.md | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index c3e80b7..b0e79be 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,16 @@ # iphone-notes Create real **Apple Notes** on an iPhone from Linux by driving -[icloud.com/notes](https://www.icloud.com/notes/) with Playwright and a saved -Apple ID browser session. +[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`) so agents can forward -prompt results to your phone as Notes. +Also packaged as a Cursor/Goose agent skill (`SKILL.md`). ## Quick start ```bash -./scripts/setup.sh -icloud-note login # Apple ID + 2FA once (graphical session) +./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" ``` @@ -19,44 +18,45 @@ icloud-note create --title "Hello" --body "From Linux" | Command | Purpose | |---|---| -| `icloud-note setup` | Install Playwright Chromium + `~/.local/bin` wrapper | -| `icloud-note login` | **Only** command that opens a visible browser (one-time Apple ID) | -| `icloud-note status` | Headless check that the saved session can open Notes | -| `icloud-note create` | Headless create (`--title`, `--body` / `--body-file`) — no window | +| `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 create (`--title`, `--body` / `--body-file`) | ## Layout ```text -SKILL.md Agent instructions -scripts/icloud-note.mjs CLI -scripts/setup.sh One-time install + skill symlinks -tests/cli.test.sh Smoke tests (no Apple network required) +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 (not in git): ```text ~/.config/icloud-notes/ - storage-state.json Cookies/session for headless create (private) - browser-profile/ Used only during `login` (private) - node_modules/ Playwright install + browser-profile/ Chromium user-data (private) + session.ok Marker after successful login ``` +Optional: `ICLOUD_NOTES_CHROME=/path/to/chrome` +Tests: `ICLOUD_NOTES_DRY_RUN=1` + ## Tests ```bash -npm test -# or ./tests/run.sh +# or +cargo test && ./tests/cli.test.sh && ./tests/conventional-commits.test.sh ``` -Covers: - -- Pure helpers (`tests/helpers.test.mjs`) — note formatting, auth heuristics, argv, Conventional Commits subjects -- CLI dry-run (`tests/cli.test.sh`) — help, create/status/login without a browser (`ICLOUD_NOTES_DRY_RUN=1`) -- Git history (`tests/conventional-commits.test.sh`) — every commit subject matches Conventional Commits 1.0.0 +## Why Rust -Live Apple create/status (real headless Chromium) is manual after `icloud-note login`. +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 -- cgit v1.2.3