New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@capyup/pi-obsidian

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capyup/pi-obsidian

pi extension that wraps the Obsidian CLI as typed tools — read, list, search, outline, create, append, open, backlinks, tags, and daily-append against the active vault.

latest
Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
8
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

pi-obsidian

A pi extension that wraps the Obsidian CLI and exposes a typed family of obsidian_* tools the agent can call directly. Lets pi read, list, search, outline, create, append, and open notes in your active Obsidian vault — without dropping into shell.

Why

The raw obsidian CLI requires a vault=<id> prefix on every call (see your obsidian.json config). That id is opaque, the CLI has dozens of subcommands, and the agent has to remember argument shapes across turns. This extension does three things:

  • Auto-resolves the active vault from obsidian.json (or PI_OBSIDIAN_VAULT_ID override).
  • Surfaces a curated subset of CLI commands as typed tools — clean parameter schemas, no string-glue.
  • Tells the model when to use them: each tool has a promptSnippet and promptGuidelines so pi prefers obsidian_read over the generic file-read tool when the file lives inside an Obsidian vault.

Tools

ToolWhat it doesMaps to
obsidian_readRead a note by vault-relative pathobsidian read path=…
obsidian_listList files in a folder, optionally filtered by extensionobsidian files folder=… ext=…
obsidian_searchGrep-style content search with line context, optional folder scopeobsidian search:context query=… path=… limit=…
obsidian_outlineHeading tree of a noteobsidian outline path=…
obsidian_createCreate a new note (optional content / overwrite / open)obsidian create path=… content=…
obsidian_appendAppend content to a noteobsidian append path=… content=…
obsidian_prependPrepend content (after frontmatter)obsidian prepend path=… content=…
obsidian_openOpen a note in the Obsidian app, optional new tabobsidian open path=…
obsidian_backlinksList backlinks to a noteobsidian backlinks path=…
obsidian_tagsList vault tags or per-note tags, optional countsobsidian tags …
obsidian_daily_appendAppend to today's daily noteobsidian daily:append content=…

Install

pi install npm:@capyup/pi-obsidian             # from npm (recommended)
pi install git:github.com/capyup/pi-obsidian   # from git
pi install /path/to/pi-obsidian                # from local checkout (dev)

Prerequisites

  • Obsidian 1.12+ with the CLI enabled: Settings → General → Command line interface
  • Obsidian app must be running with at least one vault open
  • macOS: Obsidian binary at /Applications/Obsidian.app/Contents/MacOS/obsidian (auto-detected)
  • Linux / Windows: obsidian must be on PATH, or set PI_OBSIDIAN_BIN

Vault selection

The extension auto-detects the active vault by reading obsidian.json:

PlatformPath
macOS~/Library/Application Support/obsidian/obsidian.json
Linux~/.config/obsidian/obsidian.json
Windows%APPDATA%/obsidian/obsidian.json

Selection logic:

  • PI_OBSIDIAN_VAULT_ID env var, if set
  • The vault marked "open": true in obsidian.json
  • Most recently opened vault (highest ts)

Environment variables

VarEffect
PI_OBSIDIAN_VAULT_IDForce a specific vault id
PI_OBSIDIAN_VAULT_PATHOptional companion to the above (for diagnostics)
PI_OBSIDIAN_BINOverride the path to the obsidian binary

Examples (what pi does for you)

pi> read ops/index.md from my vault
agent calls obsidian_read { path: "ops/index.md" } → returns markdown

pi> what notes mention "tailscale exit node"?
agent calls obsidian_search { query: "tailscale exit node" } → grep-style hits

pi> log this decision into today's daily note
agent calls obsidian_daily_append { content: "- decided to ..." }

pi> open the new playbook tab in Obsidian
agent calls obsidian_open { path: "ops/tailscale/tailscale-add-windows.md", newtab: true }

Development

git clone https://github.com/capyup/pi-obsidian
cd pi-obsidian
npm install
npm run typecheck         # tsc --noEmit
npm run pack:check        # npm pack --dry-run (verify files glob)

Limitations / future

  • Currently does not expose properties:* (frontmatter property) tools — TODO.
  • Does not expose command id=… (Obsidian command palette executor) — could add if useful.
  • Multi-vault: currently picks one active vault per call. If you want explicit per-call vault selection, use PI_OBSIDIAN_VAULT_ID.

License

MIT

Keywords

pi-package

FAQs

Package last updated on 11 May 2026

Related posts