Open folder as a vault like VS Code (via file manager and terminal)

Problem

Right now to open a vault you need to: press the button “Open another vault” (left inferior corner), then “Open folder as a vault”, navigate to the folder path and select the folder (4 steps).

Solution

It would be much easier navigate to your folder path with the file manager app or the terminal and open it:

  1. just click right button and select open with Obsidian
  2. open via terminal like Visual Studio Code code . (open the current directory)
5 Likes

Did you find any solution?

This is kind of how I want to use Obsidian also… as a markdown focused view on top of my repositories. This would go hand in hand with needing to blacklist and/or whitelist directories from obsidian’s content graph & index.

Have another issue about it here: Actually excluding paths from Obsidian entirely - #3 by martaver

hi it can help you

Oh thanks, I’m on Linux with KDE and I can’t do that (right click on the Obsidian icon and see the vaults).

But I found a better way using a similar method.

Just create a bookmark in your browser with the protocol Obsidian (obsidian://) on the directory path like user V.

You can save the link as a bookmark by typing in the name and url or by Ctrl+D once it is open. In this case:

  • the name is: User V
  • the url: obsidian:///Knowledge/PKM/User-V/

Once done, just click on the link and it will open the Obsidian vault. This is not a way to use the terminal, but you can save it and use the (obsidian://) protocol.

From terminal you can open it with:

$ xdg-open obsidian:///0/Knowledge/PKM/User-V/
# or
$ firefox obsidian:///0/Knowledge/PKM/User-V/

but I get some warnings with electron and gtk

The method with the URL generally works, but not in my case;
I use Obsidian inside of a container and therefore need to start it with the console parameter --no-sandbox, therefore a command like obsidian [config parameters] --vault ~/Documents/obs-vault would be nice to have

I would like when I create a vault to automatically create a file inside the folder that launches obsidian with the vault itself.
Similar to when in Visual Studio I open a sln.

It would take a command line argument to open the vault in the current folder, so I could create a link in the root folder of a vault, to open it. I was able to create a shortcut (although it doesn’t work from cmd) with obsidian:///full_path_folder but I would have to create a new (different) one for each vault and I would have to modify it if I moved it.

Hey hi, you can right click the folder and select open with obsidian or use a terminal command like code similar to Visual Studio Code.

The simplest solution I found - Mac only, sorry - was Hookmark; select the folder, H, select hook to new, select obsidian, done.

Or applescript, which I use with BetterTouchTool but would work with Alfred, Raycast, etc:


tell application "Finder"
	
	if selection is not {} then -- Check if something is selected
		set selectedFolder to item 1 of (get selection) as alias -- Get the selected item
		set folderName to name of selectedFolder
		-- display dialog folderName -- Display the folder name
	else
		display dialog "No folder is selected."
	end if
	
end tell

do shell script "open  obsidian://open?vault=" & folderName