$npx -y skills add SafeAI-Lab-X/ClawKeeper --skill obsidianWork with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli.
| 1 | # Obsidian |
| 2 | |
| 3 | Obsidian vault = a normal folder on disk. |
| 4 | |
| 5 | Vault structure (typical) |
| 6 | |
| 7 | - Notes: `*.md` (plain text Markdown; edit with any editor) |
| 8 | - Config: `.obsidian/` (workspace + plugin settings; usually don’t touch from scripts) |
| 9 | - Canvases: `*.canvas` (JSON) |
| 10 | - Attachments: whatever folder you chose in Obsidian settings (images/PDFs/etc.) |
| 11 | |
| 12 | ## Find the active vault(s) |
| 13 | |
| 14 | Obsidian desktop tracks vaults here (source of truth): |
| 15 | |
| 16 | - `~/Library/Application Support/obsidian/obsidian.json` |
| 17 | |
| 18 | `obsidian-cli` resolves vaults from that file; vault name is typically the **folder name** (path suffix). |
| 19 | |
| 20 | Fast “what vault is active / where are the notes?” |
| 21 | |
| 22 | - If you’ve already set a default: `obsidian-cli print-default --path-only` |
| 23 | - Otherwise, read `~/Library/Application Support/obsidian/obsidian.json` and use the vault entry with `"open": true`. |
| 24 | |
| 25 | Notes |
| 26 | |
| 27 | - Multiple vaults common (iCloud vs `~/Documents`, work/personal, etc.). Don’t guess; read config. |
| 28 | - Avoid writing hardcoded vault paths into scripts; prefer reading the config or using `print-default`. |
| 29 | |
| 30 | ## obsidian-cli quick start |
| 31 | |
| 32 | Pick a default vault (once): |
| 33 | |
| 34 | - `obsidian-cli set-default "<vault-folder-name>"` |
| 35 | - `obsidian-cli print-default` / `obsidian-cli print-default --path-only` |
| 36 | |
| 37 | Search |
| 38 | |
| 39 | - `obsidian-cli search "query"` (note names) |
| 40 | - `obsidian-cli search-content "query"` (inside notes; shows snippets + lines) |
| 41 | |
| 42 | Create |
| 43 | |
| 44 | - `obsidian-cli create "Folder/New note" --content "..." --open` |
| 45 | - Requires Obsidian URI handler (`obsidian://…`) working (Obsidian installed). |
| 46 | - Avoid creating notes under “hidden” dot-folders (e.g. `.something/...`) via URI; Obsidian may refuse. |
| 47 | |
| 48 | Move/rename (safe refactor) |
| 49 | |
| 50 | - `obsidian-cli move "old/path/note" "new/path/note"` |
| 51 | - Updates `[[wikilinks]]` and common Markdown links across the vault (this is the main win vs `mv`). |
| 52 | |
| 53 | Delete |
| 54 | |
| 55 | - `obsidian-cli delete "path/note"` |
| 56 | |
| 57 | Prefer direct edits when appropriate: open the `.md` file and change it; Obsidian will pick it up. |