Skip to content

CLI Reference

All commands: obs vault="<YOUR_VAULT>" <command> [options]

File resolution: file=<name> (wikilink-style) or path=<path> (exact from vault root).


Read file contents.

read file=<name> | path=<path>

Create a new file.

create name=<name> | path=<path> [content=<text>] [template=<name>] [overwrite] [open] [newtab]

Append content to a file.

append file=<name> | path=<path> content=<text> [inline]

inline appends without newline.

Prepend content to a file.

prepend file=<name> | path=<path> content=<text> [inline]

Delete a file.

delete file=<name> | path=<path> [permanent]

permanent skips trash.

Move or rename a file.

move file=<name> | path=<path> to=<path>

Rename a file.

rename file=<name> | path=<path> name=<name>

Open a file in Obsidian.

open file=<name> | path=<path> [newtab]

Show file info.

file file=<name> | path=<path>

Open a random note.

random [folder=<path>] [newtab]

Read a random note.

random:read [folder=<path>]

Open daily note.

daily [paneType=tab|split|window]

Read daily note contents.

daily:read

Append content to daily note.

daily:append content=<text> [inline] [open] [paneType=tab|split|window]

Prepend content to daily note.

daily:prepend content=<text> [inline] [open] [paneType=tab|split|window]

Get daily note file path.

daily:path

Search vault for text.

search query=<text> [path=<folder>] [limit=<n>] [total] [case] [format=text|json]

Search with matching line context.

search:context query=<text> [path=<folder>] [limit=<n>] [case] [format=text|json]

Open search view in Obsidian.

search:open [query=<text>]

List tasks in the vault.

tasks [file=<name>] [path=<path>] [total] [done] [todo] [status="<char>"] [verbose] [format=json|tsv|csv] [active] [daily]
  • todo — incomplete only
  • done — completed only
  • verbose — group by file with line numbers
  • daily — daily note tasks only

Show or update a single task.

task [ref=<path:line>] [file=<name>] [path=<path>] [line=<n>] [toggle] [done] [todo] [daily] [status="<char>"]

Set a property on a file.

property:set name=<name> value=<value> [type=text|list|number|checkbox|date|datetime] [file=<name>] [path=<path>]

Read a property value.

property:read name=<name> [file=<name>] [path=<path>]

Remove a property.

property:remove name=<name> [file=<name>] [path=<path>]

List properties in the vault.

properties [file=<name>] [path=<path>] [name=<name>] [total] [sort=count] [counts] [format=yaml|json|tsv] [active]

List backlinks to a file.

backlinks [file=<name>] [path=<path>] [counts] [total] [format=json|tsv|csv]

List outgoing links from a file.

links [file=<name>] [path=<path>] [total]

List files with no incoming links.

orphans [total] [all]

List files with no outgoing links.

deadends [total] [all]

List unresolved links in vault.

unresolved [total] [counts] [verbose] [format=json|tsv|csv]

List files in the vault.

files [folder=<path>] [ext=<extension>] [total]

List folders in the vault.

folders [folder=<path>] [total]

List tags in the vault.

tags [file=<name>] [path=<path>] [total] [counts] [sort=count] [format=json|tsv|csv] [active]

Get tag info.

tag name=<tag> [total] [verbose]

List aliases in the vault.

aliases [file=<name>] [path=<path>] [total] [verbose] [active]

Show headings for a file.

outline [file=<name>] [path=<path>] [format=tree|md|json] [total]

Count words and characters.

wordcount [file=<name>] [path=<path>] [words] [characters]

List recently opened files.

recents [total]

Add a bookmark.

bookmark [file=<path>] [subpath=<subpath>] [folder=<path>] [search=<query>] [url=<url>] [title=<title>]

List bookmarks.

bookmarks [total] [verbose] [format=json|tsv|csv]

List templates.

templates [total]

Read template content.

template:read name=<template> [resolve] [title=<title>]

resolve resolves template variables.

Insert template into active file.

template:insert name=<template>

List all base files in vault.

bases

List views in a base file.

base:views

Query a base and return results.

base:query [file=<name>] [path=<path>] [view=<name>] [format=json|csv|tsv|md|paths]

Create a new item in a base.

base:create [file=<name>] [path=<path>] [view=<name>] [name=<name>] [content=<text>] [open] [newtab]

List file history versions.

history [file=<name>] [path=<path>]

List files with history.

history:list

Read a file history version.

history:read [file=<name>] [path=<path>] [version=<n>]

Default version: 1 (most recent).

Restore a file history version.

history:restore [file=<name>] [path=<path>] version=<n>

Open file recovery view.

history:open [file=<name>] [path=<path>]

List or diff local/sync versions.

diff [file=<name>] [path=<path>] [from=<n>] [to=<n>] [filter=local|sync]

Pause or resume sync.

sync on | off

Show sync status.

sync:status

List sync version history for a file.

sync:history [file=<name>] [path=<path>] [total]

Read a sync version.

sync:read [file=<name>] [path=<path>] version=<n>

Restore a sync version.

sync:restore [file=<name>] [path=<path>] version=<n>

List deleted files in sync.

sync:deleted [total]

List installed plugins.

plugins [filter=core|community] [versions] [format=json|tsv|csv]

List enabled plugins.

plugins:enabled [filter=core|community] [versions] [format=json|tsv|csv]

Get plugin info.

plugin id=<plugin-id>
plugin:enable id=<id> [filter=core|community]
plugin:disable id=<id> [filter=core|community]
plugin:install id=<id> [enable]
plugin:uninstall id=<id>

Reload a plugin (for developers).

plugin:reload id=<id>

Toggle or check restricted mode.

plugins:restrict [on] [off]

List installed themes.

themes [versions]

Show active theme or get info.

theme [name=<name>]

Set active theme.

theme:set name=<name>
theme:install name=<name> [enable]
theme:uninstall name=<name>
snippets
snippets:enabled
snippet:enable name=<name>
snippet:disable name=<name>

List available command IDs.

commands [filter=<prefix>]

Execute an Obsidian command.

command id=<command-id>

List hotkeys.

hotkeys [total] [verbose] [format=json|tsv|csv] [all]

Get hotkey for a command.

hotkey id=<command-id> [verbose]

Show vault info.

vault [info=name|path|files|folders|size]

List known vaults.

vaults [total] [verbose]

Reload the vault.

reload

Restart the app.

restart

List open tabs.

tabs [ids]

Open a new tab.

tab:open [group=<id>] [file=<path>] [view=<type>]

Show workspace tree.

workspace [ids]