Obsidian
Attribution: Sourced from steipete/agent-scripts by Peter Steinberger.
When to Use
- Searching, reading, or writing notes in a local Obsidian vault
- Managing backlinks, Bases, or Canvas files
- Querying vault content while preserving frontmatter and wikilinks
Use this for local Obsidian vault work. An Obsidian vault is a normal folder of Markdown files plus .obsidian/ config.
Sources
- App config:
~/Library/Application Support/obsidian/obsidian.json - Usual local vault path:
~/obsidian(or configured path) - Official CLI:
obsidian(if installed)
Common Operations
Search notes
# Search across all vault notes
rg "search term" ~/obsidian/ -l
rg "search term" ~/obsidian/ -n
# Search with context
rg "search term" ~/obsidian/ -C 3
# Find notes with specific tags
rg "#tag-name" ~/obsidian/ -l
Read note
cat ~/obsidian/path/to/note.md
Create/update note
# Create new note
cat > ~/obsidian/new-note.md <<'EOF'
---
tags: [tag1, tag2]
created: 2025-01-01
---
# Note Title
Content here.
EOF
Find backlinks (notes that link to a note)
rg "\[\[Note Name\]\]" ~/obsidian/ -l
rg "\[.*\]\(path/to/note\.md\)" ~/obsidian/ -l
List all notes
find ~/obsidian -name "*.md" -not -path "*/.obsidian/*"
Notes
- Obsidian uses double-bracket links:
[[Note Name]] - Tags use
#tagin note bodies ortags: [tag]in YAML frontmatter - Never modify
.obsidian/config files unless explicitly asked - Preserve YAML frontmatter format when editing notes