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:listobsidian sync-engine dry-runobsidian sync-engine:install-module id=cli-commands enable
Type obsidian help in the terminal for more about Obsidian CLI.
Keychain
| Command | Flags | Description |
|---|
keychain:list | none | List secret IDs in the Obsidian Keychain. |
keychain:set | id, value | Set a secret in the Obsidian Keychain. |
keychain:delete | id | Delete a secret from the Obsidian Keychain. |
Module Management
| Command | Flags | Description |
|---|
sync-engine:install-module | id, enable?, source? | Install or update a module from configured sources. Pass enable to enable after installation. |
sync-engine:uninstall-module | id | Uninstall a module. |
sync-engine:enable-module | id | Enable an installed module. |
sync-engine:disable-module | id | Disable an enabled module. |
sync-engine:reload-module | id | Unload and reload a module. |
sync-engine:list-modules | online? | List locally installed modules, or online modules discovered from sources when online is passed. |
sync-engine:edit-module | id, name?, version?, description?, enable?, icon?, integrity-verification?, readme?, source? | Edit a module's metadata. Omitted fields keep their current values. |
Module Sources
| Command | Flags | Description |
|---|
sync-engine:list-sources | none | List configured module sources with their public keys. |
sync-engine:add-source | public-key, url | Add a module source. The public key must be an uncompressed base64 ECDSA P-256 public key. |
sync-engine:delete-source | url | Delete a module source by URL. |
Sync Operations
| Command | Flags | Description |
|---|
sync-engine | dry-run? | Start a sync run. With dry-run, returns the task plan instead of executing it. |
sync-engine:logs | none | Print Sync Engine logs to the terminal. |