Obsidian CLI
Controls the running Obsidian desktop app from your terminal. Everything you can do in the app, you can do from the command line.
Obsidian Headless
A standalone client that runs independently of the desktop app. Sync vaults and publish sites from any server or CI environment.
Obsidian CLI
Obsidian CLI lets you control Obsidian from your terminal for scripting, automation, and integration with external tools — including developer commands to inspect elements, take screenshots, reload plugins, and run JavaScript in the app console.Install Obsidian CLI
The Obsidian app must be running for CLI commands to work. If it’s not running, the first command you execute will launch Obsidian automatically.
Run commands
Run a single command directly from your terminal:obsidian with no arguments. The TUI supports autocomplete, command history, and reverse search (Ctrl+R):
Parameters and flags
Commands accept parameters (key-value pairs) and flags (boolean switches):Target a vault
If your terminal’s current working directory is inside a vault, that vault is used automatically. Otherwise, the currently active vault is used. To target a specific vault explicitly:Everyday examples
Developer examples
Key command categories
Files and folders
Files and folders
| Command | Description |
|---|---|
open file=<name> | Open a file. |
read | Read the active (or specified) file’s contents. |
create name=<name> | Create a new file. |
append content=<text> | Append content to a file. |
prepend content=<text> | Prepend content after frontmatter. |
move to=<path> | Move or rename a file. |
rename name=<name> | Rename a file. |
delete | Delete the active file. |
files | List files in the vault. |
Daily notes
Daily notes
| Command | Description |
|---|---|
daily | Open today’s daily note. |
daily:append content=<text> | Append content to the daily note. |
daily:prepend content=<text> | Prepend content to the daily note. |
daily:read | Read the daily note. |
daily:path | Get the expected path of today’s daily note. |
Search
Search
| Command | Description |
|---|---|
search query=<text> | Search the vault. Returns matching file paths. |
search:context query=<text> | Search with surrounding line context (grep-style output). |
Plugins and themes
Plugins and themes
| Command | Description |
|---|---|
plugins | List installed plugins. |
plugin:enable id=<id> | Enable a plugin. |
plugin:disable id=<id> | Disable a plugin. |
plugin:install id=<id> | Install a community plugin. |
plugin:reload id=<id> | Reload a plugin (for development). |
themes | List installed themes. |
theme:set name=<name> | Activate a theme. |
snippet:enable name=<name> | Enable a CSS snippet. |
snippet:disable name=<name> | Disable a CSS snippet. |
Workspace and tabs
Workspace and tabs
| Command | Description |
|---|---|
workspace | Show the workspace tree. |
workspaces | List saved workspaces. |
workspace:save name=<name> | Save the current layout. |
workspace:load name=<name> | Load a saved layout. |
tabs | List open tabs. |
recents | List recently opened files. |
Tasks
Tasks
| Command | Description |
|---|---|
tasks | List tasks in the vault. |
tasks todo | List incomplete tasks. |
tasks daily | List tasks from today’s daily note. |
task ref=<path:line> toggle | Toggle a task’s completion status. |
Bases
Bases
| Command | Description |
|---|---|
bases | List all .base files in the vault. |
base:views | List views in the current base file. |
base:create | Create a new item in a base. |
base:query | Query a base and return results. |
Bookmarks
Bookmarks
| Command | Description |
|---|---|
bookmarks | List bookmarks. |
bookmark | Add a bookmark (file, folder, search, or URL). |
Links
Links
| Command | Description |
|---|---|
backlinks | List backlinks to a file. |
links | List outgoing links from a file. |
unresolved | List unresolved links in the vault. |
orphans | List files with no incoming links. |
deadends | List files with no outgoing links. |
Properties
Properties
| Command | Description |
|---|---|
properties | List properties in the vault or a specific file. |
property:set name=<name> value=<value> | Set a property on a file. |
property:remove name=<name> | Remove a property from a file. |
property:read name=<name> | Read a property value from a file. |
aliases | List aliases in the vault. |
Sync commands (in-app)
Sync commands (in-app)
These commands control Sync within the running Obsidian app. To sync without the desktop app, see Obsidian Headless.
| Command | Description |
|---|---|
sync on / sync off | Resume or pause sync. |
sync:status | Show sync status and storage usage. |
sync:history | List sync version history for a file. |
sync:read version=<n> | Read a specific sync version. |
sync:restore version=<n> | Restore a sync version. |
sync:deleted | List deleted files in sync. |
Publish commands (in-app)
Publish commands (in-app)
| Command | Description |
|---|---|
publish:site | Show publish site info (slug, URL). |
publish:list | List published files. |
publish:status | List publish changes (new, changed, deleted). |
publish:add | Publish the active file or all changed files. |
publish:remove | Unpublish a file. |
publish:open | Open the active file on the published site. |
Tags and tasks
Tags and tasks
Vault
Vault
| Command | Description |
|---|---|
vault | Show vault info. |
vaults | List known vaults. |
vault:open name=<name> | Switch to a different vault (TUI only). |
wordcount | Count words and characters. |
outline | Show headings for the current file. |
random | Open a random note. |
unique | Create a unique note. |
Developer commands
Developer commands
| Command | Description |
|---|---|
devtools | Toggle Electron developer tools. |
dev:screenshot path=<file> | Take a screenshot (returns base64 PNG). |
dev:errors | Show captured JavaScript errors. |
dev:console | Show captured console messages. |
dev:css selector=<css> | Inspect CSS with source locations. |
dev:dom selector=<css> | Query DOM elements. |
eval code=<javascript> | Execute JavaScript and return the result. |
TUI keyboard shortcuts
Navigation| Action | Shortcut |
|---|---|
| Move cursor left | ← / Ctrl+B |
| Move cursor right | → / Ctrl+F |
| Jump to start of line | Ctrl+A |
| Jump to end of line | Ctrl+E |
| Move back one word | Alt+B |
| Move forward one word | Alt+F |
| Action | Shortcut |
|---|---|
| Delete to start of line | Ctrl+U |
| Delete to end of line | Ctrl+K |
| Delete previous word | Ctrl+W / Alt+Backspace |
| Action | Shortcut |
|---|---|
| Enter suggestion mode / accept suggestion | Tab |
| Exit suggestion mode | Shift+Tab |
| Enter suggestion mode (from fresh input) | ↓ |
| Action | Shortcut |
|---|---|
| Previous history entry | ↑ / Ctrl+P |
| Next history entry | ↓ / Ctrl+N |
| Reverse history search | Ctrl+R |
| Action | Shortcut |
|---|---|
| Clear screen | Ctrl+L |
| Exit | Ctrl+C / Ctrl+D |
Troubleshooting
Windows
Windows
Obsidian CLI on Windows requires the 1.12.4+ installer. When you install Obsidian 1.12.4+, the
Obsidian.com terminal redirector is added in the folder where you installed the Obsidian.exe file. This redirector connects Obsidian’s GUI process to stdin/stdout, which is necessary because Obsidian normally runs as a GUI app incompatible with terminal output on Windows.macOS
macOS
CLI registration adds the Obsidian binary to your PATH via For other shells (bash, fish), add the same path to
~/.zprofile. If the obsidian command isn’t found, check that this line exists in ~/.zprofile:~/.bash_profile or run fish_add_path /Applications/Obsidian.app/Contents/MacOS.Linux (AppImage)
Linux (AppImage)
Registration creates a symlink at If missing, create it manually:If the symlink was placed in
/usr/local/bin/obsidian. Verify it exists:~/.local/bin/ instead, ensure that directory is in your PATH.Linux (Snap)
Linux (Snap)
If the CLI doesn’t detect the insider Add this to
.asar, set XDG_CONFIG_HOME to point to the Snap config path:~/.bashrc or ~/.zshrc to make it persistent.Linux (Flatpak)
Linux (Flatpak)
Create a symlink to the Flatpak binary:
Obsidian Headless
Obsidian Headless (open beta) is a standalone command-line client for Obsidian services. It runs without the desktop app, making it ideal for servers, CI pipelines, and automation workflows. Common use cases:- Automate remote backups
- Publish a website on a schedule
- Sync a shared vault to a server for other tools to consume
- Give agentic tools vault access without exposing your full desktop
Obsidian Headless syncs and publishes vaults. It does not control the Obsidian desktop app. For controlling the running desktop app, use Obsidian CLI above.
Install Obsidian Headless
Obsidian Headless requires Node.js 22 or later.Authenticate
Available services
| Service | Description |
|---|---|
| Headless Sync | Sync vaults using Obsidian Sync, without the desktop app. |
| Headless Publish | Publish sites using Obsidian Publish, without the desktop app. |