Skip to content

Commit 986c6ce

Browse files
committed
.
1 parent eae6456 commit 986c6ce

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

src/codegen/cli/tui/app.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import typer
1212

1313
from codegen.cli.api.endpoints import API_ENDPOINT
14-
from codegen.cli.auth.token_manager import get_current_token
14+
from codegen.cli.auth.token_manager import get_current_org_name, get_current_token
1515
from codegen.cli.commands.agent.main import pull
1616
from codegen.cli.utils.org import resolve_org_id
1717
from codegen.cli.utils.url import generate_webapp_url, get_domain
@@ -57,6 +57,23 @@ def _signal_handler(self, signum, frame):
5757
print("\n") # Just add a newline and exit
5858
sys.exit(0)
5959

60+
def _format_status_line(self, left_text: str) -> str:
61+
"""Format status line with instructions and org info on a new line below."""
62+
# Get organization name
63+
org_name = get_current_org_name()
64+
if not org_name:
65+
org_name = f"Org {self.org_id}" if hasattr(self, "org_id") and self.org_id else "No Org"
66+
67+
# Use the same purple color as the Codegen logo
68+
purple_color = "\033[38;2;82;19;217m"
69+
reset_color = "\033[0m"
70+
71+
# Return instructions on first line, org on second line (bottom left)
72+
instructions_line = f"\033[90m{left_text}\033[0m"
73+
org_line = f"{purple_color}{org_name}{reset_color}"
74+
75+
return f"{instructions_line}\n{org_line}"
76+
6077
def _load_agent_runs(self) -> bool:
6178
"""Load the last 10 agent runs."""
6279
if not self.token or not self.org_id:
@@ -635,17 +652,17 @@ def _clear_and_redraw(self):
635652

636653
# Show appropriate instructions based on context
637654
if self.input_mode and self.current_tab == 1: # new tab input mode
638-
print("\n\033[90mType your prompt • [Enter] create • [Esc] cancel • [Tab] switch tabs • [Ctrl+C] quit\033[0m")
655+
print(f"\n{self._format_status_line('Type your prompt • [Enter] create • [Esc] cancel • [Tab] switch tabs • [Ctrl+C] quit')}")
639656
elif self.input_mode: # other input modes
640-
print("\n\033[90mType your prompt • [Enter] create • [Esc] cancel • [Ctrl+C] quit\033[0m")
657+
print(f"\n{self._format_status_line('Type your prompt • [Enter] create • [Esc] cancel • [Ctrl+C] quit')}")
641658
elif self.show_action_menu:
642-
print("\n\033[90m[Enter] select • [↑↓] navigate • [C] close • [Q] quit\033[0m")
659+
print(f"\n{self._format_status_line('[Enter] select • [↑↓] navigate • [C] close • [Q] quit')}")
643660
elif self.current_tab == 0: # recents
644-
print("\n\033[90m[Tab] switch tabs • (↑↓) navigate • (←→) open/close • [Enter] actions • [R] refresh • [Q] quit\033[0m")
661+
print(f"\n{self._format_status_line('[Tab] switch tabs • (↑↓) navigate • (←→) open/close • [Enter] actions • [R] refresh • [Q] quit')}")
645662
elif self.current_tab == 1: # new
646-
print("\n\033[90m[Tab] switch tabs • [Enter] start typing • [Q] quit\033[0m")
663+
print(f"\n{self._format_status_line('[Tab] switch tabs • [Enter] start typing • [Q] quit')}")
647664
elif self.current_tab == 2: # web
648-
print("\n\033[90m[Tab] switch tabs • [Enter] open web • [Q] quit\033[0m")
665+
print(f"\n{self._format_status_line('[Tab] switch tabs • [Enter] open web • [Q] quit')}")
649666

650667
def run(self):
651668
"""Run the minimal TUI."""

0 commit comments

Comments
 (0)