Obsidian
Manage Obsidian vaults via direct markdown file access and the obsidian-cli tool.
Obsidian vaults are plain markdown files — most operations work without any special CLI.
Prerequisites
Option 1: Direct file access (no install needed)
Obsidian vaults are directories of .md files. Read/write them directly with Bash.
Option 2: obsidian-cli for richer operations:
npm install -g obsidian-cli
Or using the community obsidian-export tool:
cargo install obsidian-export
Configure vault path:
export OBSIDIAN_VAULT="$HOME/Documents/ObsidianVault"
Add to ~/.zshrc or ~/.bashrc for persistence.
Commands
Direct File Operations (no CLI needed)
| Operation | Command |
|---|---|
| List all notes | find "$OBSIDIAN_VAULT" -name "*.md" -type f |
| Search note content | grep -r "<query>" "$OBSIDIAN_VAULT" --include="*.md" -l |
| Read a note | cat "$OBSIDIAN_VAULT/<Note Name>.md" |
| Create a note | Write to "$OBSIDIAN_VAULT/<Note Name>.md" |
| Append to note | echo "\n<content>" >> "$OBSIDIAN_VAULT/<Note Name>.md" |
| List by folder | ls "$OBSIDIAN_VAULT/<Folder>/" |
Wikilinks (Obsidian's link format)
[[Note Name]] ← Link to another note
[[Note Name|Display Text]] ← Link with custom text
[[Note Name#Heading]] ← Link to a heading
Frontmatter (YAML metadata)
---
tags: [project, meeting]
date: 2026-03-21
aliases: [alternative name]
---
Daily Notes
# Create or open today's daily note
TODAY=$(date +%Y-%m-%d)
NOTE_PATH="$OBSIDIAN_VAULT/Daily Notes/$TODAY.md"
Usage Examples
Create a new note with frontmatter:
cat > "$OBSIDIAN_VAULT/Projects/New Idea.md" << 'EOF'
---
tags: [idea, project]
date: 2026-03-21
---
# New Idea
## Summary
Brief description here.
## Links
- [[Related Note]]
EOF
Search vault for a topic:
grep -r "machine learning" "$OBSIDIAN_VAULT" --include="*.md" -l
Append to an existing note:
echo "\n\n## Update 2026-03-21\nNew information here." >> "$OBSIDIAN_VAULT/Projects/New Idea.md"
Find all notes tagged with "meeting":
grep -r "tags:.*meeting" "$OBSIDIAN_VAULT" --include="*.md" -l
List all notes in a folder:
ls "$OBSIDIAN_VAULT/Projects/"
Rules
- Always check that
OBSIDIAN_VAULTis set:[ -z "$OBSIDIAN_VAULT" ] && echo "Not configured" - If not set, ask the user for their vault path and suggest adding it to
~/.zshrc - Prefer direct file access over CLI tools for simple read/write operations
- When creating notes, always use proper Markdown formatting with YAML frontmatter for tags/metadata
- When reading long notes (> 100 lines), display only the first 50 lines and save full content to
workspace/ - Use Obsidian wikilink syntax
[[Note Name]]for internal links, not regular markdown links - Preserve existing frontmatter when appending to notes — read the file first
- File names should match Obsidian conventions: avoid special characters except
-and_ - Keep responses concise: confirm file path and action in 1-2 lines