2929 handle_exception ,
3030 print_network_header ,
3131 read_issues_from_contract ,
32+ validate_issue_id ,
3233 with_cli_behavior_options ,
3334 with_network_contract_options ,
3435)
4243 type = int ,
4344 help = 'View a specific issue by ID' ,
4445)
46+ @click .option (
47+ '--repo' ,
48+ 'repo_filter' ,
49+ default = None ,
50+ type = str ,
51+ help = 'Filter issues to a specific repository (owner/name).' ,
52+ )
4553@with_cli_behavior_options (
4654 include_verbose = True ,
4755 include_json = True ,
4856 verbose_help = 'Show debug output for contract reads' ,
4957)
5058@with_network_contract_options ('Contract address (uses default if empty)' )
51- def issues_list (issue_id : int , network : str , rpc_url : str , contract : str , verbose : bool , as_json : bool ):
59+ def issues_list (
60+ issue_id : int , repo_filter : str , network : str , rpc_url : str , contract : str , verbose : bool , as_json : bool
61+ ):
5262 """List issues or view a specific issue.
5363
5464 [dim]Examples:
@@ -58,6 +68,12 @@ def issues_list(issue_id: int, network: str, rpc_url: str, contract: str, verbos
5868 $ gitt i list --json
5969 [/dim]
6070 """
71+ if issue_id is not None :
72+ try :
73+ validate_issue_id (issue_id , 'id' )
74+ except click .BadParameter as e :
75+ handle_exception (as_json , str (e ), 'bad_parameter' )
76+
6177 contract_addr , ws_endpoint , network_name = _resolve_contract_and_network (
6278 contract ,
6379 network ,
@@ -76,6 +92,11 @@ def issues_list(issue_id: int, network: str, rpc_url: str, contract: str, verbos
7692 for issue in issues :
7793 issue ['bounty_alpha' ] = format_alpha (issue .get ('bounty_amount' , 0 ), 4 )
7894 issue ['target_alpha' ] = format_alpha (issue .get ('target_bounty' , 0 ), 4 )
95+
96+ # Apply --repo filter before rendering (--id takes precedence)
97+ if repo_filter and issue_id is None :
98+ issues = [i for i in issues if i .get ('repository_full_name' , '' ).lower () == repo_filter .lower ()]
99+
79100 if issue_id is not None :
80101 issue = next ((i for i in issues if i ['id' ] == issue_id ), None )
81102 if issue is None :
@@ -110,6 +131,10 @@ def issues_list(issue_id: int, network: str, rpc_url: str, contract: str, verbos
110131 handle_exception (as_json , f'Issue { issue_id } not found on-chain.' , 'not_found' )
111132 return
112133
134+ # Apply --repo filter before table render (--id takes precedence)
135+ if repo_filter and issue_id is None :
136+ issues = [i for i in issues if i .get ('repository_full_name' , '' ).lower () == repo_filter .lower ()]
137+
113138 # Table view of all issues
114139 console .print ('[bold cyan]Available Issues[/bold cyan]\n ' )
115140
0 commit comments