fix: enhance command retrieval in runCommand function

This commit is contained in:
Cheikh Seck committed 2026-06-06 14:46:59 +00:00
1 parent 5e85904f78
commit 86b506765c
1 file changed
+6 -1
+6 -1
View File
@@ -346,7 +346,12 @@ func (s *BashServer) isPathAllowed(path string) bool {
func (s *BashServer) runCommand(ctx context.Context, args map[string]any) (string, error) {
command, ok := args["command"].(string)
if !ok {
return "", fmt.Errorf("command is required")
command, ok = args["cmd"].(string)
if !ok {
return "", fmt.Errorf("command is required")
}
}
if !s.isCommandAllowed(command) {