@@ -32,8 +32,7 @@ def main():
3232 if len (prompt ) + len (user_input ) > columns :
3333 print () # Move to the next line if input is too long
3434
35- # Support both 'quit' and 'exit' commands to terminate the REPL session
36- if user_input .lower () in ('quit' , 'exit' ):
35+ if user_input .lower () in ('quit' , 'exit' ):
3736 print (format_text ('red' , bold = True ) + "\n Terminating..." + reset_format ())
3837 break
3938
@@ -50,30 +49,12 @@ def main():
5049- Start your input with '!' to execute a command directly without processing.
5150- Start or end your input with '?' to ask a question.
5251- Tab completion for files and folders is enabled.
53- - Use 'Ctrl + c' or type 'quit' or 'exit' to quit the assistant.
52+ -Use 'Ctrl + c' or type 'quit' or 'exit' to quit and exit the assistant.
5453- Type 'clear' to clear the terminal.{ reset_format ()} """ )
5554 continue
5655
57- # ✅ Check for destructive command
58- if user_input .startswith ("CONFIRM:" ):
59- actual_command = user_input .replace ("CONFIRM:" , "" , 1 ).strip ()
60-
61- # Step 1: Initial yes/no confirmation
62- proceed = input (format_text ('yellow' , bold = True ) + f"\n ⚠️ This is a destructive command.\n Do you want to continue? (yes/no): " + reset_format ())
63- if proceed .strip ().lower () != "yes" :
64- print (format_text ('red' , bold = True ) + "\n Command aborted by user." + reset_format ())
65- continue
66-
67- # Step 2: Manual re-entry for safety
68- confirm_input = input (format_text ('yellow' , bold = True ) + f"Type the exact command to proceed:\n > " + reset_format ())
69- if confirm_input .strip () != actual_command :
70- print (format_text ('red' , bold = True ) + "\n ❌ Mismatch. Aborting execution!" + reset_format ())
71- continue
72-
73- # If matched, allow execution
74- user_input = actual_command
75-
76- result = assistant .execute_command (user_input ) # Execute the command using the assistant
56+ result = assistant .execute_command (user_input )
57+ print (result )
7758
7859 except KeyboardInterrupt :
7960 print (format_text ('red' , bold = True ) + "\n Terminating..." + reset_format ())
0 commit comments