README
A powerful terminal plugin for LM Studio with enhanced security, comprehensive system tools, and a unified toolset.
| Tool | Description |
|---|---|
shell_exec | Execute a shell command with sanitisation, retry, and configurable timeout |
run_process | Spawn a process with arguments (no shell interpreter) |
file_write | Write content to a file (creates directories automatically) |
read_file | Read file contents |
file_diff | Compare two files (unified diff format, pure JS LCS/Myers algorithm) |
file_checksum | Calculate SHA256 or MD5 checksum |
file_stats | Get file metadata (size, modified, permissions, type) |
list_directory | List directory contents with metadata |
create_directory | Create directories (recursive by default) |
delete_file | Delete a file or directory (auto-detects type) |
delete_directory | Delete a directory and contents |
system_info | Comprehensive system diagnostics (CPU, memory, uptime, load avg) |
list_processes | List running processes with PID, CPU%, memory, status |
kill_process | Terminate a process by PID (validated, no shell injection) |
check_network | DNS + TCP connectivity check with latency reporting |
get_network_info | Get network interface information |
get_disk_info | Get disk/volume information |
zip_create | Create a .zip archive (pure JS, no external deps) |
zip_extract | Extract a .zip archive (pure JS) |
zip_list | List contents of a .zip archive (pure JS) |
replace_text | Find and replace text within a file (regex support) |
count_text | Count occurrences of text or regex patterns in a file |
insert_text | Insert text at a specific line in a file |
delete_lines | Delete a range of lines from a file |
cd "C:\LM Studio DATABASE\terminal" npm install npm run build
.. traversal and null byteskill_process validates PID is a positive integer and uses runProcess with array args (no shell)check_network escapes single quotes in hostnames| Setting | Description | Default |
|---|---|---|
defaultShell | Default shell | powershell |
defaultTimeoutMs | Default command timeout | 30,000 ms |
maxOutputBytes | Maximum output size | 10 MB |
maxConcurrentExecutions | Max concurrent executions | 4 |
logLevel | Logging level | info |
maxRetries | Retry attempts on transient errors | 2 |
retryDelayMs | Delay between retries | 500 ms |
Config is stored at ~/.lmstudio-terminal/config.json.
terminal/ āāā src/ ā āāā index.ts # Plugin entry point ā āāā toolsProvider.ts # All tool definitions (24 tools) ā āāā executor.ts # execCommand, runProcess, retry logic ā āāā fileUtilities.ts # File read/write/diff/checksum/stats + pure JS zip ā āāā systemUtilities.ts # System info, processes, network, disks ā āāā securityEnhanced.ts # Sanitisation, validation, rate limiting ā āāā config.ts # LM Studio config schematics ā āāā constants.ts # Thresholds and limits ā āāā errors.ts # Custom error classes ā āāā logger.ts # Pino-based logging ā āāā types.ts # Shared TypeScript types ā āāā runtimeResolver.ts # Runtime detection & resolution ā āāā cache.ts # Command result cache (TTL-based) ā āāā progressIndicator.ts # Progress tracking ā āāā pluginTypes.ts # Additional shared type definitions ā āāā enhancedUtils.ts # Re-export barrel ā āāā tools/ ā āāā shell_tools.ts # shell_exec, run_process ā āāā file_tools.ts # file_write, read_file, diff, checksum, stats, list, create/delete dir ā āāā system_tools.ts # system_info, list_processes, kill_process, check_network, get_network_info, get_disk_info ā āāā archive_tools.ts # zip_create, zip_extract, zip_list ā āāā text_tools.ts # replace_text, count_text, insert_text, delete_lines āāā package.json āāā tsconfig.json āāā manifest.json āāā .eslintrc.json āāā .prettierrc āāā .gitignore
Apache 2.0