Execute Obsidian Command
commands.executeTrigger any Obsidian command by its internal ID, passing optional arguments to perform actions like saving files or opening the command palette.
Instructions
Execute an Obsidian command by its internal id (as returned by commands.list). args is an optional argument map passed to the command (most built-in commands take no arguments). Requires the Local REST API plugin. Destructive — the effect depends entirely on what the command does, so verify the command id before calling.
Targets the vault the live Obsidian process has open via the Local REST API. Not affected by vault.select — that only changes filesystem-tool routing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Optional map of command arguments. Most commands accept none. | |
| commandId | Yes | Command identifier, e.g. `editor:save-file` or `command-palette:open`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||