From b289ee4ddbcd791f23537e9a7ad1cc2c1f839eda Mon Sep 17 00:00:00 2001 From: Vineet Kumar Date: Tue, 26 May 2026 00:44:46 -0400 Subject: update bash tool to explicitly mention the other tools the llm otherwise could rationalize to use bash otherwise since it was initially vague --- llm-tools.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/llm-tools.el b/llm-tools.el index 79aff59..c0f859e 100644 --- a/llm-tools.el +++ b/llm-tools.el @@ -271,7 +271,7 @@ COMMAND is the bash command string to execute." "\\bmkfs\\b" "\\bsudo\\b" "\\bdoas\\b" - "[^>]>[^>]" ; any singular > that isn't >> + "[^>]>[^>&0-9]" ; any singular > that isn't >> nor file-descriptor redirect "\\$(" "`" "|[ \t]*\\bsh\\b" @@ -292,6 +292,13 @@ tests or other development or system administration tasks. Use the dedicated tools for file operations, searching, and code navigation instead of shell commands. +- For file contents: use `read_file` or `web_fetch` +- For file discovery/metadata: use `find_files` +- For searching text in files: use `grep` +- For editing files: use `edit_file` or `write_file` + +Bash should be a last resort, used only when no other tool fits the task. + - Quote file paths with spaces using double quotes. - Chain dependent commands with && (or ; if failures are OK) - Use absolute paths instead of cd when possible @@ -302,8 +309,8 @@ EXAMPLES: - Check file type: 'file document.pdf' - Count lines: 'wc -l *.txt' -The command will be executed in the current working directory. Output is -returned as a string. Long outputs should be filtered/limited using pipes." +The command will be executed in the current working directory. Output is +returned as a string. Long outputs should be filtered/limited using pipes." :args '((:name "command" :type string :description "The Bash command to execute.\ -- cgit v1.2.3