commit 6c7efb82cfa7273da7366277a4064d1aa5dc6a2b
parent 2c76620e87779b0dcb0e8d9b704e72bb1e152376
Author: Vineet Kumar <git@vineetk.net>
Date: Thu, 22 Oct 2026 16:11:53 +0200
let bash tool use null-redirection and stderr->stdout redirection without confirmation
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/llm-tools.el b/llm-tools.el
@@ -172,14 +172,18 @@ COMMAND is the bash command string to execute."
"`"
"|[ \t]*\\bsh\\b"
"|[ \t]*\\bbash\\b")))
- (cl-some (lambda (regexp)
- (string-match-p regexp command))
- destructive)))
+ (let ((command
+ (replace-regexp-in-string
+ ">[ \t]*/dev/null\\([ \t\n;&|]\\|\\'\\)"
+ "\\1" command t)))
+ (cl-some (lambda (regexp)
+ (string-match-p regexp command))
+ destructive))))
(gptel-make-tool
:name "bash"
:function #'llm-tools--execute-bash
- :description "Execute Bash commands.
+ :description "Run builds, tests, programs, and inspect system state.
This tool provides access to a Bash shell with GNU coreutils (or
equivalents) available. Use this to inspect system state, run builds,