diff --git a/packages/opencode/src/tool/shell/prompt.ts b/packages/opencode/src/tool/shell/prompt.ts index 701e995ea4..000d844419 100644 --- a/packages/opencode/src/tool/shell/prompt.ts +++ b/packages/opencode/src/tool/shell/prompt.ts @@ -85,6 +85,7 @@ function chainGuidance(name: string) { return "If the commands depend on each other and must run sequentially, use a single Bash 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 Bash for git operations, or git add before git commit), run these operations sequentially instead." } +// kilocode_change start function bashCommandSection(chain: string, limits: Limits) { return `Before executing the command, please follow these steps: @@ -108,7 +109,7 @@ Usage notes: - It is very helpful if you write a clear, concise description of what this command does in 5-10 words. - If the output exceeds ${limits.maxLines} lines or ${limits.maxBytes} bytes, it will be truncated and the full output will be written to a file. You can use Read with offset/limit to read specific sections or Grep to search the full content. Do NOT use \`head\`, \`tail\`, or other truncation commands to limit output; the full output will already be captured to a file for more precise searching. - - Avoid using Bash with the \`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: + - Avoid using the shell with the \`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: - File search: Use Glob (NOT find or ls) - Content search: Use Grep (NOT grep or rg) - Read files: Use Read (NOT cat/head/tail) @@ -128,6 +129,7 @@ Usage notes: cd /foo/bar && pytest tests ` } +// kilocode_change end function powershellCommandSection(name: string, chain: string, pathSep: string, limits: Limits) { return `${powershellNotes(name)} @@ -258,8 +260,10 @@ function profile(name: string, platform: NodeJS.Platform, limits: Limits) { } } return { + // kilocode_change start intro: - "Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.", + "Executes a given command in a persistent shell session with optional timeout, ensuring proper handling and security measures.", + // kilocode_change end workdirSection: "All commands run in the current working directory by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID using `cd && ` patterns - use `workdir` instead.", commandSection: bashCommandSection(chain, limits),