-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Expand file tree
/
Copy pathapproval_command.py
More file actions
43 lines (33 loc) · 1.28 KB
/
approval_command.py
File metadata and controls
43 lines (33 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Approval gate command
Provides 'specify approval' command using Typer framework.
"""
import typer
from rich.console import Console
from specify_cli.approval_gates import ApprovalGatesConfig
console = Console()
def approval_command(
action: str = typer.Option("status", "--action", "-a", help="Approval action"),
):
"""Check approval gates status (if configured).
If no .speckit/approval-gates.yaml exists, returns helpful message.
Example:
specify approval
"""
config = ApprovalGatesConfig.load()
if config is None:
console.print("ℹ️ No approval gates configured")
console.print(" Create .speckit/approval-gates.yaml to enable")
console.print("")
console.print(" See: docs/approval-gates-guide.md for setup")
return
if action == "status":
console.print("✅ Approval gates enabled")
console.print("")
for phase, gate in config.gates.items():
if gate.get("enabled"):
min_approvals = gate.get("min_approvals", 1)
console.print(f" {phase}")
console.print(f" • Enabled: ✅")
console.print(f" • Min approvals: {min_approvals}")
else:
console.print(f" {phase}: disabled")