diff --git a/cli/openbb_cli/config/menu_text.py b/cli/openbb_cli/config/menu_text.py index 56e2034998c..b9702359dbb 100644 --- a/cli/openbb_cli/config/menu_text.py +++ b/cli/openbb_cli/config/menu_text.py @@ -108,6 +108,15 @@ class MenuText: """Append raw text (without translation).""" self.menu_text += text + def add_section(self, text: str, description: str = ""): + """Append raw text (without translation).""" + spacing = (self.CMD_NAME_LENGTH - len(text) + self.SECTION_SPACING) * " " + left_spacing = self.SECTION_SPACING * " " + if description: + text = f"{left_spacing}{text}{spacing}{description}\n" + + self.menu_text += "\n" + text + def add_custom(self, name: str): """Append custom text (after translation).""" self.menu_text += f"{i18n.t(self.menu_path + name)}" diff --git a/cli/openbb_cli/controllers/cli_controller.py b/cli/openbb_cli/controllers/cli_controller.py index dfc5eb878dd..be35341df1b 100644 --- a/cli/openbb_cli/controllers/cli_controller.py +++ b/cli/openbb_cli/controllers/cli_controller.py @@ -229,7 +229,12 @@ class CLIController(BaseController): mt.add_cmd("exe") mt.add_raw("\n") mt.add_info("Platform CLI") - mt.add_raw(" data\n") + + mt.add_section( + "data", + description="retrieve data from different asset classes and providers", + ) + for router, value in PLATFORM_ROUTERS.items(): if router in NON_DATA_ROUTERS or router in DATA_PROCESSING_ROUTERS: continue @@ -247,7 +252,10 @@ class CLIController(BaseController): mt.add_cmd(router) if any(router in PLATFORM_ROUTERS for router in DATA_PROCESSING_ROUTERS): - mt.add_raw("\n data processing\n") + mt.add_section( + "data processing", + description="analyze and process previously obtained data", + ) for router, value in PLATFORM_ROUTERS.items(): if router not in DATA_PROCESSING_ROUTERS: continue @@ -264,7 +272,10 @@ class CLIController(BaseController): else: mt.add_cmd(router) - mt.add_raw("\n configuration\n") + mt.add_section( + "configuration", + description="configure the platform and manage your account", + ) for router, value in PLATFORM_ROUTERS.items(): if router not in NON_DATA_ROUTERS or router == "reference": continue @@ -281,7 +292,11 @@ class CLIController(BaseController): else: mt.add_cmd(router) - mt.add_raw("\n cached results (OBBjects)\n") + # mt.add_raw("\n cached results (OBBjects)\n") + mt.add_section( + "OBBject registry", + description="access and manage your cached results", + ) mt.add_cmd("results") session.console.print(text=mt.menu_text, menu="Home")