Overview
Shell tool allows you to execute shell commands from your AI agents. Use with caution! The user asks to run a command; the agent executes it in the shell and returns the output.Installation
Quick Start
Usage with Agent
Available Methods
execute(command)
Execute a shell command.Security Warning
⚠️ Use with caution! Shell commands can be dangerous. Consider:- Restricting allowed commands
- Running in sandboxed environments
- Validating user input
Common Errors
| Error | Cause | Solution |
|---|---|---|
Command not found | Invalid command | Check command exists |
Permission denied | Insufficient permissions | Check file permissions |
How It Works
Best Practices
Allowlist commands
Allowlist commands
Restrict the agent to a known set of safe commands rather than arbitrary shell access.
Never interpolate untrusted input
Never interpolate untrusted input
Build commands from validated arguments to avoid injection.
Set timeouts
Set timeouts
Bound command execution so a hung process doesn’t stall the agent.
Related Tools
Python
Execute Python code
Docker
Container management

