<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[`Plugin`](Plugin) › [`registerCliHandler`](Plugin/registerCliHandler)
## Plugin.registerCliHandler() method
Register a CLI handler to handle a command from the CLI. Command IDs must be globally unique. Attempting to register a command that is already registered will throw an Error.
Use the format `<plugin-id>` for your default command, and `<plugin-id>:<action>` for sub-commands and actions.
**Signature:**
```typescript
registerCliHandler(command: string, description: string, flags: CliFlags | null, handler: CliHandler): void;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| <code>command</code> | <code>string</code> | The command ID that will be used. Use alphanumeric characters without spaces. |
| <code>description</code> | <code>string</code> | The description text to provide in the help command, and in auto-completion prompts. |
| <code>flags</code> | [`CliFlags`](CliFlags)<code> | null</code> | Command line flags that can be passed in. |
| <code>handler</code> | [`CliHandler`](CliHandler) | <p>The callback handler to handle a CLI invocation.</p><p> 1.12.2</p> |
**Returns:**
`void`