summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVineet Kumar <git@vineetk.net>2026-05-24 14:22:37 -0400
committerVineet Kumar <git@vineetk.net>2026-05-24 14:36:14 -0400
commit4c1f5482333f0c8c3d0ce3279f59a6037c98c9b1 (patch)
tree29966df905a4d6ff27a57d0b63ddac02ddcc3c9e
parent26ae5c282bafde789848edc05d2899ed828c9aaf (diff)
fix quoting and casing
-rw-r--r--llm-tools.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/llm-tools.el b/llm-tools.el
index a125e55..2218ab8 100644
--- a/llm-tools.el
+++ b/llm-tools.el
@@ -60,9 +60,11 @@ final file."))
60;; TODO edit_file (hashline + patch apply) 60;; TODO edit_file (hashline + patch apply)
61 61
62;; TODO bash_readonly (shell-command-to-string, whitelisted commands) 62;; TODO bash_readonly (shell-command-to-string, whitelisted commands)
63;; TODO compile command (calls build system, doesn't need confirmation, whitelisted commands) 63;; TODO compile command (calls build system, doesn't neenfirmation, whitelisted commands)
64 64
65;; bash (make-process, taken from gptel-agent) 65;; bash (make-process, taken from gptel-agent)
66;; TODO refuse destructive operations like rm and dd, and refuse
67;; operations that have dedicated tool definitions like grep and compile
66(defun llm-tools--execute-bash (callback command) 68(defun llm-tools--execute-bash (callback command)
67 "Execute COMMAND asynchronously in bash and call CALLBACK with output. 69 "Execute COMMAND asynchronously in bash and call CALLBACK with output.
68 70
@@ -89,7 +91,7 @@ COMMAND is the bash command string to execute."
89 proc)) 91 proc))
90 92
91(gptel-make-tool 93(gptel-make-tool
92 :name "Bash" 94 :name "bash"
93 :function #'llm-tools--execute-bash 95 :function #'llm-tools--execute-bash
94 :description "Execute Bash commands. 96 :description "Execute Bash commands.
95 97
@@ -97,6 +99,7 @@ This tool provides access to a Bash shell with GNU coreutils (or
97equivalents) available. Use this to inspect system state, run builds, 99equivalents) available. Use this to inspect system state, run builds,
98tests or other development or system administration tasks. 100tests or other development or system administration tasks.
99 101
102TODO replace with saying do not use bash for operations that have equivalent tool definitions
100Do NOT use this for file operations, finding, reading or editing files. 103Do NOT use this for file operations, finding, reading or editing files.
101Use the provided file tools instead: `read_file`, `write_file`, 104Use the provided file tools instead: `read_file`, `write_file`,
102`edit_file`, `find_file`, `grep`. 105`edit_file`, `find_file`, `grep`.
@@ -104,11 +107,10 @@ Use the provided file tools instead: `read_file`, `write_file`,
104- Quote file paths with spaces using double quotes. 107- Quote file paths with spaces using double quotes.
105- Chain dependent commands with && (or ; if failures are OK) 108- Chain dependent commands with && (or ; if failures are OK)
106- Use absolute paths instead of cd when possible 109- Use absolute paths instead of cd when possible
107- For parallel commands, make multiple `Bash` calls in one message 110- For parallel commands, make multiple `bash` calls in one message
108- Run tests, check your work or otherwise close the loop to verify changes you make. 111- Run tests, check your work or otherwise close the loop to verify changes you make.
109 112
110EXAMPLES: 113EXAMPLES:
111- Find recent errors: 'grep -i error /var/log/app.log | tail -20'
112- Check file type: 'file document.pdf' 114- Check file type: 'file document.pdf'
113- Count lines: 'wc -l *.txt' 115- Count lines: 'wc -l *.txt'
114 116
@@ -134,7 +136,7 @@ Example: 'ls -la | head -20' or 'grep -i error app.log | tail -50'"))
134 :description "\ 136 :description "\
135Recursively find all files in a given directory, excluding files within 137Recursively find all files in a given directory, excluding files within
136.git directories. Returns a list of absolute file paths. Optionally 138.git directories. Returns a list of absolute file paths. Optionally
137accepts a pattern to filter file names (e.g., `*.el' for Emacs Lisp 139accepts a pattern to filter file names (e.g., '*.el' for Emacs Lisp
138files). Use this to discover files in a project directory before reading 140files). Use this to discover files in a project directory before reading
139or editing them." 141or editing them."
140 :args '((:name "directory" 142 :args '((:name "directory"
@@ -142,7 +144,7 @@ or editing them."
142 :description "Path to the directory to be read, relative to the working directory.") 144 :description "Path to the directory to be read, relative to the working directory.")
143 (:name "pattern" 145 (:name "pattern"
144 :type string 146 :type string
145 :description "Optional file name pattern to filter results, e.g. `*.el' or `*.txt'." 147 :description "Optional file name pattern to filter results, e.g. '*.el' or '*.txt'."
146 :optional t)) 148 :optional t))
147 :async nil 149 :async nil
148 :confirm nil 150 :confirm nil