The System API provides system-level functions for interacting with the SilverBullet environment.
system.cleanDatabases()
Deprecated: Use system.wipeClient or the Client: Wipe command instead.
Deprecated no-op retained for compatibility.
system.getBaseURI()
Returns the browser base URI for this SilverBullet instance.
system.getConfig(key, defaultValue?)
Returns a configuration value, with an optional default.
system.getEnv()
Deprecated: The environment is always the client.
Deprecated environment probe that always returns nil.
system.getMode()
Returns rw for read-write mode or ro for read-only mode.
system.getProfile()
The current user's identity. username is "me" when the server has no account for this session.
system.getSpaceConfig(key, defaultValue?)
Deprecated: Use system.getConfig instead.
Deprecated alias for system.getConfig.
system.getURLPrefix()
Returns the configured URL path prefix for this SilverBullet instance.
system.getVersion()
Returns the running SilverBullet version.
system.invokeCommand(name, args?)
Deprecated: Use editor.invokeCommand instead.
Deprecated alias for editor.invokeCommand.
system.invokeFunction(name, ...)
Invokes a loaded plug function by its plug-qualified name.
system.invokeFunctionOnServer(name, ...)
Deprecated: Use system.invokeFunction instead.
Deprecated alias for system.invokeFunction.
system.listAccounts()
Every account with access to this space, with the current user marked.
system.listCommands()
Returns a map of every currently available command definition.
system.listPaletteCommands()
Returns the commands the command palette would show right now: context- and mode-filtered, hidden ones dropped, each with its prettified key hint and the time it was last run on this client.
system.listSyscalls()
Lists registered syscalls with permissions, argument counts, and documentation metadata.
system.loadPlug(path)
Loads or reloads one plug from a space file path.
system.loadScripts()
Reloads Space Lua scripts and configuration.
system.loadSpaceScripts()
Deprecated: Use system.loadScripts instead.
Deprecated alias for system.loadScripts.
system.loadSpaceStyles()
Reloads custom Space Style definitions.
system.reboot()
Saves the current editor buffer, detects on-disk changes, waits for indexing, and reloads configuration, scripts, styles, and client state. An external edit to the currently open page is never overwritten: an unmodified buffer reloads it, and unsaved edits are merged with it first.
system.reloadConfig()
Deprecated: Configuration reloads automatically; use system.reboot when needed.
Deprecated no-op that returns the current configuration.
system.reloadPlugs()
Reloads every plug available to the client.
system.runPaletteCommand(name)
Runs a command as if it had been picked from the command palette: records it as the most recently run, then invokes it and returns its result. A command that throws is reported to the user and answered as false, which in this protocol means "do not move focus on my behalf".
Parameters:
name (string) — Command name.Returns:
system.serverSyscall(name, ...)
Deprecated: Invoke the target syscall directly instead.
Deprecated helper for invoking a named syscall.
system.unloadPlug(path)
Unloads the plug loaded from a space file path.
system.wipeClient(logout?)
Wipes local client state, cached files, databases, and optionally the login session.