Builder
provide.foundation.cli.click.builder
¶
Click command group builder and orchestration.
Main orchestrator for building Click CLI groups from registered commands. Coordinates parameter processing, command building, and group hierarchy.
Classes¶
Functions¶
create_command_group
¶
create_command_group(
name: str = "cli",
commands: list[str] | None = None,
registry: Registry | None = None,
**kwargs: Any
) -> Group
Create a Click group with registered commands.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name for the CLI group |
'cli'
|
commands
|
list[str] | None
|
List of command names to include (None = all) |
None
|
registry
|
Registry | None
|
Custom registry (defaults to global) |
None
|
**kwargs
|
Any
|
Additional Click Group options |
{}
|
Returns:
| Type | Description |
|---|---|
Group
|
Click Group with registered commands |
Raises:
| Type | Description |
|---|---|
CLIBuildError
|
If group creation fails |
Example
Register some commands¶
@register_command("init") def init_cmd(): pass
Create CLI group¶
cli = create_command_group("myapp")
Run the CLI¶
if name == "main": cli()