Problem Description
TL;DR: The Obsidian URI (opening obsidian://) does not provide any way for the user to open an obsidian vault, if that vault has not been opened / cached before.
Example
Given a the vault Testvault at /path/to/testvault, if you have previously opened this vault (specifically, if it is recorded in the obsidian.json file) you can open this vault using these commands URIs:
By name
obsidian://open?vault=Testvault
or with the path:
obsidian://open?path=/path/to/testvault
The bug / problem occurs when trying to run the bottom command, without previouly having opened this vault. Obsidian reports the error:
Vault not found.
Unable to find a vault for the URL obsidian://open?path=/path/to/testvault
Use Cases
Resolving this issue would drastically improve in a few scenarios. For reference, opening a (uncached) vault using the GUI takes 4 Steps:
- Open obsidian
- If there is a vault open pressing
Open Folder as vault - Navigating to the vault on the file system
- Opening it
This change would allow for automating this entire chain. You might create a script to open certain vaults for you automatically or reopen old (uncached) vaults.
Vaults might suddenly get removed from your vault list if Obsidian has been opened without the file location of the vault being accessible (Vault might be on a USB stick, a remote server, encrypted storage). For each time this happens, you need to redo the entire process above. Depending on file system depth, this can take a minute.
If you have a remote vault and your internet sucks, obsidian might auto close the vault every few minutes, forcing you to reopen.
Proposed solution
Allow obsidian://open?path=... to open a vault even if it has never been opened before by automatically registering it in obsidian.json.
Expand the URI functionality of the path attribute in the open action (obsidian://open?path=...) to allow for uncached / unopened vaults. Obsidian should check if a folder location / vault has not been recorded in the obsidian.json file. If so it should append it there and “discover” this new vault.
(I am not sure wether it should check if the folder location actually contains a .obsidian file. If the folder does not contain a .obisidian file, it may initialize a entirely new vault.)
The URI schema does not have to change for this.
Current workaround (optional)
Using a script to automatically edit the obsidian.json file. However the implementation is unstable since it breaks when e.g. the obsidian.json format changes. I have not personally tested this example code.
Related feature requests
In response to this old feature request.
I opened a new feature request because of:
