|
| 1 | +# Apple Shortcuts: Add to Wiki |
| 2 | + |
| 3 | +Two shortcuts for ingesting notes into StackMemory wiki via iMessage, Siri, or share sheet. |
| 4 | + |
| 5 | +## Shortcut A: "Add to Wiki" (passive — next session picks it up) |
| 6 | + |
| 7 | +### Setup in Shortcuts app: |
| 8 | + |
| 9 | +1. **Name**: "Add to Wiki" |
| 10 | +2. **Actions**: |
| 11 | + - `Ask for Input` → Type: Text, Prompt: "What to remember?" |
| 12 | + - `Get Current Date` → Format: `yyyy-MM-dd-HHmm` |
| 13 | + - `Save File` → Save to: `iCloud Drive/Obsidian/stackmemory/raw/` + `Current Date` + `-note.md` |
| 14 | +3. **Trigger options**: |
| 15 | + - Add to Home Screen |
| 16 | + - "Hey Siri, add to wiki" |
| 17 | + - Add to Share Sheet (for sharing text/URLs from any app) |
| 18 | + |
| 19 | +### What happens: |
| 20 | +- File lands in `raw/` directory |
| 21 | +- Obsidian vault adapter's `startWatching()` detects new .md file |
| 22 | +- `wiki-update.js` hook compiles it on next Claude Code session stop |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Shortcut B: "Wiki Now" (instant — ingests immediately) |
| 27 | + |
| 28 | +### Setup in Shortcuts app: |
| 29 | + |
| 30 | +1. **Name**: "Wiki Now" |
| 31 | +2. **Actions**: |
| 32 | + - `Ask for Input` → Type: Text, Prompt: "What to remember?" |
| 33 | + - `Text` → Combine: `---\ntitle: "` + Input + `"\ncreated: ` + Current Date (ISO) + `\ntags: [quick-capture]\n---\n\n` + Input |
| 34 | + - `Save File` → Save to `/tmp/wiki-quick-note.md` |
| 35 | + - `Run Shell Script`: |
| 36 | + ```bash |
| 37 | + /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/@stackmemoryai/stackmemory/dist/src/cli/index.js wiki ingest /tmp/wiki-quick-note.md --wiki-dir ~/Dev/stackmemory-vault/stackmemory/wiki |
| 38 | + ``` |
| 39 | +3. **Trigger options**: |
| 40 | + - Same as above + Automation triggers (time of day, location, etc.) |
| 41 | + |
| 42 | +### What happens: |
| 43 | +- CLI runs immediately, creates wiki article |
| 44 | +- Available in Obsidian instantly |
| 45 | +- No need to wait for next session |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +## Shortcut C: "Wiki URL" (for sharing links) |
| 50 | + |
| 51 | +### Setup: |
| 52 | +1. **Name**: "Wiki URL" |
| 53 | +2. **Input**: Accepts URLs from Share Sheet |
| 54 | +3. **Actions**: |
| 55 | + - `Run Shell Script`: |
| 56 | + ```bash |
| 57 | + /opt/homebrew/bin/node /opt/homebrew/lib/node_modules/@stackmemoryai/stackmemory/dist/src/cli/index.js wiki ingest "$1" -n 5 --wiki-dir ~/Dev/stackmemory-vault/stackmemory/wiki |
| 58 | + ``` |
| 59 | + |
| 60 | +### What happens: |
| 61 | +- Share any URL from Safari/Chrome → "Wiki URL" |
| 62 | +- Crawls page + up to 5 linked pages |
| 63 | +- Creates wiki articles immediately |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## iMessage Integration |
| 68 | + |
| 69 | +Send a text to yourself → Shortcut Automation picks it up: |
| 70 | + |
| 71 | +1. Open Shortcuts → Automations → New Automation |
| 72 | +2. **When**: Message received containing "#wiki" |
| 73 | +3. **Action**: Extract text after "#wiki", run Shortcut B with that text |
| 74 | +4. **Turn off "Ask Before Running"** |
| 75 | + |
| 76 | +Now: text yourself `#wiki Saw Dr. Smith, blood pressure normal, next visit June` → wiki article created. |
| 77 | + |
| 78 | +--- |
| 79 | + |
| 80 | +## Paths (adjust for your setup) |
| 81 | + |
| 82 | +``` |
| 83 | +Obsidian vault raw/: ~/Dev/stackmemory-vault/stackmemory/raw/ |
| 84 | +Wiki dir: ~/Dev/stackmemory-vault/stackmemory/wiki/ |
| 85 | +CLI binary: /opt/homebrew/lib/node_modules/@stackmemoryai/stackmemory/dist/src/cli/index.js |
| 86 | +Node: /opt/homebrew/bin/node |
| 87 | +``` |
0 commit comments