Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

Rename command & functions to execute_shell

Bernhard Mueller3ff23234507b
diff --git a/scripts/commands.py b/scripts/commands.py
index d760e4776c..3966e86ab8 100644
--- a/scripts/commands.py
+++ b/scripts/commands.py
@@ -7,7 +7,7 @@ import speak
from config import Config
import ai_functions as ai
from file_operations import read_file, write_to_file, append_to_file, delete_file, search_files
-from execute_code import execute_python_file, exec_shell
+from execute_code import execute_python_file, execute_shell
from json_parser import fix_and_parse_json
from image_gen import generate_image
from duckduckgo_search import ddg
@@ -103,9 +103,9 @@ def execute_command(command_name, arguments):
return ai.write_tests(arguments["code"], arguments.get("focus"))
elif command_name == "execute_python_file": # Add this command
return execute_python_file(arguments["file"])
- elif command_name == "exec_shell":
+ elif command_name == "execute_shell":
if cfg.execute_local_commands:
- return exec_shell(arguments["command_line"])
+ return execute_shell(arguments["command_line"])
else:
return "You are not allowed to run local shell commands. To execute shell commands, EXECUTE_LOCAL_COMMANDS must be set to 'True' in your config. Do not attempt to bypass the restriction."
elif command_name == "generate_image":
diff --git a/scripts/data/prompt.txt b/scripts/data/prompt.txt
index 4484108b70..ffb9eb5003 100644
--- a/scripts/data/prompt.txt
+++ b/scripts/data/prompt.txt
@@ -22,7 +22,7 @@ COMMANDS:
16. Get Improved Code: "improve_code", args: "suggestions": "<list_of_suggestions>", "code": "<full_code_string>"
17. Write Tests: "write_tests", args: "code": "<full_code_string>", "focus": "<list_of_focus_areas>"
18. Execute Python File: "execute_python_file", args: "file": "<file>"
-19. Execute Shell Command, non-interactive commands only: "exec_shell", args: "command_line": "<command_line>".
+19. Execute Shell Command, non-interactive commands only: "execute_shell", args: "command_line": "<command_line>".
20. Task Complete (Shutdown): "task_complete", args: "reason": "<reason>"
21. Generate Image: "generate_image", args: "prompt": "<prompt>"
22. Do Nothing: "do_nothing", args: ""
diff --git a/scripts/execute_code.py b/scripts/execute_code.py
index 184132500f..fa55a7f75e 100644
--- a/scripts/execute_code.py
+++ b/scripts/execute_code.py
@@ -52,7 +52,7 @@ def execute_python_file(file):
-def exec_shell(command_line):
+def execute_shell(command_line):
old_dir = os.getcwd()