Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions commando/ui/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import random
import shutil
import sys
from collections import defaultdict

from commando.utils.io import (
BLACKLIST_FILE,
Expand Down Expand Up @@ -143,7 +144,14 @@ def factory_reset(state_manager):

def explore_category(state_manager, search_command_fn):
all_known = state_manager.get_all_known_commands()
categories = sorted(list(set(data["category"] for data in all_known.values())))

# Pre-group commands by category
grouped = defaultdict(list)
for cmd, data in all_known.items():
category = data.get("category", "Custom")
grouped[category].append((cmd, data))

categories = sorted(grouped.keys())

clear_screen()
print(f"{MAGENTA}★ Categories ★{RESET}\n")
Expand All @@ -160,9 +168,10 @@ def explore_category(state_manager, search_command_fn):
selected_cat = categories[idx]
clear_screen()
print(f"{YELLOW}--- {format_badge(selected_cat)} Commands ---{RESET}\n")
for cmd, data in all_known.items():
if data["category"] == selected_cat:
print(f" • {CYAN}{BOLD}{cmd}{RESET}: {data['desc']}")

# Print pre-grouped commands
for cmd, data in grouped[selected_cat]:
print(f" • {CYAN}{BOLD}{cmd}{RESET}: {data['desc']}")

print(f"\n{YELLOW}Options:{RESET}")
print(f" - Type a command name to search for it.")
Expand Down
Loading