Use case or problem
We’ve been using Obsidian at our company for building a large knowledge base of reusable document elements/templates/etc. which the modularity and inter-linking (and document embedding) features greatly help with. This vault is then used to generate PDF/HTML/Word documents that form part of the deliverables for customer projects (through pandoc).
We’ve written an internal plugin which pulls various templates and document fragments together into one config and converts Obsidian’s markdown dialect into Pandoc’s markdown dialect before running it through Pandoc (with various additional settings to control style etc.).
We often find ourselves needing to run these exports 40-50 times, usually with relatively short notice. Ensuring we do this repeatably and without missing any gets surprisingly labor intensive.
Proposed solution
Since this vault is held in our GitLab instance, the natural solution would be to use GitLab CI to build a release bundle of documents whenever a part of the vault changes.
Since the plugin relies heavily on Obsidian’s metadata, inter-linking, and referencing features, Obsidian itself would need to form part of this CI job. This causes problems however since as far as I can tell you can only use Obsidian plugins through the Obsidian GUI.
Our proposal is to add some CLI which would allow you to run plugin commands (i.e. ones registered with Plugin.addCommand()
) from the command line without opening the GUI at all. The interface could look something like:
obsidian --run-command "registerd-command-id"
Current workaround (optional)
There are currently no workarounds that we are aware of which would let us run Obsidian through GitLab’s CI. One method we were initially thinking of was to run Obsidian on a server and add some kind of REST API support to the plugin which would allow us to remotely trigger jobs, clone the repo at specific commit hashes, somehow switch over to the freshly checked out vault, and run the relevant commands.
This would be quite an undertaking and likely quite error prone though.