| name | obsidian |
| description | Use the official Obsidian CLI (v1.12+) to manage vaults, notes, daily notes, search, tasks, tags, properties, links, templates, sync, publish, and workspaces. Use when the user mentions Obsidian, vaults, notes, or wants to automate note-taking and knowledge base workflows. |
Obsidian CLI
Use the official Obsidian CLI (help.obsidian.md/cli) to control Obsidian from the terminal. The CLI connects to a running Obsidian instance via IPC.
When to Use
- User asks about Obsidian or vaults.
- User wants to manage notes (open, create, read, append, move, delete).
- User wants daily notes, search, tasks, tags, or properties.
- User wants to automate templates, sync, publish, or workspaces.
- User asks for rich documentation with LaTeX, callouts, or diagrams (create content with Obsidian-flavored markdown).
Prerequisites
- Obsidian 1.12+ installed and running
- CLI enabled: Settings → General → Command line interface
- The
obsidian binary in your PATH
Important: The CLI talks to the running app via IPC. Obsidian must be open for commands to work.
Platform Notes
- macOS/Windows: Installer usually adds the CLI to PATH.
- Linux: You may need a wrapper so Electron flags don’t break CLI args; ensure IPC socket is available (e.g.
PrivateTmp=false for systemd).
Command Overview (from official docs)
Syntax: obsidian [vault=Name] <command> [params]. Use param=value; quote values with spaces. Use vault= as the first parameter to target a vault.
General
obsidian help
obsidian version
obsidian reload
obsidian restart
Vault
obsidian vault
obsidian vault info=name
obsidian vault info=path
obsidian vaults
obsidian vault=MyVault <cmd>
Files and Folders
obsidian read file=Recipe
obsidian read path="Work/notes.md"
obsidian file file=Recipe
obsidian create name=Note
obsidian create name=Note template=Travel
obsidian create path="Work/note.md"
obsidian create name=Note overwrite
obsidian open file=Recipe
obsidian open file=Recipe newtab
obsidian append file=Log content="Line"
obsidian prepend file=Log content="# H"
obsidian move file=Old to="Archive/Old.md"
obsidian delete file=Old
obsidian delete file=Old permanent
obsidian files total
obsidian files folder="Work" ext=md
obsidian folders
obsidian folder path="Work" info=size
Daily Notes
obsidian daily
obsidian daily silent
obsidian daily:read
obsidian daily:path
obsidian daily:append content="- [ ] Task"
obsidian daily:prepend content="# Header"
Search
obsidian search query="meeting notes"
obsidian search query="TODO" matches
obsidian search query="x" path="Work" limit=10
obsidian search:open query="TODO"
Tasks
obsidian tasks daily
obsidian tasks daily todo
obsidian tasks all todo
obsidian task daily line=3 toggle
obsidian task daily line=3 done
obsidian task ref="path/to.md:5" toggle
Tags and Properties
obsidian tags all counts
obsidian tags file=Note
obsidian tag name=project total
obsidian properties file=Note
obsidian property:read name=status file=Note
obsidian property:set name=status value=done file=Note
obsidian property:remove name=status file=Note
obsidian aliases
Links and Outline
obsidian backlinks file=Note
obsidian links file=Note
obsidian unresolved
obsidian orphans
obsidian deadends
obsidian outline file=Note
Templates
obsidian templates
obsidian template:read name=Daily
obsidian template:read name=Daily resolve title="My Note"
obsidian template:insert name=Daily
History and Sync
obsidian history file=Note
obsidian history:list
obsidian history:read file=Note version=3
obsidian history:restore file=Note version=3
obsidian diff file=Note from=1 to=3
obsidian sync:status
obsidian sync:history file=Note
obsidian sync:restore file=Note version=2
Other
obsidian random
obsidian random:read
obsidian wordcount file=Note
obsidian bookmarks
obsidian bookmark file="note.md" title="My Note"
obsidian bases
obsidian base:query file=MyBase format=json
obsidian workspace:save name="coding"
obsidian workspace:load name="coding"
obsidian plugins
obsidian plugin:enable id=dataview
obsidian theme:set name="Minimal"
obsidian publish:add file=Note
obsidian web url="https://example.com"
Best Practices
- Vault: Always specify
vault=Name. If CWD is inside a vault, that vault is used; otherwise confirm vault to use.
- Ask first: For big or structured notes, confirm depth, visuals (images, LaTeX, Mermaid), and organization (single note, folder, canvas).
- File vs path:
file= uses wikilink-style resolution (name only). Use path= for an exact path from vault root.
- Quoting: Use quotes for values with spaces:
content="Hello world".
- Rich content: Use Obsidian Advanced Syntax and Obsidian Flavored Markdown for callouts, LaTeX, Mermaid. Add YAML frontmatter (tags, status, dates) for discoverability.
- Canvas: For
.canvas files, use colors "1"–"6" as strings; text nodes support full markdown. See references/canvas-format.md for structure.
Writing note content: use path + write_file
The CLI can create empty notes or notes with very small content via create, but for any real note content always use the CLI only to get the path, then write with write_file:
- Get the full path with the Obsidian CLI:
- Vault root:
obsidian vault info=path (then join with your relative path, e.g. Research/MyNote.md).
- Daily note:
obsidian daily:path.
- Existing note path:
obsidian file file=NoteName (or build path from vault root).
- New note:
obsidian vault info=path then path_from_vault_root/NoteName.md.
- Write the content using the write_file skill (or your environment’s file write tool) to that absolute path.
Use obsidian create name=Note (no content) only when you need an empty file; for any content, get the path and use write_file. This avoids quoting/escaping, length limits, and fragile CLI argument handling.
Troubleshooting
- "Cannot connect": Obsidian must be running and CLI enabled in Settings → General.
- "Command not found": Ensure
obsidian is in PATH.
- Linux: Use a wrapper that doesn’t inject Electron flags; for systemd, set
PrivateTmp=false so IPC works.
References