Open folders as vaults from the CLI

Use case or problem

Open folders via CLI that do not contain .obsidian folders in them or are not yet registered in ./config/obsidian/obsidian.json as a vault ( These are folders not opened via the GUI greeting screen )

**this also applies to opening folders via CLI in general

Proposed solution

In order to open a vault using uri callbacks ( Which is currently broken in Linux, and does not function correctly ) you must use xdg-open to get the callback to behave correctly.

You also need to have the vault defined in ./config/obsidian/obsidian.json with the vault name, vault path, a random ID, and a unix timestamp.

these are all you need to be able to open a vault via uri callbacks. I think it would be a great idea and help people if there was an implementation of a simple command like ā€˜obsidian ā€œ/path/to/folderā€ā€™ to initialize and open a vault. Otherwise, it’s almost undocumented and impossible to get to work… and when you do, it has to be a vault that was already opened via the GUI…

Current workaround (optional)

using xdg-open to get callback uri to work

Related feature requests (optional)

I have seen many people post asking for help with this. I also recently needed the feature for a project.

Three FRs that look similar and could probably be merged into one or two:

https://forum.obsidian.md/t/open-folder-as-a-vault-like-vs-code-via-file-manager-and-terminal/46435/

https://forum.obsidian.md/t/open-a-folder-directory-as-an-obsidian-vault-even-though-it-may-or-may-not-be-a-vault-already/84814

I’ll have a good read-through later when I’m at my desk to see if they are all indeed asking for the same thing or not.

Thank you for replying and showing attention to these requests.

Just following up on this, had someone in the discord with a project and requesting this feature.

Thank you for your time.

Related issue: Open vault from command line using path not name or id

Consolidated into