| name | obsidian-cli |
| description | This skill should be used when the user asks to "read an Obsidian note", "search my vault", "create a note in Obsidian", "append to my daily note", "list tags in Obsidian", "check my tasks", "open a file in Obsidian", "manage Obsidian plugins", "query a base", or any interaction with an Obsidian vault via the command line. Also triggered when the user mentions "obsidian", "vault", "daily note", or "Obsidian CLI".
|
| metadata | {"author":"Georges Martin <jrjsmrtn@gmail.com>","version":"0.1.5"} |
| license | MIT |
Obsidian CLI
Obsidian CLI (obsidian) is a command line interface for controlling Obsidian from the terminal. It enables scripting, automation, and integration with external tools. The Obsidian desktop app must be running for CLI commands to work.
Prerequisites
- Obsidian installer v1.12+ with CLI enabled in Settings > General > Command line interface
- The Obsidian desktop app must be running (the first CLI command will launch it if not)
Command Syntax
obsidian <command> [parameters] [flags]
obsidian
Parameters and Flags
- Parameter: takes a value as
param=value. Quote values with spaces: content="Hello world"
- Flag: boolean switch with no value. Include to enable:
open, overwrite, verbose
- Multiline content: use
\n for newline, \t for tab
- Copy output: append
--copy to any command to copy output to clipboard
Vault Targeting
If the terminal's cwd is inside a vault, that vault is used. Otherwise the active vault is used.
obsidian vault=Notes daily
obsidian vault="My Vault" search query="test"
File Targeting
Many commands accept file=<name> (wikilink-style resolution) or path=<path> (exact path from vault root). If neither is provided, the active file is used.
obsidian read file=Recipe
obsidian read path="Templates/Recipe.md"
Common Workflows
Reading and Writing Notes
obsidian read
obsidian read file=Recipe
obsidian create name="Trip to Paris" template=Travel open
obsidian append file=TODO content="- [ ] Buy milk"
obsidian prepend path="journal.md" content="---"
Daily Notes
obsidian daily
obsidian daily:read
obsidian daily:append content="- [ ] Buy groceries"
obsidian daily:path
Search
obsidian search query="meeting notes"
obsidian search query="TODO" path=Projects limit=10
obsidian search:context query="meeting" format=json
Tasks
obsidian tasks
obsidian tasks todo
obsidian tasks daily
obsidian task ref="Recipe.md:8" toggle
obsidian task daily line=3 done
Properties and Tags
obsidian tags counts
obsidian properties file=Note format=yaml
obsidian property:set name=status value=draft file=Note
obsidian property:read name=tags file=Note
Vault Analysis
obsidian files
obsidian files folder=Projects ext=md
obsidian backlinks file=Note
obsidian links file=Note
obsidian orphans
obsidian unresolved
obsidian outline file=Note
Plugins
obsidian plugins
obsidian plugins:enabled filter=community
obsidian plugin:install id=my-plugin enable
obsidian plugin:reload id=my-plugin
Developer Commands
obsidian devtools
obsidian dev:screenshot path=screenshot.png
obsidian eval code="app.vault.getFiles().length"
obsidian dev:console level=error
obsidian dev:css selector=".workspace" prop=background
obsidian dev:dom selector=".nav-file-title" text all
Output Formats
Many commands support format=json|tsv|csv|md for structured output. Default varies by command. Use total flag to get counts only.
Command Categories
For the complete command reference with all parameters and flags, consult references/commands.md. Commands are organized into these categories:
- General:
help, version, reload, restart
- Bases:
bases, base:views, base:create, base:query
- Bookmarks:
bookmarks, bookmark
- Command palette:
commands, command, hotkeys, hotkey
- Daily notes:
daily, daily:path, daily:read, daily:append, daily:prepend
- File history:
diff, history, history:list, history:read, history:restore, history:open
- Files and folders:
file, files, folder, folders, open, create, read, append, prepend, move, rename, delete
- Links:
backlinks, links, unresolved, orphans, deadends
- Outline:
outline
- Plugins:
plugins, plugins:enabled, plugins:restrict, plugin, plugin:enable, plugin:disable, plugin:install, plugin:uninstall, plugin:reload
- Properties:
aliases, properties, property:set, property:remove, property:read
- Publish:
publish:site, publish:list, publish:status, publish:add, publish:remove, publish:open
- Random notes:
random, random:read
- Search:
search, search:context, search:open
- Sync:
sync, sync:status, sync:history, sync:read, sync:restore, sync:open, sync:deleted
- Tags:
tags, tag
- Tasks:
tasks, task
- Templates:
templates, template:read, template:insert
- Themes and snippets:
themes, theme, theme:set, theme:install, theme:uninstall, snippets, snippets:enabled, snippet:enable, snippet:disable
- Unique notes:
unique
- Vault:
vault, vaults, vault:open
- Web viewer:
web
- Wordcount:
wordcount
- Workspace:
workspace, workspaces, workspace:save, workspace:load, workspace:delete, tabs, tab:open, recents
- Developer:
devtools, dev:debug, dev:cdp, dev:errors, dev:screenshot, dev:console, dev:css, dev:dom, dev:mobile, eval
Validation
Confirm the CLI is available and connected before relying on command output: run obsidian version. A successful version string means the desktop app is running with the CLI enabled; an error means the app is not running or the CLI is disabled (see Prerequisites).
Additional Resources
Reference Files
references/commands.md - Complete command reference with all parameters, flags, and descriptions for every Obsidian CLI command