Install
$ agentstack add skill-scott2b-claude-skills-obsidian-api ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Obsidian REST API (Advanced Features)
⚠️ Note: For standard vault operations, use the obsidian skill (faster, simpler).
This skill provides API-only features via the Obsidian Local REST API that require Obsidian's parser and index.
Prerequisites
REQUIRED: Install and configure the Obsidian Local REST API community plugin:
- In Obsidian: Settings → Community Plugins → Browse
- Search for "Local REST API" and install
- Enable the plugin
- Copy the API key from plugin settings
- Note the server URL (default: https://127.0.0.1:27124)
No Python dependencies required - uses only Python standard library (urllib, ssl, json).
Environment Variables:
export OBSIDIAN_API_KEY=your_api_key_here
export OBSIDIAN_HOST=https://127.0.0.1:27124 # Optional, defaults to this
Store these in a .env file for persistence:
# .env or .env.obsidian
export OBSIDIAN_API_KEY=your_api_key_here
export OBSIDIAN_HOST=https://127.0.0.1:27124
Then load with: source .env
When to Use This Skill
Use ONLY for these API-specific features:
- Dataview queries - Complex DQL aggregation queries
- Periodic notes - Daily/weekly/monthly note management
- Patch operations - Insert content after specific heading or block reference
- JSONLogic queries - Advanced metadata filtering
Do NOT use for:
- Search - use
obsidianskill (7x faster with ripgrep) - Read/Write files - use
obsidianskill (50x faster, direct filesystem) - List files - use
obsidianskill - Append content - use
obsidianskill - Delete files - use
obsidianskill
Default to the obsidian skill for all standard vault operations.
Vault Structure Awareness
- Main vault: Root directory contains all notes
- Slipbox: Located at
_Slipbox/within the vault - All paths are relative to vault root
- Directories use trailing slashes:
_Slipbox/,Projects/
Helper Scripts
All operations are performed through Python helper scripts that interact with the Obsidian REST API:
scripts/obsidian_api.py- Core API wrapper (don't call directly)scripts/search_vault.py- Search notes by content or metadatascripts/read_note.py- Read one or more note filesscripts/write_note.py- Create or update notesscripts/append_note.py- Append content to existing notesscripts/patch_note.py- Insert content relative to headings/blocksscripts/list_files.py- List files in vault or directoryscripts/delete_note.py- Delete notes (use with caution)scripts/periodic_notes.py- Get daily/weekly/monthly notesscripts/recent_notes.py- Find recently modified notes
Common Operations
Search the Vault
Search all notes (including slipbox):
python ~/.claude/skills/obsidian/scripts/search_vault.py "search term" --context 100
Search only in slipbox:
python ~/.claude/skills/obsidian/scripts/search_vault.py "search term" --path "_Slipbox/"
Read Notes
Read a single note:
python ~/.claude/skills/obsidian/scripts/read_note.py "Note Title.md"
Read multiple notes:
python ~/.claude/skills/obsidian/scripts/read_note.py "Note 1.md" "Note 2.md" "Note 3.md"
Read from slipbox:
python ~/.claude/skills/obsidian/scripts/read_note.py "_Slipbox/concept.md"
Create or Update Notes
Create a new note:
python ~/.claude/skills/obsidian/scripts/write_note.py "New Note.md" --content "# New Note\n\nContent here"
Create in slipbox:
python ~/.claude/skills/obsidian/scripts/write_note.py "_Slipbox/new-concept.md" --content "# Concept\n\nDetails..."
Append to Notes
Add content to end of note:
python ~/.claude/skills/obsidian/scripts/append_note.py "Daily Note.md" --content "\n## New Section\n\nAdded content"
Insert Content at Specific Location
Insert after a heading:
python ~/.claude/skills/obsidian/scripts/patch_note.py "Note.md" \
--content "New content" \
--heading "Section Title"
Insert after a block reference:
python ~/.claude/skills/obsidian/scripts/patch_note.py "Note.md" \
--content "New content" \
--block "block-id"
List Files
List all files in vault:
python ~/.claude/skills/obsidian/scripts/list_files.py
List files in slipbox:
python ~/.claude/skills/obsidian/scripts/list_files.py --path "_Slipbox/"
List specific directory:
python ~/.claude/skills/obsidian/scripts/list_files.py --path "Projects/Active/"
Periodic Notes
Get today's daily note:
python ~/.claude/skills/obsidian/scripts/periodic_notes.py daily
Get this week's weekly note:
python ~/.claude/skills/obsidian/scripts/periodic_notes.py weekly
Get recent daily notes:
python ~/.claude/skills/obsidian/scripts/recent_notes.py daily --limit 7
Delete Notes
Delete a note (prompts for confirmation):
python ~/.claude/skills/obsidian/scripts/delete_note.py "Old Note.md"
Force delete without confirmation:
python ~/.claude/skills/obsidian/scripts/delete_note.py "Old Note.md" --force
Slipbox-Specific Workflows
The skill is aware that _Slipbox/ is special and contains your Zettelkasten/slip-box notes.
Search slipbox for concepts:
python ~/.claude/skills/obsidian/scripts/search_vault.py "emergence" --path "_Slipbox/" --context 200
Create new slipbox note:
python ~/.claude/skills/obsidian/scripts/write_note.py "_Slipbox/202501131045-emergence-in-systems.md" \
--content "# Emergence in Systems\n\nEmergence occurs when...\n\n## References\n- [[complex-systems]]\n- [[self-organization]]"
List all slipbox notes:
python ~/.claude/skills/obsidian/scripts/list_files.py --path "_Slipbox/"
Integration with Other Skills
This skill works well with:
- slipbox-integration - Links slipbox notes into narrative projects
- narrative-inventory - Can read/write inventories to vault
- narrative-maps - Can store spatial maps in vault
- project-indexer - Can maintain project indexes in vault
Best Practices
- Always check environment first - Use
env-managerskill if API key is not set - Use relative paths - All paths are relative to vault root
- Include file extensions - Always use
.mdfor markdown files - Respect slipbox structure - Slipbox notes are in
_Slipbox/ - Search before creating - Check if note exists before creating new ones
- Use descriptive titles - Especially for slipbox notes (e.g.,
202501131045-concept-name.md) - Preserve links - Maintain
[[wikilinks]]when modifying notes - Handle errors gracefully - API may fail if Obsidian is closed
Error Handling
Common issues:
- Connection refused: Obsidian is not running or REST API plugin is disabled
- 401 Unauthorized: OBSIDIANAPIKEY is incorrect or not set
- 404 Not Found: File path doesn't exist in vault
- SSL errors: Set
OBSIDIAN_VERIFY_SSL=falseif using self-signed cert
API Endpoints Reference
For transparency, here are the underlying REST API endpoints used:
| Operation | Endpoint | Method | |-----------|----------|--------| | List vault files | /vault/ | GET | | List directory | /vault/{path}/ | GET | | Read file | /vault/{filepath} | GET | | Create/Update | /vault/{filepath} | POST | | Patch content | /vault/{filepath} | PATCH | | Delete file | /vault/{filepath} | DELETE | | Simple search | /search/simple/ | POST | | Advanced search | /search/ | POST | | Get periodic note | /periodic/{period}/ | GET | | Recent periodic | /periodic/{period}/recent | GET |
All requests require Authorization: Bearer {API_KEY} header.
Security Notes
- API key grants full vault access - treat as sensitive credential
- Store in environment variables, not in code
- Default server uses self-signed SSL certificate
- API only accessible on localhost by default
- No authentication beyond API key
Troubleshooting
- Skill not working: Check if REST API plugin is enabled in Obsidian
- Can't find notes: Verify paths are relative to vault root, not filesystem
- SSL errors: Add
--no-verify-sslflag to scripts if needed - Empty results: Obsidian may need to finish indexing vault
- Changes not visible: Obsidian auto-reloads, but may need manual refresh
Advanced Usage
Complex Searches with JSONLogic
The API supports JSONLogic queries for advanced filtering:
# Example: Find notes modified in last 7 days with tag #important
query = {
"and": [
{">=": [{"var": "mtime"}, 1704672000]},
{"in": ["#important", {"var": "tags"}]}
]
}
See scripts source code for implementation details.
Batch Operations
Read multiple files at once:
python ~/.claude/skills/obsidian/scripts/read_note.py \
"Note1.md" "Note2.md" "Note3.md" \
--format json
Working with Templates
Store templates in vault and copy when creating notes:
# Read template
template=$(python ~/.claude/skills/obsidian/scripts/read_note.py "Templates/Note Template.md")
# Create note from template
python ~/.claude/skills/obsidian/scripts/write_note.py "New Note.md" --content "$template"
Script Output Formats
Most scripts support --format flag:
text(default) - Human-readable outputjson- Machine-readable JSON for scriptingmarkdown- Formatted markdown
Example:
python ~/.claude/skills/obsidian/scripts/search_vault.py "term" --format json | jq
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: scott2b
- Source: scott2b/claude-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.