|
1 | | -Executes a given bash command in a fresh shell session with optional timeout, ensuring proper handling and security measures. |
2 | | - |
3 | | -All commands run in ${directory} by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID using `cd <directory> && <command>` patterns - use `workdir` instead. |
4 | | - |
5 | | -When searching for text or files, prefer using rg or rg --files respectively because rg is much faster than alternatives like grep. (If the rg command is not found, then use alternatives.) |
6 | | - |
7 | | -1. Directory Verification: |
8 | | - - If the command will create new directories or files, first use `ls` to verify the parent directory exists and is the correct location |
9 | | - - For example, before running "mkdir foo/bar", first use `ls foo` to check that "foo" exists and is the intended parent directory |
10 | | - |
11 | | -2. Command Execution: |
12 | | - - Always quote file paths that contain spaces with double quotes (e.g., rm "path with spaces/file.txt") |
13 | | - - Examples of proper quoting: |
14 | | - - mkdir "/Users/name/My Documents" (correct) |
15 | | - - mkdir /Users/name/My Documents (incorrect - will fail) |
16 | | - - python "/path/with spaces/script.py" (correct) |
17 | | - - python /path/with spaces/script.py (incorrect - will fail) |
18 | | - - After ensuring proper quoting, execute the command. |
19 | | - - Capture the output of the command. |
20 | | - |
21 | | -Usage notes: |
22 | | - - The command argument is required. |
23 | | - - You can specify an optional timeout in milliseconds. If not specified, commands will time out after 120000ms (2 minutes). |
24 | | - - If the output exceeds ${maxLines} lines or ${maxBytes} bytes, it will be truncated and the full output will be written to a file. Inspect only relevant sections and prefer rg for search when available. Because of this, you do NOT need to use `head`, `tail`, or other truncation commands to limit output - just run the command directly. |
| 1 | +Run a shell command. All commands run in ${directory} by default. Use `workdir` to run in a different directory. |
| 2 | +Prefer `rg` for searching text/files. Output is truncated at ${maxLines} lines or ${maxBytes} bytes. |
0 commit comments