Skip to content

Instantly share code, notes, and snippets.

@emdashcodes
Last active May 26, 2026 21:43
Show Gist options
  • Select an option

  • Save emdashcodes/284921a3bace2393be5f0b67d6b43547 to your computer and use it in GitHub Desktop.

Select an option

Save emdashcodes/284921a3bace2393be5f0b67d6b43547 to your computer and use it in GitHub Desktop.
Slash command: open a Grimoire file in Obsidian via the Advanced URI plugin

Open a file in Obsidian.

If $ARGUMENTS is provided, open that file. Otherwise, look back through the conversation for the most recently referenced vault file path (e.g. from a Read, Write, or Edit tool call) and open that. If multiple files were created or edited in the same operation, open all of them. If no file can be found, just open the vault.

Use the Advanced URI plugin: open "obsidian://adv-uri?vault=YOUR_VAULT&filepath=<relative-path>&openmode=tab" where <relative-path> is the path relative to your vault root, including the .md extension. URL-encode spaces as %20.

When opening multiple files, issue separate open commands for each file. They will each open in a new tab.

If opening the vault with no file: open "obsidian://open?vault=YOUR_VAULT".

Open a file in Obsidian (Grimoire vault).

If $ARGUMENTS is provided, open that file. Otherwise, look back through the conversation for the most recently referenced Grimoire file path (e.g. from a Read, Write, or Edit tool call targeting ~/Grimoire/) and open that. If multiple files were created or edited in the same operation, open all of them. If no file can be found, just open the vault.

Use the Advanced URI plugin: open "obsidian://adv-uri?vault=Grimoire&filepath=<relative-path>&openmode=tab" where <relative-path> is the path relative to ~/Grimoire, including the .md extension. URL-encode spaces as %20.

When opening multiple files, issue separate open commands for each file — they will each open in a new tab.

If opening the vault with no file: open "obsidian://open?vault=Grimoire".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment