MontréalCrépusculeCiel clair
David Paquet Pitts/Field Notes
Field noteNOV 15, 2025

4 min read

obsidian-cli, the boring tool every session reaches for

I gave my coding agents a JSON-only CLI to read and write my Obsidian vault. It was a one-afternoon utility with a single user. It quietly became the thing every session reaches for.

Project
obsidian-cli
Curated by
David Paquet Pitts
Written & maintained by
his AI agent · Claude
Where it landed

Still in daily use — the rare one that stuck. Runs in nearly every coding session. One feature (diagram generation) never earned its place and sits unused.

The build and the opinions are David's. The words are the agent's, drafted from his build records and kept current; he edits when he disagrees.

The itch

By November 2025 I was running coding agents against my own notes as much as against code. My working knowledge — research, project docs, decisions — lives in an Obsidian vault, and I wanted the agent to treat it as a first-class read/write surface: search it, pull a note, append a section, fix some frontmatter, all inside a session.

The Local REST API plugin already exposed the vault over HTTP, so the raw capability was there. But it's built for a human's convenience, not an agent's. Responses vary in shape, there's no structured search, and "edit the Results section of this note" turns into fetch-the-whole-file, mangle-a-string, write-it-back. An agent driving that by hand is slow and gets it wrong. I wanted the vault to feel like a set of typed operations, not a webpage to scrape.

What I built

A CLI that does one thing: give an agent surgical, structured access to a vault. Installed as the obsidian command, every subcommand returns JSON and nothing else, so there's nothing to parse loosely.

obsidian-cli
TypeScript · Bun · MIT
Search
Hybrid: fast Omnisearch plugin path, REST API fallback when it's not there.
Surgical edits
PATCH targeted by heading or line number — append, prepend, replace, or delete a section, without touching the rest of the file.
Frontmatter
Get / set / merge / delete YAML fields; title and timestamps kept current automatically.
Big content
--from-file and --stdin, because shell argument limits are the real ceiling on agent-authored text.
Shape
JSON on every command. Standalone binary, cross-compiled with Bun, no runtime deps.

The design bet was that agents want narrow, composable operations they can chain — the Unix posture, aimed at a model instead of a person. The clearest expression of that is the edit path:

Editing one section of a note
obsidian patch note.md--heading "Results"--replacecontent via --from-filerest of the file untouched

What happened to it

I built it in an afternoon and expected to touch it occasionally. Instead it became the single most-run tool I've made. Nearly every coding session I open uses it at least once — to search a note, drop a finding, update some metadata. The vault it feeds is now past a thousand notes and well over a hundred megabytes, most of it written through this CLI rather than by hand.

The arc
  1. Nov 15, 2025First commit: REST + Omnisearch, file/stdin input, auto timestamps.
  2. Dec 17, 2025v0.2.0. Also shipped Excalidraw diagram generation with auto-layout — a DSL that compiled to Excalidraw scenes.
  3. Jan 24, 2026Added knowledge-management commands: inbox, move, stale, stats.
  4. Jul 2026Still the tool every session reaches for. The diagram feature has sat unused for months.

I'll be honest about the one part that didn't work. The Excalidraw generation was a real feature — a small DSL that laid out and compiled to Excalidraw diagrams — and it was a good experiment. I almost never use it. The demand I imagined ("the agent will draw diagrams into my notes") wasn't a demand I actually had, and no amount of it being built well changed that.

The lesson I keep relearning: the tool I was least precious about outlived the ones I designed carefully, because it did one boring thing an agent needed every single day. Usefulness isn't in the ambition of the feature — it's in how often the plain one runs.

David Paquet Pitts
Head of Delivery & Solutions at Botpress