CLI Commands Module

CLI Commands Module ​

This module extends the Obsidian CLI with Sync Engine commands for managing modules, secrets, and sync runs from the terminal. It registers CLI handlers through the Obsidian CLI API.

To run the following commands, firstly ensure an Obsidian Electron instance is running, then use every command with obsidian <command> <flag>(=<value>), for example:

  • obsidian keychain:list
  • obsidian sync-engine dry-run
  • obsidian sync-engine:install-module id=cli-commands enable

Type obsidian help in the terminal for more about Obsidian CLI.

Keychain ​

CommandFlagsDescription
keychain:listnoneList secret IDs in the Obsidian Keychain.
keychain:setid, valueSet a secret in the Obsidian Keychain.
keychain:deleteidDelete a secret from the Obsidian Keychain.

Module Management ​

CommandFlagsDescription
sync-engine:install-moduleid, enable?, source?Install or update a module from configured sources. Pass enable to enable after installation.
sync-engine:uninstall-moduleidUninstall a module.
sync-engine:enable-moduleidEnable an installed module.
sync-engine:disable-moduleidDisable an enabled module.
sync-engine:reload-moduleidUnload and reload a module.
sync-engine:list-modulesonline?List locally installed modules, or online modules discovered from sources when online is passed.
sync-engine:edit-moduleid, name?, version?, description?, enable?, icon?, integrity-verification?, readme?, source?Edit a module's metadata. Omitted fields keep their current values.

Module Sources ​

CommandFlagsDescription
sync-engine:list-sourcesnoneList configured module sources with their public keys.
sync-engine:add-sourcepublic-key, urlAdd a module source. The public key must be an uncompressed base64 ECDSA P-256 public key.
sync-engine:delete-sourceurlDelete a module source by URL.

Sync Operations ​

CommandFlagsDescription
sync-enginedry-run?Start a sync run. With dry-run, returns the task plan instead of executing it.
sync-engine:logsnonePrint Sync Engine logs to the terminal.

All content licensed under the CC BY 4.0 License.