bash#
Build typed tools from annotations and docstrings. See the guide.
Run a shell command with captured output, in the working directory or in work_dir.
Parameters#
{
"additionalProperties": false,
"properties": {
"command": {
"minLength": 1,
"type": "string",
"description": "Shell command to execute."
},
"work_dir": {
"anyOf": [
{
"minLength": 1,
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Directory to run in: absolute, a `~` path, or relative to the working directory. Omit it to run in the working directory."
},
"timeout_seconds": {
"maximum": 600,
"minimum": 1,
"type": "integer",
"default": 60,
"description": "Maximum command runtime in seconds; the default is 60."
}
},
"required": [
"command"
],
"type": "object"
}
Model-facing snippet#
bash(command="git status --short", timeout_seconds=60)
bash(command="npm test", work_dir="clients/vscode")
Guidelines#
Use for builds, tests, git, and searching the code: rg or grep for text, find or ls for paths. Prefer read_file, write_file and edit for reading and changing a file.
Set work_dir instead of cd: every call starts a new shell, so a cd lasts only that one command.
Search with a narrow pattern and a path, and pipe through head when the result may be long.
Use only for bounded commands in a trusted working directory.
A non-zero exit code or a timeout is reported as an error carrying the output.
Output previews keep startup and final results within byte and line limits.
When output is truncated, read the retained files named in the hint.
- zett_agent.tools.shell.bash#
A tool is a name, an input schema, and an async callable.
- Parameters:
arguments (Mapping[str, Any])
- Return type:
Direct Python calls use await tool(arguments_mapping). The snippet
above describes model-facing invocation syntax, not the Python call signature.