Skip to main content
Obsidian provides two command-line tools for automation and scripting:

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.
Obsidian CLI requires the Obsidian 1.12.4 installer or later. See the installer version update guide in Obsidian’s update settings.

Install Obsidian CLI

1

Update Obsidian

Upgrade to the latest Obsidian installer version (1.12.4 or above).
2

Enable the CLI in settings

Go to Settings → General and enable Command line interface.
3

Register the CLI

Follow the prompt to register Obsidian CLI. This adds obsidian to your system PATH.
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:
# Get help
obsidian help

# Show Obsidian version
obsidian version
Or open the interactive terminal user interface (TUI) by entering obsidian with no arguments. The TUI supports autocomplete, command history, and reverse search (Ctrl+R):
# Open the TUI, then run a command without the "obsidian" prefix
obsidian
help

Parameters and flags

Commands accept parameters (key-value pairs) and flags (boolean switches):
# Parameter: name=value (quote values with spaces)
obsidian create name=Note content="Hello world"

# Flags: include the flag name to enable it
obsidian create name=Note content="Hello" open overwrite

# Multiline content: use \n for newlines
obsidian create name=Note content="# Title\n\nBody text"

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:
obsidian vault=Notes daily
obsidian vault="My Vault" search query="meeting notes"

Everyday examples

# Open today's daily note
obsidian daily

# Add a task to your daily note
obsidian daily:append content="- [ ] Buy groceries"

# Search your vault
obsidian search query="meeting notes"

# Read the active file
obsidian read

# Create a new note from a template
obsidian create name="Trip to Paris" template=Travel

# List all tags with counts
obsidian tags counts

# Copy the output of any command to clipboard
obsidian read --copy

Developer examples

# Open developer tools
obsidian devtools

# Reload a plugin you're developing
obsidian plugin:reload id=my-plugin

# Take a screenshot
obsidian dev:screenshot path=screenshot.png

# Execute JavaScript in the app
obsidian eval code="app.vault.getFiles().length"

Key command categories

CommandDescription
open file=<name>Open a file.
readRead 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.
deleteDelete the active file.
filesList files in the vault.
CommandDescription
dailyOpen 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:readRead the daily note.
daily:pathGet the expected path of today’s daily note.
CommandDescription
pluginsList 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).
themesList 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.
CommandDescription
workspaceShow the workspace tree.
workspacesList saved workspaces.
workspace:save name=<name>Save the current layout.
workspace:load name=<name>Load a saved layout.
tabsList open tabs.
recentsList recently opened files.
CommandDescription
tasksList tasks in the vault.
tasks todoList incomplete tasks.
tasks dailyList tasks from today’s daily note.
task ref=<path:line> toggleToggle a task’s completion status.
CommandDescription
basesList all .base files in the vault.
base:viewsList views in the current base file.
base:createCreate a new item in a base.
base:queryQuery a base and return results.
CommandDescription
bookmarksList bookmarks.
bookmarkAdd a bookmark (file, folder, search, or URL).
CommandDescription
propertiesList 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.
aliasesList aliases in the vault.
These commands control Sync within the running Obsidian app. To sync without the desktop app, see Obsidian Headless.
CommandDescription
sync on / sync offResume or pause sync.
sync:statusShow sync status and storage usage.
sync:historyList sync version history for a file.
sync:read version=<n>Read a specific sync version.
sync:restore version=<n>Restore a sync version.
sync:deletedList deleted files in sync.
CommandDescription
publish:siteShow publish site info (slug, URL).
publish:listList published files.
publish:statusList publish changes (new, changed, deleted).
publish:addPublish the active file or all changed files.
publish:removeUnpublish a file.
publish:openOpen the active file on the published site.
CommandDescription
tagsList tags in the vault.
tag name=<tag>Get tag info.
tasksList tasks in the vault.
task ref=<path:line> toggleToggle a task’s completion status.
CommandDescription
vaultShow vault info.
vaultsList known vaults.
vault:open name=<name>Switch to a different vault (TUI only).
wordcountCount words and characters.
outlineShow headings for the current file.
randomOpen a random note.
uniqueCreate a unique note.
CommandDescription
devtoolsToggle Electron developer tools.
dev:screenshot path=<file>Take a screenshot (returns base64 PNG).
dev:errorsShow captured JavaScript errors.
dev:consoleShow 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
ActionShortcut
Move cursor left / Ctrl+B
Move cursor right / Ctrl+F
Jump to start of lineCtrl+A
Jump to end of lineCtrl+E
Move back one wordAlt+B
Move forward one wordAlt+F
Editing
ActionShortcut
Delete to start of lineCtrl+U
Delete to end of lineCtrl+K
Delete previous wordCtrl+W / Alt+Backspace
Autocomplete
ActionShortcut
Enter suggestion mode / accept suggestionTab
Exit suggestion modeShift+Tab
Enter suggestion mode (from fresh input)
History
ActionShortcut
Previous history entry / Ctrl+P
Next history entry / Ctrl+N
Reverse history searchCtrl+R
Other
ActionShortcut
Clear screenCtrl+L
ExitCtrl+C / Ctrl+D

Troubleshooting

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.
CLI registration adds the Obsidian binary to your PATH via ~/.zprofile. If the obsidian command isn’t found, check that this line exists in ~/.zprofile:
export PATH="$PATH:/Applications/Obsidian.app/Contents/MacOS"
For other shells (bash, fish), add the same path to ~/.bash_profile or run fish_add_path /Applications/Obsidian.app/Contents/MacOS.
Registration creates a symlink at /usr/local/bin/obsidian. Verify it exists:
ls -l /usr/local/bin/obsidian
If missing, create it manually:
sudo ln -s /path/to/obsidian /usr/local/bin/obsidian
If the symlink was placed in ~/.local/bin/ instead, ensure that directory is in your PATH.
If the CLI doesn’t detect the insider .asar, set XDG_CONFIG_HOME to point to the Snap config path:
export XDG_CONFIG_HOME="$HOME/snap/obsidian/current/.config"
Add this to ~/.bashrc or ~/.zshrc to make it persistent.
Create a symlink to the Flatpak binary:
# System install
ln -s /var/lib/flatpak/exports/bin/md.obsidian.Obsidian ~/.local/bin/obsidian

# User install
ln -s ~/.local/share/flatpak/exports/bin/md.obsidian.Obsidian ~/.local/bin/obsidian

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.
npm install -g obsidian-headless

Authenticate

# Log in to your Obsidian account
ob login

# Log in with explicit credentials
ob login --email [email protected] --password yourpassword

# Log out and clear stored credentials
ob logout
All options are interactive when omitted — email and password are prompted, and two-factor authentication is requested automatically if enabled on your account.

Available services

ServiceDescription
Headless SyncSync vaults using Obsidian Sync, without the desktop app.
Headless PublishPublish sites using Obsidian Publish, without the desktop app.

Build docs developers (and LLMs) love