| name | obsidian-cli |
| description | Interact with Obsidian vaults using the Obsidian CLI to search, read, write, and organize notes. Use this skill when you need to perform programmatic operations on any Obsidian vault, such as searching for context, managing notes, or updating metadata via the CLI.
|
Obsidian CLI
This skill provides instructions for using the Obsidian CLI to interact with Obsidian vaults. The CLI requires the Obsidian app to be running.
Important: obsidian in PATH typically launches the GUI app. Use the CLI binary directly:
obsidian-cli
If the path is not found (e.g., after a NixOS rebuild), you can find the current path with:
readlink -f ~/.nix-profile/bin/obsidian | xargs dirname | xargs -I{} ls {}/obsidian-cli
If Obsidian is not running, the CLI will print an error — you may need to launch the app first.
Commands Reference
Search & Read
obsidian-cli vault=<vault-name> search query="query text"
obsidian-cli vault=<vault-name> search:context query="query text" format=json
obsidian-cli vault=<vault-name> read file=<filename>
obsidian-cli vault=<vault-name> read path="Folder/File.md"
obsidian-cli vault=<vault-name> property:read name=<property-name> file=<filename>
obsidian-cli vault=<vault-name> tags counts format=json
obsidian-cli vault=<vault-name> backlinks file=<filename> format=json
Create & Write
obsidian-cli vault=<vault-name> create path="Folder/File.md" content="Content here..."
obsidian-cli vault=<vault-name> append file=<filename> content="\nNew content"
obsidian-cli vault=<vault-name> prepend file=<filename> content="Prepended content"
obsidian-cli vault=<vault-name> property:set name=<property-name> value="value" file=<filename>
Tasks
obsidian-cli vault=<vault-name> tasks file=<filename> todo
obsidian-cli vault=<vault-name> task file=<filename> line=<line-number> done
Other Useful Commands
obsidian-cli vault=<vault-name> files folder="Folder/Subfolder"
obsidian-cli vault=<vault-name> outline file=<filename> format=json
obsidian-cli vault=<vault-name> unresolved
Tips
- Use
format=json when piping output to other commands or when you need structured data.
- The
file= parameter resolves like wikilinks — you can reference a note without the path or extension.
- When creating a note, use
path= to ensure it is placed in the correct directory.
- Link notes with wikilinks (
[[Note Name]]) to create connections that can be discovered via backlinks.