silverbullet as cli/scripting tool

Good morning! First, thanks a lot for building and maintaining silverbullet, it’s pretty much exactly what I was looking for!

One thing I’d love to do is to run silverbullet queries over my space as a cli script. For example,

$ silverbullet /path/to/my/space -q 'from index.tag "page" where table.includes(tags, "meta")' | ...

Rather than serving my notes it would run the query and pass it through the pipe.

I wonder how tightly coupled is the implementation of the serving part vs query engine? What’s the right entry point to build this?

Thanks again!

Unfortunately, this not really in the cards right now. The silverbullet server is pretty “dumb” — all it does is serve and persist files on disk. All the interesting logic: the indexing, the querying happens 100% in the client (the browser). In a previous version (v1) it actually happened both on the server and client, but for simplification reasons I now moved everything to just the browser, which means that accessing this functionality from the CLI is pretty much not doable.

1 Like