Cmd
Command registration, aliases and CLI visibility.
Purpose & processing
Declares a command class for discovery and registration by the APPNETOS command system.
Parameters
| Parameter | Type | Default | Behavior |
|---|---|---|---|
| name | string | Required | Unique normalized command identifier; lowercase colon-separated segments. |
| description | string|null | null | Optional description; blank values normalize to null. |
| aliases | array | [] | Alternative command identifiers subject to the same naming rules. |
| active | bool | true | Whether the command can be resolved for execution. |
| hidden | bool | false | Hide from normal listings without disabling execution. |
Example
#[Cmd(
name: 'appnetos:cache:clear',
description: 'Clear the application cache',
aliases: ['cache:clear'],
active: true,
hidden: false
)]
class CacheClear extends \Core\Cmd\Base {}
Behavior and considerations
- Name segments use lowercase letters, digits and internal hyphens, separated by colons.
- Empty segments, leading/trailing hyphens and duplicate aliases are invalid.
- Hidden is a listing preference, not an authorization mechanism.
- Inactive commands cannot be executed through normal registry resolution.
Source
shared/src/Core/Cmd/Annotation/Cmd.php