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:
| Name | Type | Required | Description |
|---|---|---|---|
cmd | ExtensionCommandRegistration | Yes |
Returns: Promise<DisposableHandle>
execute
execute(commandId: string, args?: unknown): Promise<unknown>
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
commandId | string | Yes | |
args | unknown | No |
Returns: Promise<unknown>