Beginner
The ctx API: Your Plugin's First Steps
The ctx API: Your Plugin's First Steps — Learn how to build beginner dsh plugins.
ctx: the plugin's toolkit
The ctx object is everything your plugin needs to register capabilities. It's the single interface between your code and the dsh runtime.
Available registration methods
ctx.commands.register(name, spec)— user-triggered commandsctx.tools.register(spec)— model-called toolsctx.ui.registerPanel(id, spec)— UI panelsctx.ui.registerSkin(name)— theme registrationctx.log(msg)— structured logging
The ctx object is isolated
Each profile gets its own ctx instance. This means plugins don't leak state between profiles — a critical security property.