obsidian-plugin-commands
Installation
SKILL.md
Obsidian Plugin Commands
This skill focuses on registering, managing, and optimizing commands within an Obsidian plugin. Commands are the primary way users interact with plugins through the Command Palette and keyboard shortcuts.
When to Use This Skill
- Adding a new command to an Obsidian plugin
- Choosing between
callback,editorCallback,checkCallback, andeditorCheckCallback - Configuring default hotkeys for plugin commands
- Making commands context-sensitive (appear only when conditions are met)
- Dynamically adding or removing commands at runtime
- Understanding command palette behavior and mobile constraints
Overview
Commands in Obsidian are actions users invoke from the Command Palette (Ctrl/Cmd+P) or via hotkeys. Every command is registered through Plugin.addCommand() inside onload(). The API provides four callback flavors that determine when and how a command executes: