Commands
Define plugin command trees, branches, leaves, and agent-facing descriptions.
Commands
definePlugin declares the top-level crtr command. name must be lowercase kebab case. description, whenToUse, and summary are required text for the plugin, every branch, and every leaf. Write them for an agent choosing a command: describe the concrete object or action, state when the command applies, and state the short outcome.
rootEntry describes the top-level command and requires concept, description, and whenToUse. commands is an object whose keys are camelCase or lowercase names. The package converts each key to the lowercase kebab name crtr exposes. A key must round-trip, so use appId for app-id, not a spelling that converts ambiguously.
Use defineBranch to group commands and give it children. Use defineLeaf for a request that returns one object. A leaf requires params, output, effects, and handler; params may be omitted when the command has no input. effects is a non-empty list shown to the agent. Say whether a command mutates an application, creates billable resources, or is read-only.
defineStreamingLeaf has the same declaration shape, but its handler returns AsyncIterable<object>. It marks the generated REST mapping as streaming and is covered in Errors and streaming.
All command and parameter keys are derived into the manifest. Do not add a route path, HTTP method, REST mapping, or separate manifest to a command definition. The package always generates POST with all parameters in the JSON body.