obsidian-cli
Use this skill whenever the user wants Claude to directly interact with their Obsidian vault — reading a note or daily note, writing or appending content, searching vault contents, counting or listing notes, managing tasks, moving or renaming files, finding orphaned notes or broken links. Without this skill, Claude has no way to access vault data or execute vault operations. Treat any request that implies "go into my vault and do X" as a trigger — the user is asking Claude to act, not to explain. Also trigger for vault automation, CLI scripting, or cron-based workflows involving Obsidian, managing sync history, querying Bases, restoring file versions via history, managing bookmarks, or running JavaScript against the Obsidian API. Skip for pure conceptual questions: how Obsidian's GUI works, navigating settings menus, theme or plugin installation via the UI, iCloud/third-party sync conflicts, general Dataview query syntax, keyboard shortcuts, or parsing vault files with external scripts — anything where the user needs an explanation rather than Claude performing a vault operation.
NPX Install
npx skill4agent add pablo-mano/obsidian-cli-skill obsidian-cliTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Obsidian CLI
Readwhen you need specific flags, output formats, or subcommands for any command group. It covers all 130+ commands with full parameter tables and has a table of contents at the top.references/command-reference.md
Prerequisites
| Requirement | Details |
|---|---|
| Obsidian Desktop | v1.12.0+ |
| CLI enabled | Settings → Command line interface → Toggle ON |
| Obsidian running | The desktop app must be running for CLI to work (IPC) |
Platform Notes
- macOS / Linux: The binary is registered in PATH automatically when you enable CLI in settings.
obsidian - Windows: Requires an redirector file placed alongside
Obsidian.com. Must run with normal user privileges — admin terminals produce silent failures.Obsidian.exe- If colon subcommands (,
property:set, etc.) with parameters return exit 127, check thatdaily:appendexists alongsideObsidian.com. If missing, you have an outdated installer — download the latest from obsidian.md/download and reinstall.Obsidian.exe - Git Bash / MSYS2 users: Bash resolves to
obsidian(GUI) instead ofObsidian.exe(CLI), causing colon+params to fail with exit 127 even whenObsidian.comis present. Create a wrapper script — see Troubleshooting.Obsidian.com
- If colon subcommands (
- Headless Linux: Use the package (not snap). Run under
.deb. Prefix commands withxvfb(or your xvfb display number). EnsureDISPLAY=:5if running as a service.PrivateTmp=false
Syntax
key=valueobsidian <command> [subcommand] [key=value ...] [flags]Multi-Vault
obsidian "My Vault" daily:read
obsidian "Work Notes" search query="meeting"Command Overview
| Group | Key Commands | Purpose |
|---|---|---|
| files | | Note CRUD and file discovery |
| daily | | Daily note operations |
| search | | Full-text search; |
| properties | | Frontmatter/metadata management |
| tags | | Tag listing, counts, and filtering |
| tasks | | Task querying, filtering, and toggling |
| links | | Graph and link analysis |
| bookmarks | | List and add bookmarks |
| templates | | Template listing, rendering, insertion |
| plugins | | Plugin management |
| sync | | Obsidian Sync operations |
| themes | | Theme management |
| snippets | | CSS snippet management |
| commands | | Execute Obsidian commands by ID; inspect hotkeys |
| bases | | Obsidian Bases (v1.12+ database feature) |
| history | | File version recovery (File Recovery plugin) |
| workspace | | Workspace layout and tab management |
| diff | | Compare local vs sync file versions |
| dev | | Developer/debugging tools |
| vault | | Vault info and app control |
| other | | Utility commands |
Quick Reference — Most Common Commands
Reading & Writing Notes
obsidian read path="folder/note.md"
obsidian create path="folder/note" content="# New Note"
obsidian create path="folder/note" template="meeting-notes"
obsidian append path="folder/note.md" content="New paragraph"
obsidian prepend path="folder/note.md" content="Top content"
obsidian move path="old/note.md" to="new/note.md"
obsidian delete path="folder/note.md"
obsidian delete path="folder/note.md" permanentDaily Notes
obsidian daily # Open today's daily note
obsidian daily:read # Print content of today's note
obsidian daily:append content="- [ ] New task"
obsidian daily:prepend content="## Morning Notes"Search
obsidian search query="project alpha"
obsidian search query="TODO" path="projects" limit=10
obsidian search query="meeting" format=json # Returns JSON array of file paths
obsidian search query="urgent" caseProperties & Tags
obsidian properties path="note.md"
obsidian property:set path="note.md" name="status" value="active"
obsidian property:read path="note.md" name="status"
obsidian property:remove path="note.md" name="draft"
obsidian tags counts sort=count
obsidian tag name="project/alpha"Tasks
obsidian tasks # All tasks (done + todo) — same as tasks all in v1.12
obsidian tasks all # All tasks (done + todo)
obsidian tasks done # Completed only
obsidian tasks daily # Tasks in today's daily note
obsidian task path="note.md" line=12 toggle
obsidian tasks | grep "\[ \]" # Workaround: filter to incomplete onlyDeveloper & Automation
obsidian eval code="app.vault.getFiles().length"
obsidian dev:screenshot path="folder/screenshot.png" # Path must be vault-relative
obsidian dev:debug on # Required before dev:console
obsidian dev:console limit=20
obsidian dev:errorsTUI Mode
obsidian| Key | Action |
|---|---|
| Navigate files |
| Open file |
| Search |
| Create new file |
| Delete file |
| Rename file |
| Quit |
Common Agent Patterns
Daily Journal Automation
# Append a timestamped entry
obsidian daily:append content="## $(date '+%H:%M') — Status Update
- Completed: feature branch merge
- Next: code review for PR #42
- Blocked: waiting on API credentials"Create Note from Template with Metadata
obsidian create path="projects/new-feature" template="project-template"
obsidian property:set path="projects/new-feature.md" name="status" value="planning"
obsidian property:set path="projects/new-feature.md" name="created" value="$(date -I)"
obsidian daily:append content="- Started [[projects/new-feature|New Feature]]"Vault Analytics Script
obsidian files total # Total file count
obsidian tags counts sort=count # Most used tags
obsidian tasks | grep "\[ \]" # Incomplete tasks across vault
obsidian orphans # Notes needing integration
obsidian unresolved # Broken links to fixSearch and Extract for AI Processing
obsidian search query="meeting notes" format=json | jq '.[]'
obsidian read path="meetings/standup.md" | grep "Action item"Sync Management
obsidian sync:status # Check sync health
obsidian sync:history path="important.md" # Version history
obsidian sync:restore path="important.md" version=3 # RollbackExecute Obsidian Commands
# Find a command ID, then execute it
obsidian commands | grep "graph"
obsidian command id="graph:open"
# Open settings, trigger a plugin action
obsidian command id="app:open-settings"
obsidian command id="dataview:dataview-force-refresh-views"Tips
- Paths are vault-relative — use , not absolute filesystem paths.
folder/note.md - paths omit
create— the extension is added automatically..md - requires full target path including
moveextension..md - Pipe-friendly — plain text output works with ,
grep,awk,sed.jq - JSON output — use on
format=jsonfor a JSON array of file paths. Thesearchcommand does not support JSON output.files - Stderr noise — GPU/Electron warnings on headless are harmless; filter with .
2>/dev/null - inserts content after frontmatter, not at byte 0.
daily:prepend - Use to run arbitrary JavaScript against the Obsidian API (
eval).app.* - inserts into the currently active file in the Obsidian UI — it does not accept a
template:insertparameter. If no file is open, it returnspath=To create a file from a template via CLI, useError: No active editor. Open a file first.instead.obsidian create path="..." template="..." - stores list values as strings —
property:setwrites a literal comma-separated string, not a YAML array. For proper array fields, edit the note's frontmatter directly (e.g. viavalue="tag1, tag2"→ modify →read) or usecreate --forceto call the Obsidian API.eval - requires single-line JavaScript — multiline JS passed inline fails with a token error. Write the script to a temp file instead:
evalbashcat > /tmp/obs.js << 'JS' var files = app.vault.getMarkdownFiles(); files.length; JS obsidian eval code="$(cat /tmp/obs.js)" - Multi-vault targeting may not work in all environments — can return
obsidian "My Vault" commandon some setups. If this happens, omit the vault name (CLI targets the most recently active vault) and switch vaults manually in the Obsidian UI.Error: Command "My Vault" not found - When colon subcommands are unavailable (e.g. Windows Git Bash without wrapper), prefer non-colon alternatives: use instead of
properties, andproperty:read+obsidian daily:pathinstead ofappend.daily:append
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Empty output / hangs | Obsidian not running, or admin terminal (Windows) | Start Obsidian; use normal-privilege terminal |
| Command not found | CLI not registered in PATH | Re-enable CLI in Settings; restart terminal |
| Unicode errors | Fixed in v1.12.2+ | Update Obsidian |
| Wrong vault targeted | Multi-vault ambiguity | Pass vault name as first arg |
| IPC socket not found (Linux) | | Set |
| Snap confinement issues | Snap restricts IPC | Use |
Multi-vault | Vault name matching issue | Omit vault name; target most recent vault |
| CLI stores value as-is | Edit frontmatter directly or use |
Colon+params exit 127 (missing | Outdated installer — | Reinstall from obsidian.md/download |
| Colon+params exit 127 (Git Bash / MSYS2) | Bash resolves | Create |