Skip to main content

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

1

Simple Usage

2

With Configuration

Use the same tool with an agent — see Usage with Agent below, or pass env vars and options from the sections above.

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

How It Works


Best Practices

Restrict the agent to a known set of safe commands rather than arbitrary shell access.
Build commands from validated arguments to avoid injection.
Bound command execution so a hung process doesn’t stall the agent.

Python

Execute Python code

Docker

Container management