You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve all issues in PR #5491 - command whitelisting feature
- Fix hardcoded English strings by moving to translation files
- Add missing ARIA attributes for accessibility compliance
- Extract suggestion parsing logic to shared utils (src/shared/commandParsing.ts)
- Move pattern extraction logic to shared utils (src/shared/commandPatterns.ts)
- Extract CommandPatternSelector as a separate component for better modularity
- Consolidate message types to use 'allowedCommands' consistently
- Update tests to match new implementation
All linters and tests now pass successfully.
Description: Request to execute a CLI command on the system. Use this when you need to perform system operations or run specific commands to accomplish any step in the user's task. You must tailor your command to the user's system and provide a clear explanation of what the command does. For command chaining, use the appropriate chaining syntax for the user's shell. Prefer to execute complex CLI commands over creating executable scripts, as they are more flexible and easier to run. Prefer relative commands and paths that avoid location sensitivity for terminal consistency, e.g: \`touch ./testdata/example.file\`, \`dir ./examples/model1/data/yaml\`, or \`go test ./cmd/front --config ./cmd/front/config.yml\`. If directed by the user, you may open a terminal in a different directory by using the \`cwd\` parameter.
6
+
7
+
**IMPORTANT: When executing commands that match common patterns (like npm, git, ls, etc.), you SHOULD provide suggestions for whitelisting. This allows users to auto-approve similar commands in the future.**
8
+
6
9
Parameters:
7
10
- command: (required) The CLI command to execute. This should be valid for the current operating system. Ensure the command is properly formatted and does not contain any harmful instructions.
8
11
- cwd: (optional) The working directory to execute the command in (default: ${args.cwd})
12
+
- suggestions: (optional) An array of safe command patterns that the user can whitelist for automatic approval in the future. Each suggestion should be a pattern that can match similar commands. When the command matches common development patterns, you SHOULD include relevant suggestions. Format each suggestion using <suggest> tags.
13
+
14
+
**Whitelisting Guidelines:**
15
+
- Include suggestions when executing common development commands (npm, git, ls, cd, etc.)
16
+
- Suggestions use prefix matching: any command that starts with the suggestion will be auto-approved
17
+
- The special pattern "*" allows ALL commands (use with caution)
0 commit comments