Plugin.addCommand method
Plugin › addCommand
Official
Register a command globally. Registered commands will be available from thehttps://help.obsidian.md/Plugins/Command+palette Command palette. The command id and name will be automatically prefixed with this plugin's id and name.Signature:
addCommand(command: Command): CommandParameters:
| Parameter | Type | Description |
|---|---|---|
| command | Command | The command. |
Returns: Command — The command, with its ID and name prefixed.
Since: 0.9.7
Example:
plugin.addCommand({ id: 'foo', name: 'Foo',});