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

Problem Summary/History

I was using this method which I discussed in this forum a while back. That means to create a link to the vault, and the open that vault through the command line whenever possible.

However, it is been sufficient time for me to experience this and now I see the need for the ability to open any folder through the terminal using Obsidian.

I vote for this change +1 any amount of times now. So team, can we prioritise this please? Initial version could just open a folder, create and .obsidian config with default parameters as it likes to help the default environment setup for it. No need of extra config/plugins etc.

What I am after is the ability to super simply look at the Markdown documentation, simplify image attachment through clipboard, have my way of folder naming convention (am happy to do it after opening the folder myself).

Current functionality is that if a given folder was already opened as a vault, then it would work with command

open "obsidian://"`pwd`

But otherwise you would get an error that says "Vault not found.".

Thank you team, for prioritising this!

Note, there seems to be a few threads around this topic. I’m listing them below for the reference:

  1. Can I open Obsidian from command line like VSCode? - Help - Obsidian Forum
    https://forum.obsidian.md/t/can-i-open-obsidian-from-command-line-like-vscode/65042/8

  2. Open folders as vaults from the CLI - Feature archive - Obsidian Forum
    https://forum.obsidian.md/t/open-folders-as-vaults-from-the-cli/89714/2

  3. Open current vault or folder in terminal - Plugins ideas - Obsidian Forum
    https://forum.obsidian.md/t/open-current-vault-or-folder-in-terminal/41818

Suggestion

When Obsidian is opened from the command line, if the given folder structure doesn’t have an already registered vault, just create one, update the registry and open the given folder as a vault.

If there’re any objections to this that say the user may mistakenly send a folder that actually isn’t a vault or something, a prompt to verify asking this is not an existing vault, are you sure you want to open yes/no would do.

In Electron JS, there seem to be a possibility to get this done. Here’re some suggestions from ChatGPT.

Electron Question - ChatGpt.zip (148.7 KB)

1 Like