| name | cli |
| description | Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes. |
Obsidian CLI
Use the obsidian CLI to interact with a running Obsidian instance. Requires Obsidian to be open.
REQUIRES: Obsidian 1.12+ with CLI enabled: Settings → General → Command line interface.
Syntax
Parameters take a value with =. Quote values with spaces:
obsidian create name="My Note" content="Hello world"
Flags are boolean switches with no value:
obsidian create name="My Note" silent overwrite
For multiline content use \n for newline and \t for tab.
File Targeting
Many commands accept file or path to target a file. Without either, the active file is used.
file=<name> — resolves like a wikilink (name only, no path or extension needed)
path=<path> — exact path from vault root, e.g. folder/note.md
Vault Targeting
Commands target the most recently focused vault by default. Use vault=<name> as the first parameter to target a specific vault:
obsidian vault="My Vault" search query="test"
Command Reference
File Operations
obsidian files folder=<path> ext=md
obsidian files folder=base/categories ext=md
obsidian folders folder=<path>
obsidian read file="My Note"
obsidian read path="folder/note.md"
obsidian create name="New Note" content="# Hello" template="Template" silent
obsidian append path="folder/note.md" content="New line"
obsidian prepend file="My Note" content="New line"
obsidian move path="old/note.md" to="new/folder"
obsidian rename file="My Note" name="New Name"
obsidian delete path="folder/note.md"
obsidian delete path="folder/note.md" permanent
Search
obsidian search query="search term" limit=10
obsidian search query="text" path=base/notes limit=10
obsidian search:context query="text" path=base/notes
obsidian search query="#task/inbox" path=periodic/daily
Properties (Frontmatter)
obsidian properties path=folder/note.md
obsidian property:read name="status" file="My Note"
obsidian property:set name="status" value="🟦" file="My Note"
obsidian property:set name="updated" value="2026-02-28" type=date file="My Note"
obsidian property:set name="tags" value="note/basic/primary" type=list file="My Note"
obsidian property:remove name="draft" file="My Note"
Tags
obsidian tags
obsidian tags sort=count counts
obsidian tags file="My Note"
obsidian tag name="category/pkm" verbose
Tasks
obsidian tasks todo format=json
obsidian tasks done format=json
obsidian task ref="path/to/note.md:42" toggle
obsidian search:context query="task-todo:#task/inbox" path=periodic/daily
obsidian search:context query="task-done:#task/inbox" path=periodic/daily
obsidian search query="- [ ]" path=periodic/daily
Links & Graph
obsidian backlinks file="My Note"
obsidian links file="My Note"
obsidian unresolved
obsidian orphans
obsidian deadends
obsidian outline file="My Note" format=md
Recently Modified Files
obsidian recents
DO NOT use base:query or other base:* commands — they require Obsidian UI rendering and return [] from CLI. Use obsidian search with [property: value] syntax instead.
Cross-Platform Date Calculations (replaces bash date / python3)
Use obsidian eval with JavaScript instead of OS-specific commands:
obsidian eval code="new Date().toISOString().slice(0,10)"
obsidian eval code="(function(){const d=new Date();const dt=new Date(Date.UTC(d.getFullYear(),d.getMonth(),d.getDate()));const day=dt.getUTCDay()||7;dt.setUTCDate(dt.getUTCDate()+4-day);const y=dt.getUTCFullYear();const ys=new Date(Date.UTC(y,0,1));const w=Math.ceil(((dt-ys)/86400000+1)/7);return y+'-W'+String(w).padStart(2,'0')})()"
obsidian eval code="const d=new Date();d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0')"
obsidian eval code="const d=new Date();const q=Math.ceil((d.getMonth()+1)/3);const m1=(q-1)*3+1;const months=[0,1,2].map(i=>d.getFullYear()+'-'+String(m1+i).padStart(2,'0'));d.getFullYear()+'-Q'+q+' '+months.join(' ')"
obsidian eval code="Math.floor((Date.now()-new Date('2026-01-01'))/86400000)"
Note: eval uses JavaScript without return keyword — the last expression is the result.
Daily Notes
obsidian daily:path
obsidian daily:read
obsidian daily:append content="- [ ] New task"
obsidian daily:prepend content="New content"
Vault Info
obsidian vault
obsidian vaults
obsidian version
Common Patterns for Skills
Listing available categories (replaces: Glob base/categories/*.md)
obsidian files folder=base/categories ext=md
obsidian files folder=base/_meta-notes ext=md
obsidian files folder=base/_problems ext=md
Finding active projects (replaces: Grep "status: 🟦" in projects/)
obsidian search query="tag:#project [status: 🟦]"
obsidian search query="tag:#project [status: 🟥]"
obsidian search query="[status: 🟦]" path=projects
obsidian search query="[status: 🟩]" path=projects
Finding inbox tasks across daily notes (replaces: Grep #task/inbox)
obsidian search:context query="task-todo:#task/inbox" path=periodic/daily
obsidian search:context query="task-done:#task/inbox" path=periodic/daily
obsidian search:context query="#task/inbox" path=periodic/daily
Reading recently modified notes (replaces: Glob sorted by mtime)
obsidian recents
Updating a property after creating a note (replaces: Edit YAML manually)
obsidian property:set name="addition" value="[[My Addition|➕]]" type=list file="Parent Note"
Counting notes/tasks/sources by date (replaces: Grep "YYYY-MM-" in frontmatter)
obsidian search query="[created: 2026-02]" path=base/notes total
obsidian search query="[created: 2026-02]" path=base/additions total
obsidian search query="[status: 🟩] [end: 2026-02]" path=sources total
obsidian search query="✅ 2026-02" total
obsidian search query="tag:#project [status: 🟦]"
obsidian search query="tag:#project [status: 🟥]"
obsidian search query="tag:#project [status: 🟩]"
IMPORTANT: [property: value] syntax supports partial matching:
[created: 2026-02] — finds all files with created: starting with 2026-02
[status: 🟩] [end: 2026] — two property conditions combined (space = AND)
property: value (without brackets) → error "Operator not recognized"
#tag [property: value] combined → returns 0 (not supported)
Getting files by tag (replaces: Grep "#source/book" in sources/)
obsidian tag name="source/book" verbose
obsidian tag name="source/article/paper" verbose
obsidian tags sort=count counts
Plugin Development
After making code changes to a plugin or theme, follow this workflow:
- Reload the plugin to pick up changes:
obsidian plugin:reload id=my-plugin
- Check for errors — if errors appear, fix and repeat from step 1:
obsidian dev:errors
- Verify visually with a screenshot or DOM inspection:
obsidian dev:screenshot path=screenshot.png
obsidian dev:dom selector=".workspace-leaf" text
- Check console output for warnings or unexpected logs:
obsidian dev:console level=error
Additional developer commands
Run JavaScript in the app context:
obsidian eval code="app.vault.getFiles().length"
Inspect CSS values:
obsidian dev:css selector=".workspace-leaf" prop=background-color
Toggle mobile emulation:
obsidian dev:mobile on