Unfortunately, Command Allowlist currently doesn’t support regex or wildcard patterns, only exact command matches.
Possible workarounds:
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.
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.