Obsidian - CLI Integration Ideas ๐ฅ๏ธ¶
Overview - Obsidian Research ๐ชจ
Related Notes¶
- Obsidian - MCP Playwright Automation with Claude ๐ค๐ญ - MCP-based vault automation (complementary approach)
- Obsidian - TODO Automation Ideas with MCP ๐คโ - TODO-specific automation ideas
- ONYX - Obsidian Notes Assistant Overview๐ฟ - ONYX assistant (major integration target)
- The Big One 2026โข๏ธ - Startup context for prioritization
Overview¶
Obsidian released its CLI in v1.12 (February 2026) โ a client-server interface exposing 100+ commands covering search, notes, tags, tasks, templates, daily notes, bookmarks, and more. The CLI queries Obsidian's pre-built search index, making it dramatically faster than file-scanning approaches (~60x for large vaults).
Key constraint: Obsidian desktop must be running โ no headless/daemon mode. CLI automation only works on machines where Obsidian is open.
Key capabilities:
- obsidian search โ full-text and tag-filtered search against the index
- obsidian links โ backlinks, orphans, broken link detection
- obsidian tags โ list/search all vault tags
- obsidian tasks โ query tasks by status, path, content
- obsidian daily โ open/append to daily notes
- obsidian templates โ apply templates programmatically
- obsidian bookmarks โ manage bookmark groups
- obsidian create โ create notes with content
Integration Ideas¶
Idea 1: Claude Code as a Vault-Aware Agent¶
What: Use obsidian search, obsidian tags, and obsidian links in Claude Code sessions instead of raw Grep/Glob file scanning.
Why: The CLI queries the pre-built search index which understands wiki-links, tags, properties, and backlinks natively. Results are contextually richer than brute-force file scanning.
Concrete uses:
- Before creating a note, run obsidian search query="topic" to check for duplicates
- obsidian links to audit backlinks before renaming a note
- obsidian tags list to see all tags for consistent tagging
- obsidian search with tag filters to find related notes for cross-linking
- Could add a Claude Code hook (PreToolUse) that auto-queries the vault index when creating/editing notes
Idea 2: Quick Capture from Terminal¶
What: Shell aliases/functions for instant note capture without leaving the terminal.
Examples:
# Append a task to today's daily note
obsidian daily append "- [ ] Call the vet about Goose"
# Create a quick research note
obsidian create name="Research - New Topic" content="..."
# Open today's daily note
obsidian daily open
Why: Running 4-8 Claude Code sessions simultaneously means constant context-switching. Quick capture aliases in setup-macos (like todo "task text" or note "title") eliminate the need to switch to Obsidian for quick captures.
Idea 3: ONYX Tag Processor Enhancement¶
What: Replace ONYX's file-scanning approach for #onyx-* tag processing with obsidian search tag:#onyx-research (and similar for #onyx-meeting, #onyx-remind).
Caveat: ONYX runs on the Mac Mini server via Docker. Two options: 1. Hybrid approach โ ONYX uses CLI when running on a machine with Obsidian open (local dev), falls back to file scanning on the server 2. Remote CLI โ If Obsidian ever adds network/headless mode, ONYX could call the CLI remotely
Immediate win: During local ONYX development/testing, use CLI for faster iteration.
Idea 4: Habit Analytics via CLI Tasks¶
What: Use obsidian tasks to query habit completion across daily notes instead of ONYX's current 91-day file scanning approach.
# Find all incomplete habits
obsidian tasks search query="Daily Habits" status=incomplete
# Get habit completion data for analytics
obsidian search query="- [x]" path:TODO/Daily limit=90
Why: ONYX's habit analytics processor currently reads ~90 files sequentially. The CLI search index could return this data in <1 second, feeding results into the existing analytics pipeline for faster weekly reports.
Idea 5: Template Application from CLI¶
What: Apply vault templates programmatically: obsidian templates apply template="TEMPLATE - Daily TODO" target="03-01-2026 (Sun) ๐.md".
Use cases:
- Batch-create daily TODOs for the next week/month ahead of time
- Script that generates meeting notes from calendar events using the Meeting template
- Auto-apply Research template when ONYX creates #onyx-research notes
Why: Currently templates require manual Cmd+T or Templater hotkeys in the GUI. CLI application enables truly autonomous note creation with proper template structure.
Idea 6: Orphan & Link Health Auditing¶
What: Periodic vault health checks using CLI graph/link commands.
# Find orphaned notes (no incoming links)
obsidian links orphans
# Find broken links
obsidian links broken
# Audit a specific note's connections
obsidian links backlinks path="Overview - Business Research ๐ผ๐ฌ.md"
Why: The vault relies heavily on wiki-links for navigation. Broken or orphaned notes degrade the knowledge graph. Could run as a weekly ONYX processor or a Claude Code hook that checks link health after edits.
Idea 7: Enhanced GitHub Pages Pipeline¶
What: Replace the deploy workflow's grep-based #publish-me filtering with obsidian tags search tag:#publish-me.
Caveat: CI runs on GitHub Actions (no Obsidian desktop). Workaround:
1. Run the CLI locally to generate a manifest of publishable files
2. Commit the manifest, CI reads it instead of scanning
3. Pre-build step: obsidian search tag:#publish-me --format=paths > .publish-manifest.txt
Why: More reliable than regex-based tag detection โ automatically handles edge cases like tags in code blocks.
Idea 8: Smart Daily Note Workflow¶
What: A daily shell command that orchestrates the full morning routine.
#!/bin/bash
# morning-routine.sh
obsidian daily open # Open today's note
obsidian search query="tag:#onyx-remind" | process_reminders # Check reminders
obsidian tasks search status=incomplete path:TODO | show_carryover # Yesterday's incomplete tasks
Why: Combines several manual steps (open daily note, check for reminders, review yesterday's leftovers) into one command. Could be a setup-macos alias like morning.
Idea 9: MCP Server Wrapping the CLI (Highest Leverage)¶
What: Build an MCP server that wraps Obsidian CLI commands, giving Claude Code and ONYX structured tool access to the vault.
Tools the MCP server would expose:
- vault_search(query, tags, path) โ structured search with filters
- create_note(name, template, content, tags) โ create with template + tags
- get_backlinks(note) โ check what links to a note
- daily_append(text) โ add to today's note
- list_tags() โ get all vault tags for consistency
Why: ONYX Phase 4 already plans MCP integration. An Obsidian CLI MCP server would be the perfect bridge โ Claude Code and ONYX both get structured vault access through the same interface. This is the highest-leverage idea because it standardizes all vault interactions into a single protocol.
Idea 10: Bookmark-Driven Project Dashboards¶
What: Use obsidian bookmarks to create quick-access project groups, queryable from CLI.
# Bookmark active project notes
obsidian bookmarks add "The Big One 2026โข๏ธ"
# Quick project context pull
obsidian bookmarks list group="Active Projects"
Why: When switching between Claude Code sessions for different projects, a quick bookmark query gives instant context on relevant notes.
Priority Ranking¶
| Priority | Idea | Effort | Impact |
|---|---|---|---|
| 1 | MCP Server wrapping CLI (Idea 9) | Medium | Very High โ universal integration layer |
| 2 | Quick Capture aliases (Idea 2) | Low | High โ daily time savings |
| 3 | Claude Code vault-aware search (Idea 1) | Low | High โ better note discovery |
| 4 | Orphan/Link auditing (Idea 6) | Low | Medium โ vault health |
| 5 | Smart Daily Note workflow (Idea 8) | Low | Medium โ morning routine |
| 6 | Template application (Idea 5) | Medium | Medium โ batch note creation |
| 7 | Habit analytics via CLI (Idea 4) | Medium | Medium โ faster ONYX processing |
| 8 | ONYX tag processor (Idea 3) | Medium | Medium (limited by server constraint) |
| 9 | GitHub Pages manifest (Idea 7) | Low | Low โ small reliability gain |
| 10 | Bookmark dashboards (Idea 10) | Low | Low โ nice-to-have |
First Steps¶
- Enable the CLI in Obsidian settings (requires Catalyst license, $25)
- Add shell aliases to
setup-macosfor quick capture (todo,note,vsearch) - Start using
obsidian searchin Claude Code sessions โ just bash commands, no infrastructure needed - Spec out the MCP server โ this becomes the foundation for everything else
Architecture Considerations¶
Obsidian desktop requirement is the primary constraint. This limits CLI use to: - Dan's personal machines (MacBook, iMac) where Obsidian is open - Cannot run in CI/CD (GitHub Actions), Docker containers, or the Mac Mini server (unless Obsidian is running there)
Hybrid strategy: Build integrations that gracefully fall back to file-based operations when the CLI isn't available. This is especially important for ONYX, which runs on the Mac Mini server.
MCP as the abstraction layer: The MCP server (Idea 9) is the natural place to implement this fallback logic โ expose the same tools regardless of whether the backend uses CLI or file scanning.