How-to: Build a Plugin¶
Goal¶
Register external commands through Python entry points.
Step 1. Add entry point¶
Step 2. Register commands¶
from sayer import command
def register_func():
@command()
def hello_plugin():
print("hello from plugin")
Step 3. Install and run¶
Design Guidelines¶
- Keep
register_funclightweight. - Avoid side effects during import.
- Treat plugin load failures as recoverable.