LocalShellTool
autogen.beta.tools.shell.tool.LocalShellTool #
Bases: Tool
The tool exposes a single shell function that runs commands in whatever environment is provided — local subprocess, Docker container, SSH, etc. All execution details are encapsulated inside the environment.
| PARAMETER | DESCRIPTION |
|---|---|
environment | The execution environment, a path to a working directory, or TYPE: |
Examples::
# Auto temp dir — cleaned up on exit
sh = LocalShellTool()
# Pass a path directly — creates LocalShellEnvironment for you
sh = LocalShellTool("/tmp/my_project")
sh = LocalShellTool(Path("/tmp/my_project"))
# Full control via explicit environment
sh = LocalShellTool(LocalShellEnvironment(path="/tmp/my_project"))
# Read-only local inspection
sh = LocalShellTool(LocalShellEnvironment(path="/tmp/my_project", readonly=True))
# Future: Docker or SSH (not yet implemented)
# sh = LocalShellTool(DockerEnvironment(image="python:3.12"))
# sh = LocalShellTool(SSHEnvironment(host="server.com", user="ubuntu"))