Can I open Obsidian from command line like VSCode?

Open a folder as a Vault from command line (terminal, in Mac)

It would be really nice if I could open a folder in Mac through terminal. Obsidian may consider that as a Vault. I know the plugins/settings would not be the same. But I am happy to live with that given the fact that I have gotten so much used to the Obsidian’s simplified Markdown editing. Just want that when I want, in a specific folder, that’s all the ask is.

Can someone please help if there’s already a way to do this please?


or similar… ?

I’m not sure if you can create a vault (“open folder as vault”) with URIs, but you can use Obsidian URIs for a lot of things.

For example, this opens the +dashboard note in the tree vault:

open "obsidian://open?vault=tree&file=+dashboard"

This opens a search for weather in the tree vault:

open "obsidian://search?vault=tree&query=weather"

…and so on. :grinning:

Do you want a command for opening the Obsidian application at a certain folder or do you want to edit with a terminal text editor like vim? One benefit of Obsidian’s approach to files (that is, using regular markdown files) is that you can edit them with any text editor.

1 Like

The only way to open Obsidian from the command line is with a URI as @ariehen describes. You can only open folders in Obsidian that are already vaults (or in a vault); there is a feature request to allow opening anything: Add ability to use Obsidian as a markdown editor on files outside vault


Yes, you can. I run Linux and installed it via flatpak. I wanted to set up a hotkey to launch Obsidian that way but you still need the cli command to launch it. So I went into the programs menu and right-clicked the launcher to put a desktop shortcut on my desktop, then I opened the shortcut in a text editor to find the command to launch it. I then copied the command and pasted it into my hotkey command, and also tested it out in the command line.

ON my system at least the command is: /usr/bin/flatpak run --branch=stable --arch=x86_64 --file-forwarding md.obsidian.Obsidian @@u %U @@

And to just bring the app to the foreground, open obsidian:// (if on Mac)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.