commit 4c1f5482333f0c8c3d0ce3279f59a6037c98c9b1
parent 26ae5c282bafde789848edc05d2899ed828c9aaf
Author: Vineet Kumar <git@vineetk.net>
Date: Sun, 24 May 2026 14:22:37 -0400
fix quoting and casing
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/llm-tools.el b/llm-tools.el
@@ -60,9 +60,11 @@ final file."))
;; TODO edit_file (hashline + patch apply)
;; TODO bash_readonly (shell-command-to-string, whitelisted commands)
-;; TODO compile command (calls build system, doesn't need confirmation, whitelisted commands)
+;; TODO compile command (calls build system, doesn't neenfirmation, whitelisted commands)
;; bash (make-process, taken from gptel-agent)
+;; TODO refuse destructive operations like rm and dd, and refuse
+;; operations that have dedicated tool definitions like grep and compile
(defun llm-tools--execute-bash (callback command)
"Execute COMMAND asynchronously in bash and call CALLBACK with output.
@@ -89,7 +91,7 @@ COMMAND is the bash command string to execute."
proc))
(gptel-make-tool
- :name "Bash"
+ :name "bash"
:function #'llm-tools--execute-bash
:description "Execute Bash commands.
@@ -97,6 +99,7 @@ This tool provides access to a Bash shell with GNU coreutils (or
equivalents) available. Use this to inspect system state, run builds,
tests or other development or system administration tasks.
+TODO replace with saying do not use bash for operations that have equivalent tool definitions
Do NOT use this for file operations, finding, reading or editing files.
Use the provided file tools instead: `read_file`, `write_file`,
`edit_file`, `find_file`, `grep`.
@@ -104,11 +107,10 @@ Use the provided file tools instead: `read_file`, `write_file`,
- 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
-- For parallel commands, make multiple `Bash` calls in one message
+- For parallel commands, make multiple `bash` calls in one message
- Run tests, check your work or otherwise close the loop to verify changes you make.
EXAMPLES:
-- Find recent errors: 'grep -i error /var/log/app.log | tail -20'
- Check file type: 'file document.pdf'
- Count lines: 'wc -l *.txt'
@@ -134,7 +136,7 @@ Example: 'ls -la | head -20' or 'grep -i error app.log | tail -50'"))
:description "\
Recursively find all files in a given directory, excluding files within
.git directories. Returns a list of absolute file paths. Optionally
-accepts a pattern to filter file names (e.g., `*.el' for Emacs Lisp
+accepts a pattern to filter file names (e.g., '*.el' for Emacs Lisp
files). Use this to discover files in a project directory before reading
or editing them."
:args '((:name "directory"
@@ -142,7 +144,7 @@ or editing them."
:description "Path to the directory to be read, relative to the working directory.")
(:name "pattern"
:type string
- :description "Optional file name pattern to filter results, e.g. `*.el' or `*.txt'."
+ :description "Optional file name pattern to filter results, e.g. '*.el' or '*.txt'."
:optional t))
:async nil
:confirm nil