Bash Wildcard Permissions

Bash Wildcard Permissions

Bash permission rules support glob patterns with *. Wildcards can appear at any position in the command.

{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git commit *)",
      "Bash(git * main)",
      "Bash(* --version)",
      "Bash(* --help *)"
    ],
    "deny": ["Bash(git push *)"]
  }
}

Spaces matter! Bash(ls *) matches ls -la but not lsof.

Related: Permission Rules