Open-source agent skill for Obsidian CLI — prevents 13 silent failures


Category: Share & showcase
Tags: cli, ai, automation


If you’re using AI coding agents (Claude Code, Codex, Cursor, etc.) with Obsidian CLI, you may have noticed they sometimes get empty or wrong results — even though the commands “succeed.”

The problem

We ran 57 test scenarios against Obsidian CLI 1.12 and found:

  • 13 silent failures (22.8%) — command exits 0 but returns wrong/empty data
  • 24 material issues (42.1%) — default flags produce inferior output for automation

The worst ones (all reproduced in the Sandbox vault with no plugins):

What you’d type What happens What you should type
tasks todo 0 results (scoped to nonexistent “active file”) tasks all todo
tags counts “No tags found” tags all counts
properties format=json Returns YAML properties format=tsv
create name="x" content="y" Opens Obsidian GUI Add silent flag

These are all default-behavior traps, not syntax errors. The agent thinks it got a valid answer.

We filed a bug report for the underlying issues #111168.

https://forum.obsidian.md/t/cli-tasks-and-tags-silently-return-empty-when-called-from-terminal/111168

The fix

We published a lightweight agent skill that teaches AI agents the correct patterns:

https://github.com/jackal092927/obsidian-official-cli-skills

Install in one line:

# Claude Code (auto-updates)
/plugin marketplace add jackal092927/obsidian-official-cli-skills

# Any agent (Claude Code, Codex, Cursor, 20+ more)
npx skills add jackal092927/obsidian-official-cli-skills

What’s in the skill

  • Correct syntax for 34 CLI commands
  • Warnings for all 13 silent failure gotchas
  • Safety rules (e.g., never run eval, always add silent to create)
  • Error handling patterns (since exit codes can’t be trusted)

Evidence

In

https://github.com/jackal092927/obsidian-official-cli-skills

all findings are backed by raw CLI output captures:

  • HIGH_RISK_REPORT.md
    — 5 most severe issues with reproduction steps
  • reports/ — full stdout captures from test runs

Hoping the scoping defaults get fixed upstream. In the meantime, this skill keeps agents from falling into the traps.

MIT licensed. PRs welcome.

1 Like

Thank you for this skill. Validated against 1.12.1 (Catalyst) with an 18,876-file vault.

Findings: The “silent failures” you documented now show explicit errors (e.g., “Error: No active file” instead of empty results). This is actually better behaviour but your skill guidance is still helpful to avoid the errors.

Tested: search, tags, tasks, create, read, delete — all functional with your documented flags.

Used it to audit 56 broken PDF links from a Zotero migration. Working well. Super fun the CLI. Thanks for doing the leg work.

— Max