::: aria.cli options: show_source: true show_root_heading: true show_category_heading: true
The main entry point for the ARIA CLI.
@click.group()
def cli():
"""ARIA - AI Participation Manager."""
passCommands for managing templates:
list- List available templatesapply- Apply a template to create a policy
Commands for managing policies:
validate- Validate a policy file
Error handling decorator that provides consistent error handling across all commands.
def handle_error(func):
"""Decorator to handle errors in CLI commands."""
passProgress indicator decorator for long-running operations.
def with_progress(description: str):
"""Decorator to add progress indicator for long-running operations."""
passThe CLI provides several aliases for commonly used commands:
@cli.command(name='ls')
def list_templates_alias():
"""Alias for 'template list'"""
pass
@cli.command(name='apply')
def apply_alias():
"""Alias for 'template apply'"""
pass
@cli.command(name='validate')
def validate_alias():
"""Alias for 'policy validate'"""
passThe CLI uses Rich's progress bars and spinners to provide visual feedback:
with Progress(
SpinnerColumn(),
TextColumn("[progress.description]{task.description}"),
console=console,
) as progress:
task = progress.add_task(description)
# Perform operationAll commands use the handle_error decorator to ensure consistent error handling:
- Catch all exceptions
- Log the error
- Display user-friendly message
- Exit with appropriate code