Obsidian CLI
Thin adapter: route to the official CLI executable and let its help command supply command details. Do not duplicate CLI docs here.
When to use
- User explicitly asks for Obsidian CLI, or needs capabilities that
fs_*/js_evaldo not cover (Obsidian semantics: backlinks, frontmatter properties, daily notes, command palette, plugin reload, link graph, tasks/tags, file history, etc.). - Otherwise prefer native tools (
bash,fs_write,fs_edit, …). Do not round-trip throughterminal_commandfor simple vault file work —bashalready covers it.
Workflow
- Resolve executable (first use in the conversation): prefer the real CLI binary over the app launcher. On macOS, first check
/Applications/Obsidian.app/Contents/MacOS/obsidian-cli; if executable, use that absolute path for all later commands. Otherwise usecommand -v obsidian. If the resolved path is/Applications/Obsidian.app/Contents/MacOS/obsidian, treat it as invalid because it is the app executable. - Probe: run
<resolved-cli> version. - Discover: run
<resolved-cli> helpor<resolved-cli> help <command>— CLI documents parameters; read on demand. - Execute: run
<resolved-cli> <subcommand> …. Addformat=jsonwhen you need structured output to parse.
Rules:
- Never launch the interactive TUI (do not run the resolved CLI with no subcommand).
- Do not use
/Applications/Obsidian.app/Contents/MacOS/obsidianas the CLI on macOS; that is the app executable, not the preferred CLI binary. - Mutating CLI commands may require user approval like any other shell command.
- Desktop only (
terminal_commandis not available on mobile).
Probe failure
If <resolved-cli> version fails (command not found or CLI error), tell the user to enable Settings → General → Command line interface, then retry. Do not guess command syntax — use <resolved-cli> help after probe succeeds.