Warning! This agent can execute bash commands, SQL queries, Python code, and modify files on your system. It is strongly recommended to run this inside a VM or Docker container to prevent accidental data loss.
You need to have Nix installed to run the agent script:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installSet your Anthropic API key and run the agent with Nix:
export ANTHROPIC_API_KEY=your-anthropic-key
nix run github:r33drichards/bash-agent#webagent -- --working-dir `pwd` --port 5556 --metadata-dir `pwd`/metarunning it locally
nix run .#webagent -- --working-dir `pwd` --port 5557 --metadata-dir `pwd`/meta --mcp example-mcp-config.json
sudo /nix/var/nix/profiles/default/bin/nix run 'github:numtide/system-manager' -- switch --flake 'github:robertwendt/bash-agent'running it locally
sudo /nix/var/nix/profiles/default/bin/nix run 'github:numtide/system-manager' -- switch --flake '.'
The agent launches an interactive loop where you can give it instructions. It has access to several tools:
- Bash Tool: Execute shell commands
- SQLite Tool: Query and modify SQLite databases
- IPython Tool: Execute Python code with access to common libraries
- File Editing Tools:
- Apply unified diffs to files
- Overwrite files with new content
Before executing any tool, the agent will:
- Show you what it's about to do
- Ask for confirmation
- For file edits, show a preview of the changes
Clone the repository:
git clone git@github.com:r33drichards/bash-agent.git
cd bash-agentInstall dependencies (recommended: use Nix):
nix developRun the agent:
export ANTHROPIC_API_KEY=your-anthropic-key
python agent.pyThis agent can:
- Execute arbitrary bash commands
- Run SQL queries on any SQLite database
- Execute Python code
- Modify or overwrite any file on your system
Use with caution and preferably in an isolated environment.