Skip to content

Instantly share code, notes, and snippets.

@joechrysler
Created February 16, 2026 14:29
Show Gist options
  • Select an option

  • Save joechrysler/e28691b81213077361d0878dc09d620d to your computer and use it in GitHub Desktop.

Select an option

Save joechrysler/e28691b81213077361d0878dc09d620d to your computer and use it in GitHub Desktop.
open-obsidian-vault
# Alias: alias ov='open-obsidian-vault'
#!/usr/bin/env zsh
if [[ -z "$PROJECT_ROOT" ]]; then
echo "Error: \$PROJECT_ROOT is not set. Are you in a direnv-managed project?" >&2
exit 1
fi
vault_dir=$(find "$PROJECT_ROOT" -maxdepth 3 -name ".obsidian" -type d 2>/dev/null | head -1)
if [[ -z "$vault_dir" ]]; then
echo "Error: No Obsidian vault found under $PROJECT_ROOT" >&2
exit 1
fi
vault_path=$(dirname "$vault_dir")
open "obsidian://open?path=${vault_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment