Re-index from the command line?

Is it possible to re-index a graph using the command line? Sometimes I make batch changes to files and need to reindex on multiple machines, some of which are slower than others. On a couple of the computers I use, the app is very slow. It’s usable once open, and I can tolerate it, but certain functions like re-indexing feel painfully slow. I would prefer to not have the overhead of the GUI when re-indexing or have to wait for it to open.

Since I’m already syncing using git, it would be nice to handle a re-index from the command line, as well. Is there a way to pull this off?

1 Like

It would be nice but these background things are not possible and need a deep refactoring. Even logseq:// deep links won’t work if Logseq is not already running.

Thanks for the response. Kind of a shot in the dark on my part. I was hoping there might be a script file somewhere that could be triggered. Oh well…

@SpiderMatt I feel you, Logseq is too monolithic compared to other software I am used to. I think the reason is that Logseq was originally designed to run as a (client-side) Web app in the browser but due to limitations in things like access the storage, it was turned into a desktop app with small adjustments.

Devs once said to me that they often discuss about refactoring this aspect but it would be a long term goal and at the moment they are focusing on paid services like sync, real-time collaboration and publishing to make the project financially sustainable. This is why I think we will experience a “winter” in term of Logseq improvements and we should wait to see what’s the direction once they finish the aforementioned goals.

1 Like

P.S. notice that the Logseq parser (the part that “read and understand MD/org files”) is a separate library that can be used by any Clojure(Script) program.

And you can use nbb-logseq to interact with graphs when Logseq is not running but at the moment the only useful script is lq (logseq-query) that let you run queries in the terminal:

(Babashka is sort of Bash but using Clojure syntax)

1 Like