diff options
Diffstat (limited to 'SKILL.md')
| -rw-r--r-- | SKILL.md | 59 |
1 files changed, 21 insertions, 38 deletions
@@ -2,23 +2,24 @@ name: iphone-icloud-notes description: >- Create real Apple Notes on the user's iPhone by driving icloud.com/notes from - Linux (Playwright + saved Apple ID session). Use when the user asks to create - a note, send/forward results to their iPhone, push text to Apple Notes, or - mentions icloud.com/notes / iCloud Notes from Linux. + Linux with the Rust icloud-note CLI (headless Chromium). Use when the user asks + to create a note, send/forward results to their iPhone, push text to Apple + Notes, or mentions icloud.com/notes / iCloud Notes from Linux. --- -# iPhone notes via icloud.com/notes +# iPhone notes via icloud.com/notes (Rust) ## Goal When asked to create a note or forward prompt results to the iPhone, **create a -real Apple Note** through the iCloud Notes web app. Do not use LocalSend for this -unless the user explicitly wants file transfer instead of Notes. +real Apple Note** through the iCloud Notes web app using the **Rust** +`icloud-note` binary. Do not use LocalSend unless the user wants file transfer. ## Source of truth Repo: `~/Code/iphone-notes` -Linked as: `~/.agents/skills/iphone-icloud-notes` → that repo +Binary: `~/.local/bin/icloud-note` (from `cargo build --release`) +Skill link: `~/.agents/skills/iphone-icloud-notes` → that repo ## Helper @@ -30,42 +31,24 @@ icloud-note create --title "Title" --body-file /path/to.txt icloud-note create --title "Title" --body-file - # stdin ``` -`create` / `status` are **always headless** (no visible browser). Never pass flags -to force a window. Never run `login` unless the user must re-authenticate. - -Do **not** set `ICLOUD_NOTES_DRY_RUN=1` for real sends (tests only). - -If `icloud-note` is missing from PATH: +If missing from PATH: ```bash -node "$HOME/Code/iphone-notes/scripts/icloud-note.mjs" … +"$HOME/Code/iphone-notes/target/release/icloud-note" … +# or: cargo run --manifest-path "$HOME/Code/iphone-notes/Cargo.toml" -- … ``` -Config / session (XDG): `~/.config/icloud-notes/` -Browser profile: `~/.config/icloud-notes/browser-profile/` -(Do not commit the browser profile or Apple credentials.) - -## Agent workflow +`create` / `status` are **always headless**. Never run `login` unless the user +must re-authenticate. Do **not** set `ICLOUD_NOTES_DRY_RUN=1` for real sends. -1. **Prepare content** — title (short) + body (full text to send). -2. **`icloud-note status`** — if not logged in, tell the user to run - `icloud-note login` once (Apple ID + 2FA in a browser window), then retry. - Do not invent note creation; do not claim success without a successful create. -3. **Create** — write body to a temp file if long, then: +Config: `~/.config/icloud-notes/` (browser profile; private) - ```bash - icloud-note create --title "$TITLE" --body-file "$TMPFILE" - ``` - -4. **Report** — quote the script’s success line (title). Note syncs to iPhone - Notes when iCloud Notes is enabled on the device. - -## Rules +## Agent workflow -- Prefer this skill over LocalSend / email for “send a note to my iPhone.” -- Never store Apple ID passwords in the skill, repo, or chat logs. -- Session cookies live only under `~/.config/icloud-notes/browser-profile/` (mode keep private). -- First-line-as-title matches Apple Notes; the helper already formats title + body. +1. Prepare title + body. +2. `icloud-note status` — if not logged in, ask the user to run `icloud-note login`. +3. `icloud-note create --title "$TITLE" --body-file "$TMPFILE"` +4. Report the `created:` line. Syncs to iPhone when iCloud Notes is enabled. ## Setup (human / once) @@ -74,5 +57,5 @@ Browser profile: `~/.config/icloud-notes/browser-profile/` icloud-note login ``` -Requires a graphical session for `login` only. After that, `create` / `status` -use `~/.config/icloud-notes/storage-state.json` headlessly — no window. +Requires Rust (`cargo`) and a Chromium binary (setup can install Playwright’s +Chromium under `~/.cache/ms-playwright`). |
