summaryrefslogtreecommitdiff
path: root/scripts/setup.sh
diff options
context:
space:
mode:
authorChristopher Warner <cwarner@kernelcode.com>2026-10-10 18:28:43 -0400
committerChristopher Warner <cwarner@kernelcode.com>2026-10-10 18:28:43 -0400
commitef0165cc6cbe001997e5d05af5de6d4849481d7a (patch)
tree98b10c875c012a6b18160f8897f444aceff60790 /scripts/setup.sh
downloadiphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.gz
iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.bz2
iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.tar.xz
iphone-notes-ef0165cc6cbe001997e5d05af5de6d4849481d7a.zip
feat: add icloud.com/notes helper and agent skill
Send real Apple Notes from Linux via a Playwright session so agents can forward results to an iPhone without LocalSend. Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'scripts/setup.sh')
-rwxr-xr-xscripts/setup.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/setup.sh b/scripts/setup.sh
new file mode 100755
index 0000000..a4a03fa
--- /dev/null
+++ b/scripts/setup.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+# Install Playwright + Chromium for icloud-note under ~/.config/icloud-notes
+set -euo pipefail
+
+REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+CONFIG_DIR="${ICLOUD_NOTES_CONFIG:-$HOME/.config/icloud-notes}"
+SKILL_SCRIPT="$REPO_ROOT/scripts/icloud-note.mjs"
+BIN="$HOME/.local/bin/icloud-note"
+AGENTS_SKILL="$HOME/.agents/skills/iphone-icloud-notes"
+CURSOR_SKILL="$HOME/.cursor/skills/iphone-icloud-notes"
+
+mkdir -p "$CONFIG_DIR" "$HOME/.local/bin" "$HOME/.agents/skills" "$HOME/.cursor/skills"
+chmod 700 "$CONFIG_DIR"
+
+cd "$CONFIG_DIR"
+if [[ ! -f package.json ]]; then
+ npm init -y >/dev/null
+fi
+
+npm install playwright@latest
+npx playwright install chromium
+
+cat > "$BIN" <<EOF
+#!/usr/bin/env bash
+exec node "$SKILL_SCRIPT" "\$@"
+EOF
+chmod 755 "$BIN" "$SKILL_SCRIPT" "$REPO_ROOT/scripts/setup.sh"
+
+# Point agent skill dirs at this repo (source of truth)
+ln -sfn "$REPO_ROOT" "$AGENTS_SKILL"
+ln -sfn "$REPO_ROOT" "$CURSOR_SKILL"
+
+echo "ok: playwright installed in $CONFIG_DIR"
+echo "ok: wrapper $BIN"
+echo "ok: skill linked -> $REPO_ROOT"
+echo "Next: icloud-note login"