Coverage for queue_cli/commands/templates.py: 0.00%
19 statements
« prev ^ index » next coverage.py v7.10.6, created at 2026-04-13 00:07 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2026-04-13 00:07 +0000
1"""
2Templates command - manage message templates.
3"""
5import typer
7from ..core.templates import TemplateManager
8from ..utils.display import console, print_header, print_json, print_template_list
11def list_templates() -> None:
12 """
13 List all available templates.
15 Examples:
16 uv run python queue_cli.py templates
17 """
18 template_mgr = TemplateManager()
19 templates = template_mgr.list_templates()
21 print_template_list(templates)
24def show_template(name: str) -> None:
25 """
26 Show a specific template.
28 Args:
29 name: Template name
31 Examples:
32 uv run python queue_cli.py templates --show completed-match
33 """
34 template_mgr = TemplateManager()
35 data = template_mgr.load_template(name)
37 if not data:
38 console.print(f"[red]❌ Template not found: {name}[/red]")
39 raise typer.Exit(1)
41 print_header(f"Template: {name}")
42 print_json(data)
45def templates_command(
46 show: str | None = typer.Option(None, "--show", "-s", help="Show specific template"),
47) -> None:
48 """
49 Manage message templates.
51 Examples:
52 # List all templates
53 uv run python queue_cli.py templates
55 # Show specific template
56 uv run python queue_cli.py templates --show completed-match
57 """
58 if show:
59 show_template(show)
60 else:
61 list_templates()