You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exports[`ShellTool > getDescription > should return the non-windows description when not on windows 1`] =`
4
-
"Executes a given shell command (as \`bash -c <command>\`) in a persistent shell session with optional timeout, ensuring proper handling and security measures.
4
+
"Executes a given shell command (as \`bash -c <command>\`) in a subprocess with optional timeout, ensuring proper handling and security measures.
5
5
6
6
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.
7
7
@@ -17,7 +17,7 @@ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO N
17
17
- Edit files: Use edit (NOT sed/awk)
18
18
- Write files: Use write_file (NOT echo >/cat <<EOF)
19
19
- Communication: Output text directly (NOT echo/printf)
20
-
- **Shell argument quoting and special characters**: When passing arguments that contain special characters (parentheses \`()\`, backticks \`\`\`\`, dollar signs \`$\`, backslashes \`\\\`, semicolons \`;\`, pipes \`|\`, angle brackets \`<>\`, ampersands \`&\`, exclamation marks \`!\`, etc.), you MUST ensure they are properly quoted to prevent the shell from misinterpreting them as shell syntax:
20
+
- **Shell argument quoting and special characters**: The active shell is Bash. When passing arguments that contain special characters (parentheses \`()\`, backticks \`\`\`\`, dollar signs \`$\`, backslashes \`\\\`, semicolons \`;\`, pipes \`|\`, angle brackets \`<>\`, ampersands \`&\`, exclamation marks \`!\`, etc.), you MUST ensure they are properly quoted to prevent Bash from misinterpreting them as shell syntax:
21
21
- **Single quotes** \`'...'\` pass everything literally, but cannot contain a literal single quote.
22
22
- **ANSI-C quoting** \`$'...'\` supports escape sequences (e.g. \`\\n\` for newline, \`\\'\` for single quote) and is the safest approach for multi-line strings or strings with single quotes.
23
23
- **Heredoc** is the most robust approach for large, multi-line text with mixed quotes:
@@ -32,8 +32,8 @@ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO N
32
32
- When issuing multiple commands:
33
33
- If the commands are independent and can run in parallel, make multiple run_shell_command tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two run_shell_command tool calls in parallel.
34
34
- If the commands depend on each other and must run sequentially, use a single run_shell_command 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 run_shell_command for git operations, or git add before git commit), run these operations sequentially instead.
35
-
- Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
36
-
- DO NOT use newlines to separate commands (newlines are ok in quoted strings)
35
+
- Use ';' only when you need to run commands sequentially but don't care if earlier commands fail.
36
+
- DO NOT use newlines to separate commands (newlines are ok in quoted strings).
37
37
- Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of \`cd\`. You may use \`cd\` if the User explicitly requests it.
38
38
<good-example>
39
39
pytest /foo/bar/tests
@@ -62,7 +62,7 @@ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO N
62
62
`;
63
63
64
64
exports[`ShellTool > getDescription > should return the windows description when on windows 1`] = `
65
-
"Executes a given shell command (as \`cmd.exe /c <command>\`) in a persistent shell session with optional timeout, ensuring proper handling and security measures.
65
+
"Executes a given shell command (as \`cmd.exe /d /s /c <command>\`) in a subprocess with optional timeout, ensuring proper handling and security measures.
66
66
67
67
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.
68
68
@@ -78,23 +78,17 @@ IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO N
78
78
- Edit files: Use edit (NOT sed/awk)
79
79
- Write files: Use write_file (NOT echo >/cat <<EOF)
80
80
- Communication: Output text directly (NOT echo/printf)
81
-
- **Shell argument quoting and special characters**: When passing arguments that contain special characters (parentheses \`()\`, backticks \`\`\`\`, dollar signs \`$\`, backslashes \`\\\`, semicolons \`;\`, pipes \`|\`, angle brackets \`<>\`, ampersands \`&\`, exclamation marks \`!\`, etc.), you MUST ensure they are properly quoted to prevent the shell from misinterpreting them as shell syntax:
82
-
- **Single quotes** \`'...'\` pass everything literally, but cannot contain a literal single quote.
83
-
- **ANSI-C quoting** \`$'...'\` supports escape sequences (e.g. \`\\n\` for newline, \`\\'\` for single quote) and is the safest approach for multi-line strings or strings with single quotes.
84
-
- **Heredoc** is the most robust approach for large, multi-line text with mixed quotes:
85
-
\`\`\`bash
86
-
gh pr create --title "My Title" --body "$(cat <<'HEREDOC'
87
-
Multi-line body with (parentheses), \`backticks\`, and 'single-quotes'.
88
-
HEREDOC
89
-
)"
90
-
\`\`\`
91
-
- NEVER use unescaped single quotes inside single-quoted strings (e.g. \`'it\\'s'\` is wrong; use \`$'it\\'s'\` or \`"it's"\` instead).
92
-
- If unsure, prefer double-quoting arguments and escape inner double-quotes as \`\\"\`.
81
+
- **Shell argument quoting and special characters**: The active shell is cmd.exe. When passing arguments that contain special characters (parentheses \`()\`, backticks \`\`\`\`, dollar signs \`$\`, backslashes \`\\\`, semicolons \`;\`, pipes \`|\`, angle brackets \`<>\`, ampersands \`&\`, exclamation marks \`!\`, etc.), you MUST ensure they are properly quoted to prevent cmd.exe from misinterpreting them as shell syntax:
82
+
- Use double quotes around arguments that contain spaces or metacharacters.
83
+
- Escape literal cmd.exe metacharacters such as \`&\`, \`|\`, \`<\`, \`>\`, and \`^\` with caret (\`^\`).
84
+
- Single quotes do not quote arguments in cmd.exe.
85
+
- Be careful with \`%VAR%\` environment-variable expansion; avoid literal \`%...%\` unless expansion is intended.
86
+
- Do NOT use Bash-only forms such as ANSI-C quoting (\`$'...'\`) or Bash heredocs.
93
87
- When issuing multiple commands:
94
88
- If the commands are independent and can run in parallel, make multiple run_shell_command tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two run_shell_command tool calls in parallel.
95
-
- If the commands depend on each other and must run sequentially, use a single run_shell_command 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 run_shell_command for git operations, or git add before git commit), run these operations sequentially instead.
96
-
- Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
97
-
- DO NOT use newlines to separate commands (newlines are ok in quoted strings)
89
+
- If the commands depend on each other and must run sequentially, use a single run_shell_command call with '&&' to chain them together (e.g., \`git add . && git commit -m "message" && git push\`).
90
+
- Use '&' only when you need to run commands sequentially but don't care if earlier commands fail.
91
+
- DO NOT use ';' or newlines to separate commands in cmd.exe.
98
92
- Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of \`cd\`. You may use \`cd\` if the User explicitly requests it.
0 commit comments