Rename BackstageCommand to CliCommand and CommandContext to CliCommandContext

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-13 07:46:09 +01:00
parent 7d055ef0c4
commit 1929a95b97
47 changed files with 114 additions and 114 deletions
@@ -15,7 +15,7 @@
*/
import { OpaqueCliPlugin } from '@internal/cli';
import { BackstageCommand, CliPlugin } from './types';
import { CliCommand, CliPlugin } from './types';
/**
* Creates a new CLI plugin that provides commands to the Backstage CLI.
@@ -52,10 +52,10 @@ export function createCliPlugin(options: {
*/
init: (registry: {
/** Registers a new command with the CLI. */
addCommand: (command: BackstageCommand) => void;
addCommand: (command: CliCommand) => void;
}) => Promise<void>;
}): CliPlugin {
const commands: BackstageCommand[] = [];
const commands: CliCommand[] = [];
const commandsPromise = options
.init({ addCommand: command => commands.push(command) })
.then(() => commands);
+1 -1
View File
@@ -15,4 +15,4 @@
*/
export { createCliPlugin } from './createCliPlugin';
export type { BackstageCommand, CommandContext, CliPlugin } from './types';
export type { CliCommand, CliCommandContext, CliPlugin } from './types';
+4 -4
View File
@@ -21,7 +21,7 @@
*
* @public
*/
export interface CommandContext {
export interface CliCommandContext {
/**
* The remaining arguments passed to the command after the command path
* has been resolved. This includes both positional arguments and flags.
@@ -61,7 +61,7 @@ export interface CommandContext {
*
* @public
*/
export interface BackstageCommand {
export interface CliCommand {
/**
* The path segments that define the command's position in the CLI tree.
* For example, `['repo', 'test']` maps to `backstage-cli repo test`.
@@ -99,10 +99,10 @@ export interface BackstageCommand {
* ```
*/
execute:
| ((context: CommandContext) => Promise<void>)
| ((context: CliCommandContext) => Promise<void>)
| {
loader: () => Promise<{
default: (context: CommandContext) => Promise<void>;
default: (context: CliCommandContext) => Promise<void>;
}>;
};
}