Coverage for src / rhiza / commands / __init__.py: 100%
3 statements
« prev ^ index » next coverage.py v7.13.1, created at 2025-12-29 01:59 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2025-12-29 01:59 +0000
1"""Command implementations for the Rhiza CLI.
3This package contains the core implementation functions that back the Typer
4commands exposed by `rhiza.cli`. These commands help you manage reusable
5configuration templates for Python projects.
7## Available Commands
9### init
11Initialize or validate `.github/rhiza/template.yml` in a target directory.
13Creates a default configuration file if it doesn't exist, or validates
14an existing one. The default configuration includes common Python project
15files like `.github`, `.editorconfig`, `.gitignore`,
16`.pre-commit-config.yaml`, `Makefile`, and `pytest.ini`.
18### materialize
20Inject Rhiza configuration templates into a target repository.
22Materializes template files from the configured template repository into
23your target project by performing a sparse clone of the template repository,
24copying specified files/directories, and respecting exclusion patterns.
25Files that already exist will not be overwritten unless the `--force` flag
26is used.
28### validate
30Validate Rhiza template configuration.
32Validates the `.github/rhiza/template.yml` file to ensure it is syntactically
33correct and semantically valid. Performs comprehensive validation including
34YAML syntax checking, required field verification, field type validation,
35and repository format verification.
37## Usage Example
39These functions are typically invoked through the CLI:
41 ```bash
42 $ rhiza init # Initialize configuration
44 $ rhiza materialize # Apply templates to project
46 $ rhiza validate # Validate template configuration
47 ```
49For more detailed usage examples and workflows, see the USAGE.md guide
50or try rhiza <command> --help
51"""
53from .init import init # noqa: F401
54from .materialize import materialize # noqa: F401
55from .validate import validate # noqa: F401