Command Line Interface to open folders (and files) in Obsidian from the terminal

Use case or problem

I would like a vault to be able to open from the command line. For example if I didn’t have the vault in a given computer, and it was freshly copied from another place, then the vault isn’t already in the cache or config of Obsidian.

Here are the suggestions I found to open via the command line (this needs the URL for Obsidian application produced in advance, which is not possible in my case).

How to open vault selector from command line on windows 10/11 - Help - Obsidian Forum

Can I open Obsidian from command line like VSCode? - Help - Obsidian Forum

Proposed solution

Ideally be able to open a folder as a blank vault, or as the vault as if it was opened through “File” > “Open vault…” option.

This way Obsidian will be super useful for Markdown documentation management for various scenarios. Right now I use BBEdit, but it doesn’t manage the links well as the Obsidian does.

So please enable a folder to be opened as a Vault using Obsidian.


My findings:
“Library/Application Support/obsidian/obsidian.json” seem to have the entries to the vaults, and if I update it by adding new vault’s location entry (eg: ,"fdc0b3a4e945872e":{"path":"/absolutePathTo/MyNewVault","ts":1720229748200,"open":true}) which I want to open while Obsidian is not open, then I can use the commandline open "obsidian://open?vault=MyNewVault". But drawback here is Obsidian has to be offline while doing this. Moreover I don’t want to meddle with obsidian configuration manually as it may cause many other issues as many would agree.

2 Likes