Refine cli-plugin-api: use packageJson, inline types, rename context fields

Replace pluginId with packageJson input for createCliPlugin, remove
CommandExecuteFn type alias by inlining it, and rename
CommandContext.info.description to info.name.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-11 08:38:58 +01:00
parent 2e5f189cfa
commit 7e6ad01a21
23 changed files with 60 additions and 111 deletions
@@ -21,10 +21,8 @@ export const OpaqueCliPlugin = OpaqueType.create<{
public: CliPlugin;
versions: {
readonly version: 'v1';
readonly description: string;
init: (registry: {
addCommand: (command: BackstageCommand) => void;
}) => Promise<void>;
readonly packageName: string;
readonly commands: Promise<ReadonlyArray<BackstageCommand>>;
};
}>({
type: '@backstage/CliPlugin',