diff --git a/interpreter/terminal_interface/cli.py b/interpreter/terminal_interface/cli.py deleted file mode 100644 index f00c065f95..0000000000 --- a/interpreter/terminal_interface/cli.py +++ /dev/null @@ -1,11 +0,0 @@ -# cli.py -from ..core.core import OpenInterpreter -from .start_terminal_interface import start_terminal_interface - - -def main(): - interpreter = OpenInterpreter() - try: - start_terminal_interface(interpreter) - except KeyboardInterrupt: - print("Exited.") diff --git a/interpreter/terminal_interface/start_terminal_interface.py b/interpreter/terminal_interface/start_terminal_interface.py index 2ef186eb89..4d4ea09b84 100644 --- a/interpreter/terminal_interface/start_terminal_interface.py +++ b/interpreter/terminal_interface/start_terminal_interface.py @@ -7,6 +7,7 @@ import pkg_resources +from ..core.core import OpenInterpreter from .conversation_navigator import conversation_navigator from .utils.apply_config import apply_config from .utils.check_for_update import check_for_update @@ -689,3 +690,15 @@ def start_terminal_interface(interpreter): interpreter.in_terminal_interface = True interpreter.chat() + + +def main(): + interpreter = OpenInterpreter() + try: + start_terminal_interface(interpreter) + except KeyboardInterrupt as e: + print("Interrupted by user:", e) + except Exception as e: + print("An error occurred:", e) + finally: + print("Closing the program.") diff --git a/pyproject.toml b/pyproject.toml index 17eae2512e..4cc5ed73e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,8 +57,8 @@ requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] -interpreter = "interpreter.terminal_interface.cli:main" -i = "interpreter.terminal_interface.cli:main" +interpreter = "interpreter.terminal_interface.start_terminal_interface:main" +i = "interpreter.terminal_interface.start_terminal_interface:main" [tool.black] target-version = ['py311']