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

# Shell

**ShellTools** 允许 Agent 与 shell 交互以运行命令。

## 示例

以下 Agent 将运行一个 shell 命令，并显示当前目录的内容。

<Note>
  请告知 Agent 您的操作系统，以确保它运行正确的命令。
</Note>

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

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

## 工具包中的函数

| Function            | Description            |
| ------------------- | ---------------------- |
| `run_shell_command` | 运行一个 shell 命令并返回输出或错误。 |

## 开发者资源

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