| name | obsidian-desktop-cli |
| description | Search, read, create, and manage notes, tasks, and properties in an Obsidian vault using the Obsidian Desktop CLI |
| user-invocable | false |
| disable-model-invocation | false |
| metadata | {"version":"0.1.0","author":"Guy Royse <guy@guy.dev> (https://guy.dev)"} |
Obsidian Desktop CLI
Interact with an Obsidian vault through the obsidian command line interface. The CLI communicates with the running Obsidian Desktop app via IPC.
Targeting a Vault
On first use, check which vaults are available:
obsidian vaults verbose
If there is only one vault, that's the default. If there are multiple, ask the user which one they'd like to work with by default. Remember their choice for future conversations. If they want to change the default vault later, remember that choice as well.
Most commands operate on the currently open vault. To target a specific vault by name, add vault=<name> to any command.
Vault README
Before working in a vault, read the README file in the vault root. It describes the vault's structure, folder conventions, templates, frontmatter patterns, and any rules for how you should interact with it.
obsidian read file="README"
If no README exists, offer to create one with the user. Ask them about their vault's structure, conventions, and how they'd like you to work with it.
Guardrails
- Appending content to files is fine without asking, but tell the user what you're adding and where.
- Creating new files is fine without asking.
- Modifying existing text in a file requires user approval first.
- Moving or renaming files requires user approval first.
- Removing or changing properties requires user approval first.
- Deleting files always requires explicit user confirmation. Never delete without asking.
Error Handling
If a CLI command fails, notify the user of the error. Do not retry automatically. Ask the user if they would like to retry.
However, if a command fails with a sandbox-related error, retry it with --no-sandbox as the first argument. For example: obsidian --no-sandbox read file="Note Name". If that works, use --no-sandbox for all subsequent commands.
Common Commands
Reading and Searching
obsidian read file="Note Name"
obsidian read path="folder/note.md"
obsidian search query="search text"
obsidian search:context query="search text"
obsidian file file="Note Name"
obsidian files
obsidian files folder="Projects"
obsidian folders
obsidian outline file="Note Name"
obsidian backlinks file="Note Name"
obsidian links file="Note Name"
obsidian tags
obsidian tags file="Note Name"
Creating and Writing
obsidian create name="Note Name" content="Content here"
obsidian create name="Note Name" template="Template Name"
obsidian append file="Note Name" content="New content"
obsidian prepend file="Note Name" content="New content"
Organizing
obsidian move file="Note Name" to="folder/path"
obsidian move file="Note Name" to="folder/new.md"
obsidian rename file="Note Name" name="New Name"
obsidian delete file="Note Name"
Properties (Frontmatter)
obsidian properties file="Note Name"
obsidian property:read file="Note Name" name="status"
obsidian property:set file="Note Name" name="status" value="done"
obsidian property:set file="Note Name" name="tags" value="tag1,tag2" type=list
obsidian property:remove file="Note Name" name="old-prop"
Tasks
obsidian tasks
obsidian tasks done
obsidian tasks file="Note Name"
obsidian tasks verbose
obsidian task file="Note Name" line=12 done
obsidian task file="Note Name" line=12 todo
Daily Notes
obsidian daily:read
obsidian daily:path
obsidian daily:append content="New entry"
obsidian daily:prepend content="New entry"
Bases
obsidian bases
obsidian base:views
obsidian base:query file="My Base" format=json
obsidian base:query file="My Base" view="View Name"
obsidian base:create file="My Base" name="Item Name"
obsidian base:create file="My Base" name="Item" content="Details"
Sync
obsidian sync:status
obsidian sync on
obsidian sync off
Notes
file resolves by name like wikilinks. path is an exact file path.
- Quote values with spaces:
name="My Note".
- Use
\n for newline, \t for tab in content values.
- Most commands default to the active file when
file or path is omitted.
- For detailed help on any command, run
obsidian help <command>.
- There are many more commands available. Run
obsidian help for the full list.