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:
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):

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

These commands control Sync within the running Obsidian app. To sync without the desktop app, see Obsidian Headless.

TUI keyboard shortcuts

Navigation Editing Autocomplete History Other

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:
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:
If missing, create it manually:
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:
Add this to ~/.bashrc or ~/.zshrc to make it persistent.
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

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