Skip to main content

Overview

Attaching BashTool directly to AgentLoop gives the agent the ability to execute shell commands. This is useful for system administration tasks, running scripts, or gathering system information. The agent decides which commands to run based on the task. Key concepts:
  • AgentLoop::withTool(): Adds a tool directly to the loop
  • BashTool: Executes shell commands with configurable sandboxing
  • The agent autonomously decides which commands to run
  • AgentEventConsoleObserver: Shows tool arguments including executed commands

Example