Forked from lmbimmerboye/shell-command-runner
README.md
An LM Studio plugin that enables AI models to execute shell commands with comprehensive security controls.
rm -rf /, shutdown, sudo, dd if=/dev/zerogit, npm, ls, cat (comma-separated)..)When enabled, the plugin validates commands against all security checks but never executes them. Returns:
"COMMAND ALLOWED: The command '...' passes all security checks." if all checks passTest mode works independently of "Allow Automatic Execution" - it runs AFTER security checks complete.
Executes shell commands with full security validation.
Parameters:
command (string): The command to executecwd (optional string): Subdirectory to run in (must be inside sandbox)timeout (optional number): Execution timeout in millisecondsReturns: Command output, errors, or security rejection messages
Retrieves current allowed commands configuration.
Parameters: None
Returns: List of whitelisted commands with count, or status if whitelist not active
Retrieves current forbidden commands configuration.
Parameters: None
Returns: List of blacklisted commands with count
| Setting | Type | Default | Description |
|---|---|---|---|
| Operating System | Select | Windows | Target shell: Windows (CMD) or Linux/macOS (Bash) |
| Sandbox / Project Root | String | Empty | Absolute path for sandbox restriction |
| Execution Policy | Select | Allow All | Filter mode: Allow All or Allow Only |
| Allowed Commands | String | Empty | Comma-separated whitelist (Allow Only mode only) |
| Forbidden Commands | String | Empty | Comma-separated blacklist (applies to both modes) |
| Environment PATH Extensions | String | Empty | Additional paths to add to system PATH |
| Timeout (ms) | Numeric | 15000 | Maximum command execution time |
| Allow Automatic Execution | Boolean | false | Master switch for command execution |
| Test Mode (Dry Run) | Boolean | false | Validate without executing |
When Test Mode is enabled:
get_whitelist tool - Retrieves current whitelist configurationget_blacklist tool - Retrieves current blacklist configurationls -la ./project/
# Runs in project/src/ subdirectory
command: "npm run build"
cwd: "project/src"