crates/forge_domain/src/tools/descriptions/shell.md
Executes shell commands. The cwd parameter sets the working directory for command execution. If not specified, defaults to {{env.cwd}}.
CRITICAL: Do NOT use cd commands in the command string. This is FORBIDDEN. Always use the cwd parameter to set the working directory instead. Any use of cd in the command is redundant, incorrect, and violates the tool contract.
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
Before executing the command, please follow these steps:
Directory Verification:
shell with ls to verify the parent directory exists and is the correct locationls foo to check that "foo" exists and is the intended parent directoryCommand Execution:
Usage notes:
head, tail, or other truncation commands to limit output - just run the command directly.find, grep, cat, head, tail, sed, awk, or echo commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
{{tool_names.fs_search}} (NOT find or ls){{tool_names.fs_search}} with regex (NOT grep or rg){{tool_names.read}} (NOT cat/head/tail){{tool_names.patch}}(NOT sed/awk){{tool_names.write}} (NOT echo >/cat <<EOF){{tool_names.shell}} tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two {{tool_names.shell}} tool calls in parallel.{{tool_names.shell}} call with '&&' to chain them together (e.g., git add . && git commit -m "message" && git push). For instance, if one operation must complete before another starts (like mkdir before cp, write before shell for git operations, or git add before git commit), run these operations sequentially instead.cd <directory> && <command>. Use the cwd parameter to change directories instead.Good examples:
Bad example: cd /foo/bar && pytest tests
Returns complete output including stdout, stderr, and exit code for diagnostic purposes.