# Obsidian CLI Obsidian CLI is the official command line interface for [[Obsidian]], introduced in version 1.12.0 (February 2026). It lets you control Obsidian from the terminal for scripting, automation, and integration with external tools. Anything you can do in Obsidian can be done from the command line, including developer commands for plugin and theme development. > [!warning] Early access > Obsidian CLI requires Obsidian 1.12 or above, which is currently an early access version and requires a Catalyst license. Commands and syntax may change during the early access phase. ## Installation Prerequisites: latest Obsidian installer version (1.12.4+) and early access version (1.12.x). 1. Go to **Settings > General** 2. Enable **Command line interface** 3. Follow the prompt to register Obsidian CLI ### Platform-specific notes **Linux**: The CLI registration creates a symlink at `/usr/local/bin/obsidian` pointing to the Obsidian binary (requires sudo). For AppImage installs, the symlink points to the `.AppImage` file instead of the internal binary. If sudo fails, the symlink is created at `~/.local/bin/obsidian` as a fallback — make sure `~/.local/bin` is in your PATH. For Snap, you may need to set `XDG_CONFIG_HOME=$HOME/snap/obsidian/current/.config`. For Flatpak, symlink the exports bin to `~/.local/bin/obsidian`. **macOS**: The CLI registration adds the Obsidian binary directory to your PATH via `~/.zprofile`. Only modifies zsh (default macOS shell). If you use bash, add `export PATH="$PATH:/Applications/Obsidian.app/Contents/MacOS"` to `~/.bash_profile`; for fish, run `fish_add_path /Applications/Obsidian.app/Contents/MacOS`. **Windows**: Requires Obsidian installer 1.12.4+. The `Obsidian.com` terminal redirector is bundled with the installer and placed in the same folder as `Obsidian.exe` automatically. ## Getting started Obsidian CLI requires the Obsidian app to be running. If Obsidian is not running, the first command you run launches it. The CLI supports both single commands and a terminal user interface (TUI) with interactive help and autocomplete. ### Run a single command ```shell obsidian help obsidian daily obsidian search query="meeting notes" ``` ### Use the terminal interface (TUI) Enter `obsidian` to start the TUI. Subsequent commands can be entered without the `obsidian` prefix. The TUI supports autocomplete, command history, and reverse search (`Ctrl+R`). ```shell obsidian help daily search query="meeting notes" ``` ## How parameters and flags work Commands can use **parameters** (key=value pairs) and **flags** (boolean switches). ```shell # Parameter: name=value (use quotes for values with spaces) obsidian create name="Trip to Paris" content="Hello world" # Flags: just include the flag name to turn it on obsidian create name=Note content="Hello" silent overwrite # Multiline content: use \n for newline, \t for tab obsidian create name=Note content="# Title\n\nBody text" ``` ### Targeting a vault If the terminal's current working directory is a vault folder, that vault is used by default. Otherwise, the currently active vault is used. Use `vault=<name>` as the first parameter to target a specific vault: ```shell obsidian vault=Notes daily obsidian vault="My Vault" search query="test" ``` ### Targeting a file Many commands accept `file` and `path` parameters. If neither is provided, the command defaults to the active file. - `file=<name>`: Resolves using the same link resolution as wikilinks (by file name, no extension needed) - `path=<path>`: Requires the exact path from the vault root (e.g., `folder/note.md`) ### Copying output Add `--copy` to any command to copy the output to the clipboard. ## Everyday use examples ```shell # 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 # List all tasks from your daily note obsidian tasks daily # Create a new note from a template obsidian create name="Trip to Paris" template=Travel # List all tags in your vault with counts obsidian tags counts # Compare two versions of a file obsidian diff file=README from=1 to=3 ``` ## Command reference ### General commands | Command | Description | |---------|-------------| | `help` | Show list of all available commands | | `version` | Show Obsidian version | | `reload` | Reload the app window | | `restart` | Restart the app | ### Daily notes | Command | Description | |---------|-------------| | `daily` | Open daily note. Params: `paneType=tab\|split\|window` | | `daily:path` | Get daily note path (returns expected path even if file not yet created) | | `daily:read` | Read daily note contents | | `daily:append` | Append content to daily note. Params: `content` (required), `paneType`. Flags: `inline`, `open` | | `daily:prepend` | Prepend content to daily note. Params: `content` (required), `paneType`. Flags: `inline`, `open` | ### Files and folders | Command | Description | |---------|-------------| | `file` | Show file info (path, name, extension, size, created, modified) | | `files` | List files in vault. Params: `folder`, `ext`. Flag: `total` | | `folder` | Show folder info. Params: `path` (required), `info=files\|folders\|size` | | `folders` | List folders. Params: `folder`. Flag: `total` | | `open` | Open a file. Params: `file`, `path`. Flag: `newtab` | | `create` | Create or overwrite a file. Params: `name`, `path`, `content`, `template`. Flags: `overwrite`, `open`, `newtab` | | `read` | Read file contents | | `append` | Append content to a file. Params: `file`, `path`, `content` (required). Flag: `inline` | | `prepend` | Prepend content after frontmatter. Params: `file`, `path`, `content` (required). Flag: `inline` | | `move` | Move or rename a file. Params: `file`, `path`, `to` (required) | | `rename` | Rename a file (extension preserved if omitted). Params: `file`, `path`, `name` (required) | | `delete` | Delete a file (to trash by default). Params: `file`, `path`. Flag: `permanent` | ### Search | Command | Description | |---------|-------------| | `search` | Search vault. Params: `query` (required), `path`, `limit`, `format=text\|json`. Flags: `total`, `case` | | `search:context` | Search with matching line context (grep-style `path:line: text` output). Params: `query` (required), `path`, `limit`, `format=text\|json`. Flag: `case` | | `search:open` | Open search view. Params: `query` | ### Links | Command | Description | |---------|-------------| | `backlinks` | List backlinks to a file. Params: `format=json\|tsv\|csv`. Flags: `counts`, `total` | | `links` | List outgoing links. Flag: `total` | | `unresolved` | List unresolved links. Flags: `total`, `counts`, `verbose` | | `orphans` | List files with no incoming links. Flags: `total`, `all` | | `deadends` | List files with no outgoing links. Flags: `total`, `all` | ### Tasks | Command | Description | |---------|-------------| | `tasks` | List tasks. Params: `file`, `path`, `status`, `format=json\|tsv\|csv`. Flags: `active`, `daily`, `total`, `done`, `todo`, `verbose` | | `task` | Show or update a task. Params: `ref=<path:line>`, `file`, `path`, `line`, `status`. Flags: `toggle`, `daily`, `done`, `todo` | ### Tags | Command | Description | |---------|-------------| | `tags` | List tags. Params: `file`, `path`, `sort=count`, `format=json\|tsv\|csv`. Flags: `active`, `total`, `counts` | | `tag` | Get tag info. Params: `name` (required). Flags: `total`, `verbose` | ### Properties | Command | Description | |---------|-------------| | `aliases` | List aliases. Params: `file`, `path`. Flags: `active`, `total`, `verbose` | | `properties` | List properties. Params: `file`, `path`, `name`, `sort=count`, `format=yaml\|json\|tsv`. Flags: `active`, `total`, `counts` | | `property:set` | Set a property. Params: `name` (required), `value` (required), `type`, `file`, `path` | | `property:remove` | Remove a property. Params: `name` (required), `file`, `path` | | `property:read` | Read a property value. Params: `name` (required), `file`, `path` | ### File history | Command | Description | |---------|-------------| | `diff` | List or compare versions from [[Obsidian File Recovery\|File Recovery]] and Sync. Params: `file`, `path`, `from`, `to`, `filter=local\|sync` | | `history` | List versions from File Recovery | | `history:list` | List all files with local history | | `history:read` | Read a local history version. Params: `file`, `path`, `version` | | `history:restore` | Restore a local history version. Params: `file`, `path`, `version` (required) | | `history:open` | Open file recovery | ### Plugins | Command | Description | |---------|-------------| | `plugins` | List installed plugins. Params: `filter=core\|community`. Flag: `versions` | | `plugins:enabled` | List enabled plugins | | `plugins:restrict` | Toggle restricted mode. Flags: `on`, `off` | | `plugin` | Get plugin info. Params: `id` (required) | | `plugin:enable` | Enable a plugin. Params: `id` (required), `filter` | | `plugin:disable` | Disable a plugin. Params: `id` (required), `filter` | | `plugin:install` | Install a community plugin. Params: `id` (required). Flag: `enable` | | `plugin:uninstall` | Uninstall a community plugin. Params: `id` (required) | | `plugin:reload` | Reload a plugin (for developers). Params: `id` (required) | ### Templates | Command | Description | |---------|-------------| | `templates` | List templates. Flag: `total` | | `template:read` | Read template content. Params: `name` (required), `title`. Flag: `resolve` | | `template:insert` | Insert template into active file. Params: `name` (required) | ### Bases | Command | Description | |---------|-------------| | `bases` | List all `.base` files | | `base:views` | List views in current base file | | `base:create` | Create a new item. Params: `file`, `path`, `view`, `name`, `content`. Flags: `open`, `newtab` | | `base:query` | Query a base. Params: `file`, `path`, `view`, `format=json\|csv\|tsv\|md\|paths` | ### Bookmarks | Command | Description | |---------|-------------| | `bookmarks` | List bookmarks. Params: `format=json\|tsv\|csv`. Flags: `total`, `verbose` | | `bookmark` | Add a bookmark. Params: `file`, `subpath`, `folder`, `search`, `url`, `title` | ### Command palette | Command | Description | |---------|-------------| | `commands` | List available command IDs. Params: `filter` | | `command` | Execute an Obsidian command. Params: `id` (required) | | `hotkeys` | List hotkeys. Params: `format=json\|tsv\|csv`. Flags: `total`, `verbose` | | `hotkey` | Get hotkey for a command. Params: `id` (required). Flag: `verbose` | ### Sync | Command | Description | |---------|-------------| | `sync` | Pause or resume sync. Flags: `on`, `off` | | `sync:status` | Show sync status and usage | | `sync:history` | List sync version history. Flag: `total` | | `sync:read` | Read a sync version. Params: `version` (required) | | `sync:restore` | Restore a sync version. Params: `version` (required) | | `sync:open` | Open sync history | | `sync:deleted` | List deleted files in sync. Flag: `total` | ### Publish | Command | Description | |---------|-------------| | `publish:site` | Show publish site info | | `publish:list` | List published files. Flag: `total` | | `publish:status` | List publish changes. Flags: `total`, `new`, `changed`, `deleted` | | `publish:add` | Publish a file. Flag: `changed` (publish all changed files) | | `publish:remove` | Unpublish a file | | `publish:open` | Open file on published site | ### Themes and snippets | Command | Description | |---------|-------------| | `themes` | List installed themes. Flag: `versions` | | `theme` | Show active theme or get info. Params: `name` | | `theme:set` | Set active theme. Params: `name` (required, empty for default) | | `theme:install` | Install a community theme. Params: `name` (required). Flag: `enable` | | `theme:uninstall` | Uninstall a theme. Params: `name` (required) | | `snippets` | List CSS snippets | | `snippets:enabled` | List enabled CSS snippets | | `snippet:enable` | Enable a CSS snippet. Params: `name` (required) | | `snippet:disable` | Disable a CSS snippet. Params: `name` (required) | ### Outline | Command | Description | |---------|-------------| | `outline` | Show headings. Params: `file`, `path`, `format=tree\|md\|json`. Flag: `total` | ### Word count | Command | Description | |---------|-------------| | `wordcount` | Count words and characters. Flags: `words`, `characters` | ### Workspace | Command | Description | |---------|-------------| | `workspace` | Show workspace tree. Flag: `ids` | | `workspaces` | List saved workspaces. Flag: `total` | | `workspace:save` | Save current layout. Params: `name` | | `workspace:load` | Load a workspace. Params: `name` (required) | | `workspace:delete` | Delete a workspace. Params: `name` (required) | | `tabs` | List open tabs. Flag: `ids` | | `tab:open` | Open a new tab. Params: `group`, `file`, `view` | | `recents` | List recently opened files. Flag: `total` | ### Vault | Command | Description | |---------|-------------| | `vault` | Show vault info. Params: `info=name\|path\|files\|folders\|size` | | `vaults` | List known vaults (desktop only). Flags: `total`, `verbose` | | `vault:open` | Switch to a different vault (TUI only). Params: `name` (required) | ### Random notes | Command | Description | |---------|-------------| | `random` | Open a random note. Params: `folder`. Flag: `newtab` | | `random:read` | Read a random note. Params: `folder` | ### Unique notes | Command | Description | |---------|-------------| | `unique` | Create unique note. Params: `name`, `content`, `paneType`. Flag: `open` | ### Web viewer | Command | Description | |---------|-------------| | `web` | Open URL in web viewer. Params: `url` (required). Flag: `newtab` | ## Developer commands These commands help with plugin and theme development. They allow agentic coding tools to automatically test and debug. | Command | Description | |---------|-------------| | `devtools` | Toggle Electron dev tools | | `dev:debug` | Attach/detach Chrome DevTools Protocol debugger. Flags: `on`, `off` | | `dev:cdp` | Run a Chrome DevTools Protocol command. Params: `method` (required), `params` | | `dev:errors` | Show captured JS errors. Flag: `clear` | | `dev:screenshot` | Take a screenshot (returns base64 PNG). Params: `path` | | `dev:console` | Show captured console messages. Params: `limit`, `level`. Flag: `clear` | | `dev:css` | Inspect CSS with source locations. Params: `selector` (required), `prop` | | `dev:dom` | Query DOM elements. Params: `selector` (required), `attr`, `css`. Flags: `total`, `text`, `inner`, `all` | | `dev:mobile` | Toggle mobile emulation. Flags: `on`, `off` | | `eval` | Execute JavaScript and return result. Params: `code` (required) | ### Developer examples ```shell # Open developer tools obsidian devtools # Reload a community plugin obsidian plugin:reload id=my-plugin # Take a screenshot obsidian dev:screenshot path=screenshot.png # Run JavaScript in the app console obsidian eval code="app.vault.getFiles().length" ``` ## TUI keyboard shortcuts ### Navigation | Action | Shortcut | |--------|----------| | Move cursor left | `Left` / `Ctrl+B` | | Move cursor right (accepts suggestion at end of line) | `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` | ### Editing | Action | Shortcut | |--------|----------| | Delete to start of line | `Ctrl+U` | | Delete to end of line | `Ctrl+K` | | Delete previous word | `Ctrl+W` / `Alt+Backspace` | ### Autocomplete | Action | Shortcut | |--------|----------| | Enter suggestion mode / accept suggestion | `Tab` | | Exit suggestion mode | `Shift+Tab` | | Enter suggestion mode (from fresh input) | `Down` | | Accept first/selected suggestion (at end of line) | `Right` | ### History | Action | Shortcut | |--------|----------| | Previous history entry / navigate up | `Up` / `Ctrl+P` | | Next history entry / navigate down | `Down` / `Ctrl+N` | | Reverse history search | `Ctrl+R` | ### Other | Action | Shortcut | |--------|----------| | Execute command or accept suggestion | `Enter` | | Undo autocomplete / exit / clear input | `Escape` | | Clear screen | `Ctrl+L` | | Exit | `Ctrl+C` / `Ctrl+D` | ## Troubleshooting - Make sure you are using the latest Obsidian installer version (1.12.4 or above) - Restart your terminal after registering the CLI for PATH changes to take effect - Obsidian must be running. The CLI connects to the running Obsidian instance. If Obsidian is not running, the first CLI command will launch it **Windows**: Requires Obsidian installer 1.12.4+. The `Obsidian.com` redirector is bundled — it handles the terminal stdin/stdout connection required because Obsidian is a GUI app. **macOS**: If registration seems to not work, check that `~/.zprofile` contains `export PATH="$PATH:/Applications/Obsidian.app/Contents/MacOS"`. For non-zsh shells, add this manually. **Linux (AppImage)**: If the symlink breaks after moving the `.AppImage` file, re-register the CLI or recreate the symlink manually. If `~/.local/bin/obsidian` was used as fallback, ensure `~/.local/bin` is in your PATH. **Linux (Snap)**: If the CLI can't detect the insider build, set `export XDG_CONFIG_HOME="$HOME/snap/obsidian/current/.config"` in your shell config. **Linux (Flatpak)**: Create the symlink manually: - 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` ## References - https://help.obsidian.md/cli - https://obsidian.md/changelog/ ## Related - [[Obsidian]] - [[Obsidian File Recovery]] - [[Obsidian Keyboard Shortcuts]] - [[Useful resources for Obsidian]] - [[Git plugin for Obsidian]] - [[How I synchronize and backup my Obsidian notes]] - [[AdvancedURI plugin for Obsidian]]