Index of every page on this site: llms.txt
All skills
obsidianmd avatar

/obsidian-cli

@b110b2f
by Obsidianobsidianmd/obsidian-skills53k stars
3,795
Run it yourself

Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.

Use this Skill: https://skilld.dev/gh/obsidianmd/obsidian-skills/obsidian-cli

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈120 tokens for metadata: the name and description. ≈1.5k when used: this file.

Description uses 6.0% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈482 characters, or 6.0%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Obsidian CLI

Use the obsidian CLI to interact with a running Obsidian instance. Requires Obsidian to be open.

Before using the CLI

Run obsidian help to check availability. If the command is missing, explain how to turn on the CLI using https://help.obsidian.md/cli. The obsidian command ships with the Obsidian installer; don't install the unrelated npm package obsidian-cli. If it can't find Obsidian, ask the user to open the desktop app, then retry. In a sandboxed shell the same message can mean the sandbox blocked the CLI's local socket.

On WSL, run Obsidian.com from the Windows install folder, not Obsidian.exe. Obsidian.com is the console wrapper that prints the output; Obsidian.exe exits without printing anything.

The CLI exits with status 0 even when a command fails, so read its output before reporting that a command succeeded.

Quote parameters for the current shell, and pass note text as literal argument data, never as executable shell syntax.

Command reference

Run obsidian help to see all available commands. This is always up to date. Full docs: https://help.obsidian.md/cli

Syntax

Parameters take a value with =. Quote values with spaces:

obsidian create name="My Note" content="Hello world"

Flags are boolean switches with no value:

obsidian create name="My Note" open overwrite

Use overwrite only when replacing an existing file is intended.

Opening is opt-in: pass open to open the file, and add newtab to open it in a new tab. There is no silent flag.

In content=, \n becomes a newline and \t a tab. Every \n and \t is converted and there's no escape, so text such as the LaTeX \theta or the path C:\notes is corrupted. Write content that contains backslashes, or is longer than about 4 KB, directly to the note's file instead.

A dot in a file name is read as the start of an extension. When a name contains a dot, include the extension: create name="Meeting 2026.11.06.md", rename name="v1.2 notes.md", move to="Archive 2026.10/Note.md".

File targeting

Many commands accept file or path to target a file. Without either, the active file is used.

  • file=<name> — resolves like a wikilink (name only, no path needed). .md is optional; other file types need their extension, e.g. file="Projects.base". Aliases don't resolve.
  • path=<path> — exact path from vault root, e.g. folder/note.md

Vault targeting

Without vault=, commands target the vault that contains the current directory, then the most recently focused vault. vault=<name> only works as the first parameter; anywhere else it's ignored:

obsidian vault="My Vault" search query="test"

Use vault= when the user has selected a vault. If the target is unclear and the user has several vaults, ask which one before changing files.

Common patterns

obsidian read file="My Note"
obsidian create name="New Note" template="Template"   # a template replaces content=
obsidian create name="New Note" content="# Hello" open  # also open in Obsidian
obsidian append file="My Note" content="New line"
obsidian rename path="folder/note.md" name="New name"
obsidian move path="folder/note.md" to="archive/"
obsidian delete path="folder/note.md"
obsidian search query="search term" limit=10
obsidian daily:read
obsidian daily:append content="- [ ] New task"
obsidian property:set name="status" value="done" file="My Note"
obsidian tasks daily todo
obsidian tags sort=count counts
obsidian backlinks file="My Note"

Use rename and move, not filesystem mv or obsidian eval, so Obsidian can update links to the file. If other notes link to it and Settings → Files and links → Automatically update internal links is off, Obsidian asks in a dialog and the command waits until someone answers. delete moves the file to the trash; don't pass permanent unless the user asks for it. Prefer create and append over eval for writing note bodies.

Use total on list commands to get a count.

Output options placement: --copy, --json, --md, --tsv, and --csv only work after the command name. Putting them before the command (or before vault=) fails — often as Command "--copy" not found — because the first token is treated as the command. Prefer vault= first when used; put double-dash options last:

obsidian tasks todo total --copy
obsidian vault="My Vault" search query="TODO" --copy
obsidian tasks todo format=json   # many list commands also accept format=
# Wrong: obsidian --copy vault="My Vault" tasks todo

Plugin development

Develop/test cycle

Turn on console capture once with obsidian dev:debug on, so messages from the reload are kept. After making code changes to a plugin or theme, follow this workflow:

  1. Reload the plugin to pick up changes:
    obsidian plugin:reload id=my-plugin
  2. Check for errors — if errors appear, fix and repeat from step 1:
    obsidian dev:errors
  3. Verify visually with a screenshot or DOM inspection:
    obsidian dev:screenshot
    obsidian dev:dom selector=".workspace-leaf" text
  4. Check console output for warnings or unexpected logs:
    obsidian dev:console level=error

dev:screenshot saves to a temporary file and prints its path. A relative path= saves inside the vault.

Additional developer commands

Run JavaScript in the app context (prefer dedicated commands like rename, move, create, and append for vault mutations):

obsidian eval code="app.vault.getFiles().length"

Inspect CSS values:

obsidian dev:css selector=".workspace-leaf" prop=background-color

Toggle mobile emulation:

obsidian dev:mobile on

Run obsidian help to see additional developer commands including CDP and debugger controls.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning7d3 checks · Risk MEDIUM
  • Gen Agent Trust Hub7d

    This skill provides a comprehensive interface for managing Obsidian vaults and developing plugins. While it originates from a recognized vendor, it includes features for dynamic JavaScript execution and handles local data that could be used for indirect prompt injection.

  • Socket7d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at b110b2f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 12 hours ago.

Activeupdated last week
  • CLI
  • obsidian
  • vault
  • note-management
  • plugin-development
  • task-management
  • markdown
  • javascript

README badge

README badge for obsidianmd/obsidian-skills/obsidian-cli

Interact with Obsidian vaults from the command line to read, create, search, and manage notes, tasks, and properties. Also supports plugin and theme development with commands to reload plugins, inspect the DOM, capture screenshots, and run JavaScript in the app context.

Generated from the current SKILL.md.

Does this skill require Obsidian to be running?
Yes. The Obsidian CLI requires a running Obsidian instance to interact with vaults.
Can I target a specific vault if I have multiple open?
Yes. Use the `vault=<name>` parameter as the first argument to target a specific vault. Commands target the most recently focused vault by default.
What file targeting methods does this support?
Two methods: `file=<name>` resolves like a wikilink (name only), and `path=<path>` uses an exact path from vault root. Without either, the active file is used.
Can I use this skill for plugin development?
Yes. The skill includes commands to reload plugins, run JavaScript in the app context, capture screenshots, inspect DOM and CSS, and check console output for errors.

Generated from the current SKILL.md. These answers refresh after source changes.