chore(loader): add logging for safe commands config loading

Add debug print statements to indicate when the safe commands config file
is successfully loaded or when falling back to the built-in list.
This commit is contained in:
Greg Gauthier 2026-03-07 18:32:43 +00:00
parent f9d99527e0
commit d74c613e0f

View File

@ -21,6 +21,7 @@ var safeCommands = sync.OnceValue(func() map[string]bool {
data, err := os.ReadFile(cfgPath)
if err != nil {
// Fallback to a built-in safe list
fmt.Println("Could not read safe shell commands config, using built-in fallback")
return map[string]bool{
"ls": true, "pwd": true, "cat": true, "tree": true,
"find": true, "grep": true, "rg": true,
@ -30,7 +31,9 @@ var safeCommands = sync.OnceValue(func() map[string]bool {
"pytest": true, "poetry run pytest": true, "ctest": true,
"python -m pytest": true, "python": true, "poetry": true,
}
}
fmt.Println("Using safe shell commands config:", cfgPath)
var cfg struct {
SafeCommands []string `yaml:"safe_commands"`