--- name: obsidian-vault description: Reads, searches, and edits an Obsidian vault through the obsidian command line interface - notes, daily notes, frontmatter properties, tags, backlinks, and templates. Use this skill when the user wants to find something in their notes, read or summarize a note, capture a thought into today's daily note, create or append to a note, retag or move files, or trace what links to what. Also use it when the user mentions Obsidian, their vault, a daily note, a wikilink, or the obsidian CLI - and when they say things like "add this to my notes", "what did I write about X", or "put that in today's note" without naming the tool. Do not use it for Markdown files outside a vault, or to edit this repository's own docs - the ordinary file tools are better for those. For a vault where each task is its own note with a done checkbox, due, priority, and frequency frontmatter, use obsidian-tasks instead. compatibility: Requires the obsidian CLI - Obsidian desktop 1.12.7+ with Settings - General - Command line interface enabled, and the app running --- # Obsidian Vault Work inside an Obsidian vault through the `obsidian` CLI - find notes, read them, capture into the daily note, edit files, and update tasks, tags, and frontmatter properties. The job is not done when a command returns. **This CLI exits 0 on failure**, so nothing is confirmed until the read-back in Step 6. ## Before you start Check the CLI exists before planning anything around it. Use `command -v`, not a real command - it costs nothing and, unlike every other command here, it will not launch the app as a side effect: ```bash command -v obsidian ``` | Result | Meaning | What to do | |---|---|---| | A path, exit 0 | Installed and registered | Continue to `obsidian vaults verbose` | | Nothing, exit 1 | Not installed, or the CLI was never enabled | Stop and tell the user | Those two failures are indistinguishable from the shell and neither is fixable from it. The `obsidian` command is a root-owned symlink into the app bundle, created by a prompt the user answers under Settings - General - Command line interface on installer 1.12.7 or later - GUI steps needing their admin password. **Say what is missing and stop.** Do not install anything, do not write to the vault directory as a workaround, and do not fall back to editing the Markdown by hand unless the user asks for that after being told. With the CLI present, `obsidian vaults verbose` confirms it can reach the app. A table of vault names and paths means everything works; a pause means Obsidian was closed and this command is launching it - wait, then rerun. Then ask only what the vault cannot answer: 1. **Which vault**, when `obsidian vaults` lists more than one and the request does not single one out. 2. **Which folder a new note goes in**, when creating one and nothing in the request or the vault's existing layout implies a home. Skip both when the request already answers them. "Add a line to my daily note" needs no questions at all. ## Step 1 - Target the right vault The default target is the vault matching the shell's working directory, and the active vault otherwise. Agent commands almost never run from inside a vault, so the default is whichever vault the user last had focused - which is not a fact worth betting a write on. | Situation | What to run | |---|---| | One vault exists | Nothing; the default is correct | | A specific vault, by name | `obsidian vault= ...` | | Confirm what is being targeted | `obsidian vault info=name` | `vault=` **must come before the command.** Placed after it, it is parsed as an argument to that command, ignored, and the command runs against the wrong vault without any warning. See Gotchas. ## Step 2 - Locate the note Names resolve two ways, and picking the wrong one is the most common failed command. `file=` resolves by name the way a wikilink does - convenient, but it silently picks one match when several notes share a name. `path=` is exact, including the extension; use it for anything that writes. | Goal | Command | |---|---| | Full-text search, paths only | `obsidian search query="" format=json` | | Search with the matching lines | `obsidian search:context query=""` | | Narrow a search to a folder | add `path=""` | | List a folder's notes | `obsidian files folder=""` | | Notes carrying a tag | `obsidian tag name= verbose` | | Today's daily note path | `obsidian daily:path` | | What links to a note | `obsidian backlinks file=""` | | Confirm a note exists | `obsidian file path=""` | `search` returns files; `search:context` returns `path:line: text` and is what to reach for when the answer is a passage rather than a note. ## Step 3 - Read what is there | Goal | Command | |---|---| | Note contents | `obsidian read path=""` | | Headings only | `obsidian outline path=""` | | Today's note | `obsidian daily:read` | | Frontmatter | `obsidian properties path=""` | | One property value | `obsidian property:read name= path=""` | The vault is ordinary Markdown on disk, so Read and Grep work on it directly and are faster for bulk scanning - use them for that. Use the CLI whenever the answer depends on Obsidian's index rather than on file text - backlinks, orphans, tag counts, wikilink resolution, templates, or the daily note's configured folder and date format. **Route every write through the CLI**, so a note the user has open cannot clobber the change with an unsaved buffer. ## Step 4 - Write | Goal | Command | |---|---| | New note | `obsidian create name="" path="" content=""` | | New note from a template | add `template="