Skip to main content

Commands

There are two ways to identify a command.

  • commandname That's the one you see when searching in Obsidian's command palette
  • commandid That's invisible to the user, but can be read from the plugin's source code
info

Using the command's ID is strongly recommended, because it's not likely to change. Using Helper Commands the ID is automatically obtained.

In the following <command> can be replaced with either commandname or commandid.

parametersexplanation
<command>Executes command by its name
<command>, <identification>Opens file and then executes command by its name
<command>, <identification>, line=mylineOpens file, sets the curosor to myline and then executes command by its name
<command>, <identification>, mode=appendOpens file, adds empty line at the end and sets cursor, then executes command by its name
<command>, <identification>, mode=prependOpens file, adds empty line at the beginning and sets cursor, then executes command by its name
<command>, <identification>, mode=overwriteOpens file, clears the file, then executes command by its name
Example

Close specific tab by its filepath:

obsidian://advanced-uri?vault=<your-vault>&filepath=<your-file>&commandid=workspace%253Aclose

To explain this example: It first switches to the tab specified by filepath and then executes the command Close current tab by its ID. Resulting in the ability to close any tab by its filepath.