Accessing obsidian metadata from other (CLI) tools

Obsidian is great, because being able to have my notes as local files is great. But I would really love it if it were possible to access the search index that obsidian builds itself as a file. It seems like this data must have been written down somewhere since the indexing process isn’t supposed to happen every time you reopen obsidian, but it doesn’t appear to exist in my .obsidian folder.

If the index existed as a file and could be parsed and accessed in a stable, predictable way, that would open up many new possibilities for building tools that interact with obsidian, rather than just extensions to obsidian itself.

The simple friendly example here is a tool that allows you to search over multiple vaults and combine the results. Because of the (very reasonable) design decision to not allow nested vaults, this is hard to do at the moment, but a tool that could just read the index could help a great deal.

Other ideas that this might help support;

  • Change watcher that can just watch the index rather than the whole vault to reduce the number of file watches needed for automation tools
  • dataview queries that run in a separate process and present their results as a web UI
  • obsidian “daemon” that serves as the public API to external tools in the same way that the plugin class serves as the public API to plugins (preferably that could run without electron)
1 Like