From 9bfd96638fa4eccd8e4c93e6a78b5b0dcfcb32d8 Mon Sep 17 00:00:00 2001 From: ibraheem-latent Date: Wed, 24 Sep 2025 14:04:15 -0700 Subject: [PATCH 1/2] Adds wallet_name param --- bittensor_cli/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 07b64e6d1..453227f71 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -1875,6 +1875,7 @@ def wallet_ask( def wallet_list( self, + wallet_name: Optional[str] = Options.wallet_name, wallet_path: str = Options.wallet_path, quiet: bool = Options.quiet, verbose: bool = Options.verbose, @@ -1898,7 +1899,13 @@ def wallet_list( wallet = self.wallet_ask( None, wallet_path, None, ask_for=[WO.PATH], validate=WV.NONE ) - return self._run_command(wallets.wallet_list(wallet.path, json_output)) + return self._run_command( + wallets.wallet_list( + wallet.path, + json_output, + wallet_name=wallet_name, + ) + ) def wallet_overview( self, From d597f0c91997926223a5cc1aeaea090104452242 Mon Sep 17 00:00:00 2001 From: ibraheem-latent Date: Wed, 24 Sep 2025 14:04:31 -0700 Subject: [PATCH 2/2] display individual wallet --- bittensor_cli/src/commands/wallets.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bittensor_cli/src/commands/wallets.py b/bittensor_cli/src/commands/wallets.py index 42fe8a0a6..63edd7ef3 100644 --- a/bittensor_cli/src/commands/wallets.py +++ b/bittensor_cli/src/commands/wallets.py @@ -813,13 +813,22 @@ async def wallet_history(wallet: Wallet): console.print(table) -async def wallet_list(wallet_path: str, json_output: bool): +async def wallet_list( + wallet_path: str, json_output: bool, wallet_name: Optional[str] = None +): """Lists wallets.""" wallets = utils.get_coldkey_wallets_for_path(wallet_path) print_verbose(f"Using wallets path: {wallet_path}") if not wallets: err_console.print(f"[red]No wallets found in dir: {wallet_path}[/red]") + if wallet_name: + wallets = [wallet for wallet in wallets if wallet.name == wallet_name] + if not wallets: + err_console.print( + f"[red]Wallet '{wallet_name}' not found in dir: {wallet_path}[/red]" + ) + root = Tree("Wallets") main_data_dict = {"wallets": []} for wallet in wallets: @@ -876,7 +885,12 @@ async def wallet_list(wallet_path: str, json_output: bool): if not wallets: print_verbose(f"No wallets found in path: {wallet_path}") - root.add("[bold red]No wallets found.") + message = ( + "[bold red]No wallets found." + if not wallet_name + else f"[bold red]Wallet '{wallet_name}' not found." + ) + root.add(message) if json_output: json_console.print(json.dumps(main_data_dict)) else: