AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0
Add commands
A command is one stable action that Phials can expose wherever that action is useful. Define the action once, then let its context, presentation, shortcut, and placements adapt it to the Command Bar, Path Bar, and file context menus.
Commands belong to a CommandProvider, and one plugin can register any number of providers and commands.
- Define and register a command builds the smallest working command and verifies it through the Command Bar.
- Use command context and availability makes an action appear and run only for the context it can handle.
- Make commands discoverable and add shortcuts gives commands useful search metadata, context-sensitive presentation, and user-editable defaults.
- Place commands in the Path Bar and context menus adds convenient default placements without taking control away from the user.
- Build nested and custom command controls covers child commands, grouped menus, sub-toolbars, and the narrow cases that need custom rendering.
Use api.modal and api.notify for reusable confirmation and feedback patterns. See Show dialogs and notifications.