Skip to content

Commit 3bae5d7

Browse files
author
Mohamed Zeidan
committed
fix cluster help cmds
1 parent ae5610f commit 3bae5d7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/sagemaker/hyperpod/cli/hyp_cli.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ def __init__(self, *args, **kwargs):
2929
self.modules_registered = set()
3030

3131
def list_commands(self, ctx):
32-
"""Return list of commands without loading modules"""
33-
# Return static command list for fast help generation (no module loading)
34-
return sorted([
35-
'create', 'list', 'describe', 'delete', 'list-pods', 'get-logs',
36-
'invoke', 'get-operator-logs', 'list-cluster', 'set-cluster-context',
37-
'get-cluster-context', 'get-monitoring'
38-
])
32+
"""Return list of commands by querying the registry"""
33+
# Ensure registry is initialized and commands are discovered
34+
self.registry.ensure_commands_loaded()
35+
36+
subgroup_commands = self.registry.get_all_groups()
37+
38+
top_level_commands = self.registry.get_top_level_commands()
39+
40+
# Combine and return sorted list
41+
all_commands = subgroup_commands + top_level_commands
42+
return sorted(set(all_commands))
3943

4044
def get_help(self, ctx):
4145
"""Override get_help to avoid loading modules for help text"""

0 commit comments

Comments
 (0)