88from rich .table import Table
99
1010from cycode .cli .apps .ai_guardrails .command_utils import console , validate_and_parse_ide , validate_scope
11+ from cycode .cli .apps .ai_guardrails .consts import IDE_CONFIGS , AIIDEType
1112from cycode .cli .apps .ai_guardrails .hooks_manager import get_hooks_status
1213from cycode .cli .utils .sentry import add_breadcrumb
1314
@@ -26,7 +27,7 @@ def status_command(
2627 str ,
2728 typer .Option (
2829 '--ide' ,
29- help = 'IDE to check status for (e.g., "cursor"). Defaults to cursor.' ,
30+ help = 'IDE to check status for (e.g., "cursor", "claude-code", or "all" for all IDEs ). Defaults to cursor.' ,
3031 ),
3132 ] = 'cursor' ,
3233 repo_path : Annotated [
@@ -50,6 +51,7 @@ def status_command(
5051 cycode ai-guardrails status --scope user # Show only user-level status
5152 cycode ai-guardrails status --scope repo # Show only repo-level status
5253 cycode ai-guardrails status --ide cursor # Check status for Cursor IDE
54+ cycode ai-guardrails status --ide all # Check status for all supported IDEs
5355 """
5456 add_breadcrumb ('ai-guardrails-status' )
5557
@@ -59,34 +61,41 @@ def status_command(
5961 repo_path = Path (os .getcwd ())
6062 ide_type = validate_and_parse_ide (ide )
6163
62- scopes_to_check = [ 'user' , 'repo' ] if scope == 'all' else [scope ]
64+ ides_to_check : list [ AIIDEType ] = list ( AIIDEType ) if ide_type is None else [ide_type ]
6365
64- for check_scope in scopes_to_check :
65- status = get_hooks_status (check_scope , repo_path if check_scope == 'repo' else None , ide = ide_type )
66+ scopes_to_check = ['user' , 'repo' ] if scope == 'all' else [scope ]
6667
68+ for current_ide in ides_to_check :
69+ ide_name = IDE_CONFIGS [current_ide ].name
6770 console .print ()
68- console .print (f'[bold]{ check_scope .upper ()} SCOPE[/]' )
69- console .print (f'Path: { status ["hooks_path" ]} ' )
71+ console .print (f'[bold cyan]═══ { ide_name } ═══[/]' )
72+
73+ for check_scope in scopes_to_check :
74+ status = get_hooks_status (check_scope , repo_path if check_scope == 'repo' else None , ide = current_ide )
75+
76+ console .print ()
77+ console .print (f'[bold]{ check_scope .upper ()} SCOPE[/]' )
78+ console .print (f'Path: { status ["hooks_path" ]} ' )
7079
71- if not status ['file_exists' ]:
72- console .print ('[dim]No hooks.json file found[/]' )
73- continue
80+ if not status ['file_exists' ]:
81+ console .print ('[dim]No hooks file found[/]' )
82+ continue
7483
75- if status ['cycode_installed' ]:
76- console .print ('[green]✓ Cycode AI guardrails: INSTALLED[/]' )
77- else :
78- console .print ('[yellow]○ Cycode AI guardrails: NOT INSTALLED[/]' )
84+ if status ['cycode_installed' ]:
85+ console .print ('[green]✓ Cycode AI guardrails: INSTALLED[/]' )
86+ else :
87+ console .print ('[yellow]○ Cycode AI guardrails: NOT INSTALLED[/]' )
7988
80- # Show hook details
81- table = Table (show_header = True , header_style = 'bold' )
82- table .add_column ('Hook Event' )
83- table .add_column ('Cycode Enabled' )
84- table .add_column ('Total Hooks' )
89+ # Show hook details
90+ table = Table (show_header = True , header_style = 'bold' )
91+ table .add_column ('Hook Event' )
92+ table .add_column ('Cycode Enabled' )
93+ table .add_column ('Total Hooks' )
8594
86- for event , info in status ['hooks' ].items ():
87- enabled = '[green]Yes[/]' if info ['enabled' ] else '[dim]No[/]'
88- table .add_row (event , enabled , str (info ['total_entries' ]))
95+ for event , info in status ['hooks' ].items ():
96+ enabled = '[green]Yes[/]' if info ['enabled' ] else '[dim]No[/]'
97+ table .add_row (event , enabled , str (info ['total_entries' ]))
8998
90- console .print (table )
99+ console .print (table )
91100
92101 console .print ()
0 commit comments