# Open vault from command line using path not name or id

**URL:** <https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465>\
**Category:** Help\
**Created:** [September 15, 2024, 11:13pm UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465 "2024-09-15T23:13:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksprr](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@ksprr](https://forum.obsidian.md/u/ksprr)\
**Post date:** [September 15, 2024, 11:13pm UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465/1 "2024-09-15T23:13:42Z")

</div>

I want to open a vault using its path. Assume it is located in /mnt/usb/notes (notes contains the .obsidian folder)

It this possible using the URI syntax?

I’ve read [Obsidian URI - Obsidian Help](https://help.obsidian.md/Extending+Obsidian/Obsidian+URI) and various threads, yet all of them only explain how to open a vault by its name or id.

This does not work if the location of the vault is not always accessible, e.g. usb drive or folder on the network. In this case, obsidian ‘forgets’ the vault location on startup and hence the vault cannot be opend using the id or the name when the location is available again.

fyi: obsidian://open?vault=/mnt/usb/notes or obsidian://open?file=/mnt/usb/notes doesn’t work (yes I’ve tried it with propper uri encoding)

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [September 17, 2024, 3:10am UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465/2 "2024-09-17T03:10:19Z")

</div>

I don’t know if this will work for your use case, but saw it mentioned in another topic:

> **[GitHub - Yakitrak/obsidian-cli: Interact with Obsidian in the terminal. Open,...](https://github.com/Yakitrak/obsidian-cli)**
>
> Interact with Obsidian in the terminal. Open, search, create, update, move and delete notes!

Worth a try.

---

<div class="post-metadata">

**Author:** ![ksprr](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/a9adbd/32.png) [@ksprr](https://forum.obsidian.md/u/ksprr)\
**Post date:** [September 22, 2024, 1:06pm UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465/4 "2024-09-22T13:06:19Z")

</div>

Thanks for the hint.

Unfortunately, this project cannot open Obsidian vaults in arbitrary locations. The reason seems to be that Obsidian keeps track of existing vaults in `.config/obsidian/obsidian.json`, and only vaults that exist in this file can be opened via URI. (See ["obs ." to open the current directory · Issue #23 · Yakitrak/obsidian-cli · GitHub](https://github.com/Yakitrak/obsidian-cli/issues/23#issuecomment-1766794741))

The problem is that Obsidian checks at every startup whether the locations of the vaults in `.config/obsidian/obsidian.json` still exist. But if a vault lives on a USB drive or remote location, then it might not be accessible every time Obsidian is started and gets removed. Hence, it is not registered in the `obsidian.json` anymore.

The question is whether this behavior can be modified.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [November 14, 2024, 5:29pm UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465/5 "2024-11-14T17:29:29Z")

</div>

> [@Command Line Interface to open folders (and files) in Obsidian from the terminal](https://forum.obsidian.md/t/command-line-interface-to-open-folders-and-files-in-obsidian-from-the-terminal/860):
>
> A CLI would help to interact with Obsidian from the terminal and integrate with existing processes and tools. Here are a few commands I wish that existed in this command line interface for Obsidian: obs folder opens a folder as vault obs file.md opens a specific file directly obs starred, obs daily, obs random for a direct access to these notes in your default vault Mod-Edit: Many actions are already available using [Obisidian-URI](https://help.obsidian.md/Extending+Obsidian/Obsidian+URI), that can be called from the command line. Some of these fu…

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [December 12, 2024, 5:30pm UTC](https://forum.obsidian.md/t/open-vault-from-command-line-using-path-not-name-or-id/88465/6 "2024-12-12T17:30:08Z")

</div>

Closed on December 12, 2024, 5:30pm UTC

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