Is there a way to whitelist commands in regex like way

So basically I have a lot of commands like this
cd /folder && bundle exec rails test

If i whitelist cd then any cmd that start with cd will run.
If I don’t whitelist cd but white list the bundle exec rails test it will not run

Is there a way to do something like this ?

cd * && bundle exec rails test

1 Like

Hey, good question.

Unfortunately, Command Allowlist currently doesn’t support regex or wildcard patterns, only exact command matches.

Possible workarounds:

  1. Sandbox Mode: If “Run in Sandbox” is enabled (Cursor Settings → Agents → Auto-Run), commands will run automatically in a sandbox without manual approval. This works for most commands, including your bundle exec rails test.

  2. Create an alias: You can create a shell alias like railstest that runs cd /folder && bundle exec rails test, then add that alias to the allowlist.

If you’d like regex or wildcard support, you can leave a feature request.