> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Shell

> Run shell commands from an agent with ShellTools.run_shell_command().

**ShellTools** enable an Agent to interact with the shell to run commands.

## Example

The following agent will run a shell command and show contents of the current directory.

> [!NOTE]
>
> Mention your OS to the agent to make sure it runs the correct command.

```python cookbook/91_tools/shell_tools.py theme={null}
from agno.agent import Agent
from agno.tools.shell import ShellTools

agent = Agent(tools=[ShellTools()])
agent.print_response("Show me the contents of the current directory", markdown=True)
```

> [!WARNING]
>
> `ShellTools` runs any command the model constructs, with no allowlist or confirmation gate. Setting `base_dir` only sets the working directory for the command; it does not restrict what the command can access. Keep human supervision for untrusted prompts, and run inside a sandbox (container, VM, or [Daytona](https://agno-v2.mintlify.site/tools/toolkits/others/daytona.md)) for untrusted code execution.

## Toolkit Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `base_dir` | `Optional[Union[Path, str]]` | `None` | Base directory for shell command execution |
| `enable_run_shell_command` | `bool` | `True` | Enables functionality to run shell commands |
| `all` | `bool` | `False` | Enables all functionality when set to True |

## Toolkit Functions

| Function | Description |
| - | - |
| `run_shell_command` | Runs a shell command and returns the output or error. |

## Developer Resources

* [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/shell.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.