# /obsidian-cli: Manage notes and debug plugins through the Obsidian CLI

Source: https://trendhub.net/skills/obsidianmd-obsidian-skills/obsidian-cli
Skill folder: https://github.com/obsidianmd/obsidian-skills/tree/main/plugins/obsidian/skills/obsidian-cli
Pack: Obsidian Skills (https://trendhub.net/skills/obsidianmd-obsidian-skills)
Works with: Claude Code (terminal), Claude Code (in session), Codex, npx skills, npx skills (SSH), Gemini CLI, OpenCode

This skill teaches the agent to use the obsidian command that ships with the desktop app. It covers parameter and flag syntax, how files and vaults are targeted, everyday commands for reading, creating, searching and editing notes and tasks, and a reload, error-check and screenshot loop for plugin and theme development, along with several quirks that otherwise cause silent failures.

## When to use it

- You want the agent to search, read or append to notes in your vault
- You need notes renamed or moved without breaking links
- You are developing an Obsidian plugin or theme and want a fast test loop

## How it works

1. **Check the CLI**: The agent runs obsidian help first, explains how to turn the CLI on if it is missing, and never installs the unrelated npm package of a similar name.
2. **Target the right vault and file**: It puts vault= first when needed, uses file= for wikilink-style lookup or path= for exact paths, and asks which vault to use if several exist.
3. **Use app-aware commands**: It renames, moves and deletes through the CLI so Obsidian updates links and uses the trash, and prefers create and append over eval.
4. **Read the output**: Because the CLI exits with status 0 even on failure, it reads the output before reporting success, and writes long or backslash-heavy content straight to files.
5. **Plugin dev loop**: For plugins it turns on console capture, reloads the plugin, checks errors, and verifies with screenshots, DOM queries and console logs.

## What it steers the agent away from

- Moving notes with mv and leaving broken links behind
- Permanently deleting files when the trash would do
- Corrupting LaTeX or Windows paths through escape conversion in content=

## What it can touch

Runs the obsidian command against the open desktop app to read, create, edit, move and delete vault files, set properties, run JavaScript in the app and take screenshots.

## Pairs well with

- `/obsidian-bases`
- `/obsidian-markdown`

## Questions

### Does it work on Windows under WSL?

Yes, but the agent must call Obsidian.com from the Windows install folder, since Obsidian.exe exits without printing output.

### What if the agent runs in a sandbox?

A sandboxed shell may block the CLI's local socket, which shows up as the same error as Obsidian not running.
