SilverBullet CLI

sb brings your SilverBullet spaces to the terminal: run queries and Space Lua against your live space, and script your knowledge from the shell, a cron job or a coding agent.

# Every open task, from every page
sb query 'from t = index.tasks() where not t.done select t.name'

# The five pages that changed last
sb query 'from p = index.pages() order by p.lastModified desc limit 5 select p.name'

# Everything waiting in @pete’s Mention Inbox
sb lua 'identity.mentions("pete")' --json

# Run a Space Lua script against your live space
sb lua --file weekly-review.lua

Features

  • Queries and Space Lua from the terminal. sb query runs the same queries you write in your pages, and sb lua runs Space Lua against your live space, with your libraries and data: inline, from a file, or piped in. sb --help shows what you can query. Edge
  • Made for scripts and coding agents. Plain text in a terminal, JSON when piped, and a distinct exit code for every kind of failure, so it fits shell scripts and scheduled jobs. sb help gives an agent the space’s skills and a map of the space to start from. Edge
  • Remote pages as files. sb fs lists, reads, writes and edits the files in a space on a SilverBullet Server, without a copy on your machine. Every edit checks the page’s revision first, so you never overwrite a change someone made in the meantime.
  • Search and screenshots. sb search finds pages by text, sb related finds pages similar in meaning, and sb screenshot captures a page as it renders, widgets and queries included. Edge

Install

On macOS, Linux and FreeBSD:

curl -fsSL https://silverbullet.md/install-sb.sh | sh

On Windows, in PowerShell:

irm https://silverbullet.md/install-sb.ps1 | iex
powershell

Or download sb for your platform from the latest release on GitHub. After that, it upgrades itself with sb upgrade.