From f1311ad3dee49216284342333d216ded2459685a Mon Sep 17 00:00:00 2001 From: teknium1 Date: Wed, 25 Feb 2026 20:24:51 -0800 Subject: [PATCH] refactor: update Obsidian vault path handling - Changed the hardcoded vault path to be set via the OBSIDIAN_VAULT_PATH environment variable, with a default fallback. - Updated all relevant commands to utilize the new variable for reading, listing, searching, creating, and appending notes, improving flexibility and usability. --- skills/note-taking/obsidian/SKILL.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/skills/note-taking/obsidian/SKILL.md b/skills/note-taking/obsidian/SKILL.md index 7f5258bc..0c557dd9 100644 --- a/skills/note-taking/obsidian/SKILL.md +++ b/skills/note-taking/obsidian/SKILL.md @@ -5,40 +5,48 @@ description: Read, search, and create notes in the Obsidian vault. # Obsidian Vault -**Location:** `/home/teknium/Documents/Primary Vault` +**Location:** Set via `OBSIDIAN_VAULT_PATH` environment variable (e.g. in `~/.hermes/.env`). -Note: Path contains a space - always quote it. +If unset, defaults to `~/Documents/Obsidian Vault`. + +Note: Vault paths may contain spaces - always quote them. ## Read a note ```bash -cat "/home/teknium/Documents/Primary Vault/Note Name.md" +VAULT="${OBSIDIAN_VAULT_PATH:-$HOME/Documents/Obsidian Vault}" +cat "$VAULT/Note Name.md" ``` ## List notes ```bash +VAULT="${OBSIDIAN_VAULT_PATH:-$HOME/Documents/Obsidian Vault}" + # All notes -find "/home/teknium/Documents/Primary Vault" -name "*.md" -type f +find "$VAULT" -name "*.md" -type f # In a specific folder -ls "/home/teknium/Documents/Primary Vault/AI Research/" +ls "$VAULT/Subfolder/" ``` ## Search ```bash +VAULT="${OBSIDIAN_VAULT_PATH:-$HOME/Documents/Obsidian Vault}" + # By filename -find "/home/teknium/Documents/Primary Vault" -name "*.md" -iname "*keyword*" +find "$VAULT" -name "*.md" -iname "*keyword*" # By content -grep -rli "keyword" "/home/teknium/Documents/Primary Vault" --include="*.md" +grep -rli "keyword" "$VAULT" --include="*.md" ``` ## Create a note ```bash -cat > "/home/teknium/Documents/Primary Vault/New Note.md" << 'ENDNOTE' +VAULT="${OBSIDIAN_VAULT_PATH:-$HOME/Documents/Obsidian Vault}" +cat > "$VAULT/New Note.md" << 'ENDNOTE' # Title Content here. @@ -48,8 +56,9 @@ ENDNOTE ## Append to a note ```bash +VAULT="${OBSIDIAN_VAULT_PATH:-$HOME/Documents/Obsidian Vault}" echo " -New content here." >> "/home/teknium/Documents/Primary Vault/Existing Note.md" +New content here." >> "$VAULT/Existing Note.md" ``` ## Wikilinks