@@ -402,7 +402,7 @@ def _create_background_agent(self, prompt: str):
402402 input ("Press Enter to continue..." )
403403 return
404404
405- print (f"\n 🔄 Creating agent run with prompt: '{ prompt [:50 ]} { '...' if len (prompt ) > 50 else '' } '" )
405+ print (f"\n \033 [90mCreating agent run with prompt: '{ prompt [:50 ]} { '...' if len (prompt ) > 50 else '' } '\033 [0m " )
406406
407407 try :
408408 payload = {"prompt" : prompt .strip ()}
@@ -420,10 +420,10 @@ def _create_background_agent(self, prompt: str):
420420 status = agent_run_data .get ("status" , "Unknown" )
421421 web_url = self ._generate_agent_url (run_id )
422422
423- print ("\n ✅ Agent run created successfully!" )
424- print (f" Run ID: { run_id } " )
425- print (f" Status: { status } " )
426- print (f" Web URL: { web_url } " )
423+ print ("\n \033 [90mAgent run created successfully!\033 [0m " )
424+ print (f"\033 [90m Run ID: { run_id } \033 [0m " )
425+ print (f"\033 [90m Status: { status } \033 [0m " )
426+ print (f"\033 [90m Web URL: \033 [38;2;255;202;133m { web_url } \033 [0m " )
427427
428428 # Clear the input
429429 self .prompt_input = ""
@@ -441,8 +441,8 @@ def _show_post_creation_menu(self, web_url: str):
441441 """Show menu after successful agent creation."""
442442 from codegen .cli .utils .inplace_print import inplace_print
443443
444- print ("\n What would you like to do next?" )
445- options = ["open in web preview " , "go to recent " ]
444+ print ("\n \033 [90mWhat would you like to do next?\033 [0m " )
445+ options = ["Open Trace ↗ " , "Go to Recent " ]
446446 selected = 0
447447 prev_lines = 0
448448
@@ -470,15 +470,15 @@ def build_lines():
470470 selected = (selected + 1 ) % len (options )
471471 prev_lines = inplace_print (build_lines (), prev_lines )
472472 elif key == "\r " or key == "\n " : # Enter - select option
473- if selected == 0 : # open in web preview
473+ if selected == 0 : # Open Trace
474474 try :
475475 import webbrowser
476476
477477 webbrowser .open (web_url )
478478 except Exception as e :
479479 print (f"\n ❌ Failed to open browser: { e } " )
480480 input ("Press Enter to continue..." )
481- elif selected == 1 : # go to recent
481+ elif selected == 1 : # Go to Recent
482482 self .current_tab = 0 # Switch to recent tab
483483 self .input_mode = False
484484 self ._load_agent_runs () # Refresh the data
@@ -884,8 +884,16 @@ def _clear_and_redraw(self):
884884 def run (self ):
885885 """Run the minimal TUI."""
886886 if not self .is_authenticated :
887- print ("⚠️ Not authenticated. Please run 'codegen login' first." )
888- return
887+ # Automatically start login flow for first-time users
888+ from codegen .cli .auth .login import login_routine
889+
890+ try :
891+ login_routine ()
892+ # login_routine will launch TUI after successful authentication
893+ return
894+ except Exception :
895+ # If login fails, just exit gracefully
896+ return
889897
890898 # Show UI immediately
891899 self ._clear_and_redraw ()
0 commit comments