Files
claudeskill/skills/obsidian-cli/SKILL.md
2026-05-27 18:13:32 +08:00

9.0 KiB

name, description
name description
obsidian-cli Obsidian CLI skill for reading, creating, editing, searching, and managing note content in Obsidian vaults from the command line. Supports daily notes, tasks, properties, tags, links, file history, templates, and full file CRUD operations. Use this skill whenever the user wants to read or edit Obsidian notes, search vault content, manage tasks or properties, append/prepend content, or perform any vault note operation. Also triggers when the user mentions "obsidian cli", "obsidian command", "vault" operations, or "obsidian" in a terminal/CLI context. Always invoke this skill before attempting Obsidian-related operations to ensure correct command syntax and available parameters. Requires Obsidian 1.12+ with CLI enabled and the Obsidian app running.

Obsidian CLI

Control Obsidian from the command line. The Obsidian desktop app must be running — the CLI connects to it over a local bridge.

Prerequisites: Obsidian installer 1.12.7+ with CLI enabled (Settings -> General -> Command line interface).

Syntax

Parameters use key=value. Quote values containing spaces:

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

Flags are boolean switches with no value:

obsidian create name="My Note" open overwrite

Multiline content: Use \n for newline, \t for tab.

Copy output: Append --copy to any command to copy the result to clipboard.

Targeting

File targeting

Most file commands accept file and/or path. If neither is given, the active file is used.

Parameter Behavior
file=<name> Resolves like a wikilink — name only, no path or extension needed
path=<path> Exact vault-relative path, e.g. folder/note.md

Vault targeting

If your terminal CWD is a vault folder, that vault is used. Otherwise the active vault is used. Override with vault=<name> or vault=<id> as the first parameter:

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

Commands

For the full parameter reference of every command, read references/commands-reference.md.

Daily notes

obsidian daily                                        # Open today's daily note
obsidian daily:read                                   # Read daily note content
obsidian daily:append content="- [ ] Buy groceries"   # Append to daily note
obsidian daily:prepend content="# Summary"             # Prepend to daily note
obsidian daily:path                                   # Get daily note file path

Files and folders

obsidian file file=Recipe                             # Show file info
obsidian files folder="Projects" ext=md               # List files (filter by folder/extension)
obsidian folders                                      # List all folders
obsidian open file=Recipe                             # Open a file
obsidian read file=Recipe                             # Read file contents
obsidian create name="New Note" content="# Hello"     # Create a note
obsidian create name="Trip" template=Travel open      # Create from template and open
obsidian append file=Recipe content="New line"        # Append to file
obsidian prepend file=Recipe content="Header text"    # Prepend after frontmatter
obsidian move file=Recipe to="Archive/Recipe.md"      # Move/rename file
obsidian rename file=Recipe name="New Recipe"         # Rename file
obsidian delete file=Recipe                           # Delete file (to trash)
obsidian delete file=Recipe permanent                 # Delete permanently
obsidian search query="meeting notes"                 # Search vault (returns file paths)
obsidian search query="TODO" path="Projects" limit=10 # Search within a folder
obsidian search:context query="error"                 # Search with line context (grep-style)
obsidian search:open query="initial query"            # Open search in Obsidian UI

Tasks

obsidian tasks                                        # List all tasks
obsidian tasks todo                                   # Incomplete tasks only
obsidian tasks daily                                  # Tasks from today's daily note
obsidian tasks file=Recipe done verbose               # Completed tasks from a file, with line numbers
obsidian tasks daily total                            # Count tasks in daily note
obsidian task ref="Recipe.md:8" toggle                # Toggle task completion
obsidian task daily line=3 done                       # Mark daily note task as done
obsidian task file=Recipe line=8 status=-             # Set custom status character

Properties

obsidian properties                                   # List all properties in vault
obsidian properties active                            # Properties of active file
obsidian properties name=status counts                # Count occurrences of a property
obsidian property:set name=status value=done file=Recipe   # Set a property
obsidian property:read name=status file=Recipe              # Read a property value
obsidian property:remove name=draft file=Recipe             # Remove a property
obsidian aliases file=Recipe                          # List aliases for a file

Tags

obsidian tags                                         # List all tags
obsidian tags sort=count counts                       # Tags sorted by frequency with counts
obsidian tags active                                  # Tags of active file
obsidian tag name=project verbose                     # Tag info with file list
obsidian backlinks file=Recipe                        # List backlinks to a file
obsidian backlinks file=Recipe counts                 # With link counts
obsidian links file=Recipe                            # Outgoing links from a file
obsidian unresolved                                   # List unresolved links
obsidian orphans                                      # Files with no incoming links
obsidian deadends                                     # Files with no outgoing links

Outline

obsidian outline file=Recipe                          # Show headings (tree format)
obsidian outline file=Recipe format=json total        # JSON format with heading count

File history

obsidian diff                                         # List versions of active file
obsidian diff file=Recipe from=1                      # Compare latest version to current
obsidian diff file=Recipe from=3 to=1                 # Compare two versions
obsidian history file=Recipe                          # Local history versions
obsidian history:read file=Recipe version=2           # Read a history version
obsidian history:restore file=Recipe version=3        # Restore a history version

Templates

obsidian templates                                    # List templates
obsidian template:read name=Meeting resolve           # Read template with variables resolved
obsidian template:insert name=Meeting                 # Insert template into active file

Vault info

obsidian vault                                        # Show vault info
obsidian vault info=files                             # File count only
obsidian vaults verbose                               # List all known vaults with paths
obsidian wordcount file=Recipe                        # Word and character count
obsidian wordcount words                              # Word count only

General

obsidian help                                         # List all commands
obsidian version                                      # Show Obsidian version
obsidian reload                                       # Reload app window
obsidian restart                                      # Restart app

Troubleshooting: CLI Connection Issues

When obsidian commands return empty output (with exit code 0) or are unresponsive, the CLI bridge connection is likely broken. Follow this procedure:

  1. Detect the issue: If a command produces empty output with exit code 0, the bridge connection is broken
  2. Ask the user: Use AskUserQuestion to ask the user whether they allow running obsidian reload to reload the Obsidian window and restore the connection
  3. If the user agrees: Run obsidian reload, wait about 3 seconds, then retry the original command
  4. If the user declines: Fall back to reading/writing vault files directly via the filesystem (locate the vault path from %APPDATA%/obsidian/obsidian.json, then use Read/Edit/Write tools to operate on .md files directly)

Note

: obsidian reload reloads the Obsidian window. It does not affect unsaved data, but will briefly interrupt the current editing state.


Tips

  • Clipboard: Add --copy to any command to copy output.
  • Counts: Add total to list commands to get a count instead of full output.
  • Output formats: Many list commands accept format=json|tsv|csv for structured output.
  • Help: Run obsidian help for an always-up-to-date command list. Run obsidian help <command> for command-specific help.