agent harness initialize repo
This commit is contained in:
12
agent-with-tools/tools/shell.py
Normal file
12
agent-with-tools/tools/shell.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def run_bash(command: str) -> str:
|
||||
"""Run a bash command and return its output."""
|
||||
result = subprocess.run(
|
||||
command, shell=True, text=True, capture_output=True
|
||||
)
|
||||
output = result.stdout
|
||||
if result.stderr:
|
||||
output += f"\nSTDERR:\n{result.stderr}"
|
||||
return output or "(no output)"
|
||||
Reference in New Issue
Block a user