Created
February 16, 2026 14:29
-
-
Save joechrysler/e28691b81213077361d0878dc09d620d to your computer and use it in GitHub Desktop.
open-obsidian-vault
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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