Skip to main content

api.commands

Interface: ICommandsApi

Implementation tier: T1

Register extension commands that appear in the command palette and can be bound to keyboard shortcuts.

Permissions

  • commands:register
info

Thin proxy over Spec B's ICommandRegistry. The extension worker calls it; the host translates each call into a commandRegistry.register({ ... handler: rpcCallback }) where rpcCallback issues a reverse RPC back into the worker on invocation.

Aliases are intentionally absent — extensions handle their own aliases via their locale catalogs.

Methods

register

register(cmd: ExtensionCommandRegistration): Promise<DisposableHandle>

Parameters:

NameTypeRequiredDescription
cmdExtensionCommandRegistrationYes

Returns: Promise<DisposableHandle>


execute

execute(commandId: string, args?: unknown): Promise<unknown>

Parameters:

NameTypeRequiredDescription
commandIdstringYes
argsunknownNo

Returns: Promise<unknown>