Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agno.com/llms.txt

Use this file to discover all available pages before exploring further.

CodingTools is a minimal toolkit for coding agents. Four core tools (read, edit, write, shell) let an agent run tests, use git, install packages, and edit code. Three exploration tools (grep, find, ls) are opt-in.

Example

cookbook/91_tools/coding_tools/01_basic_usage.py
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.coding import CodingTools

agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    tools=[CodingTools(base_dir=".")],
    instructions="You are a coding assistant. Use the coding tools to help the user.",
    markdown=True,
)

agent.print_response(
    "List the files in the current directory and read the README.md file if it exists.",
    stream=True,
)
CodingTools can run arbitrary shell commands. By default restrict_to_base_dir=True scopes file and shell operations to base_dir and only allows commands in allowed_commands. Keep human supervision for untrusted prompts, and run inside a sandbox (container, VM, or Daytona) for untrusted code execution.

Toolkit Params

ParameterTypeDefaultDescription
base_dirOptional[Path|str]cwdRoot directory for file operations.
restrict_to_base_dirboolTrueWhen True, file and shell operations cannot escape base_dir.
max_linesint2000Maximum lines returned before truncating.
max_bytesint50000Maximum bytes returned before truncating.
shell_timeoutint120Timeout in seconds for shell commands.
enable_read_fileboolTrueEnable the read_file tool.
enable_edit_fileboolTrueEnable the edit_file tool.
enable_write_fileboolTrueEnable the write_file tool.
enable_run_shellboolTrueEnable the run_shell tool.
enable_grepboolFalseEnable the grep tool.
enable_findboolFalseEnable the find tool.
enable_lsboolFalseEnable the ls tool.
allboolFalseEnable all tools regardless of individual flags.
allowed_commandsOptional[List[str]]sensible setAllowed shell command names when restrict_to_base_dir is True.

Toolkit Functions

FunctionDescription
read_fileRead a file with line numbers and pagination (offset, limit).
edit_fileExact text find-and-replace, returns a diff.
write_fileCreate or overwrite a file.
run_shellExecute a shell command with a timeout.
grepSearch file contents (opt-in).
findFind files by glob pattern (opt-in).
lsList directory contents (opt-in).
All functions have sync and async variants.

Developer Resources