Device Control Skill
Control device volume, brightness, and applications via command line. Supports Linux, macOS, Windows, and WSL.
Security
All inputs are validated and sanitized to prevent command injection:
- Volume/brightness values must be numbers between 0-100
- App names are restricted to alphanumeric characters, spaces, dashes, and underscores
- Shell metacharacters are blocked
Tool API
device_control
Execute a device control action.
- Parameters:
action (string, required): One of set_volume, change_volume, set_brightness, open_app, close_app.
value (string/number, optional): The value for the action (0-100 for volume/brightness, delta for change_volume).
app (string, optional): The application name or path (required for open/close actions).
Usage:
# Set volume to 50%
node skills/device-control/ctl.js --action set_volume --value 50
# Change volume by +10 or -10
node skills/device-control/ctl.js --action change_volume --value 10
node skills/device-control/ctl.js --action change_volume --value -10
# Set brightness to 75%
node skills/device-control/ctl.js --action set_brightness --value 75
# Open an application
node skills/device-control/ctl.js --action open_app --app "firefox"
node skills/device-control/ctl.js --action open_app --app "Visual Studio Code"
# Close an application
node skills/device-control/ctl.js --action close_app --app "firefox"
Platform Support
| Action |
Linux |
macOS |
Windows |
WSL |
| set_volume |
✅ (pactl/amixer) |
✅ (osascript) |
✅ (nircmd) |
✅ (nircmd) |
| change_volume |
✅ |
✅ |
❌ |
❌ |
| set_brightness |
✅ (brightnessctl) |
⚠️ (requires brightness CLI) |
✅ (WMI) |
✅ (WMI) |
| open_app |
✅ |
✅ |
✅ |
✅ |
| close_app |
✅ (pkill) |
✅ (pkill) |
✅ (taskkill) |
✅ (taskkill) |
Requirements
- Linux:
pactl (PulseAudio) or amixer (ALSA), brightnessctl (optional, for brightness)
- macOS: Built-in osascript,
brightness CLI tool (optional, for brightness)
- Windows/WSL:
nircmd.exe for volume control (download from nirsoft.net)
1---2name: device-control3description: Expose safe device actions (volume, brightness, open/close apps) for personal automation.4---5
6# Device Control Skill
7
8Control device volume, brightness, and applications via command line. Supports Linux, macOS, Windows, and WSL.
9
10## Security
11
12All inputs are validated and sanitized to prevent command injection:
13- Volume/brightness values must be numbers between 0-100
14- App names are restricted to alphanumeric characters, spaces, dashes, and underscores
15- Shell metacharacters are blocked
16
17## Tool API
18
19### device_control
20Execute a device control action.
21
22- **Parameters:**
23 - `action` (string, required): One of `set_volume`, `change_volume`, `set_brightness`, `open_app`, `close_app`.
24 - `value` (string/number, optional): The value for the action (0-100 for volume/brightness, delta for change_volume).
25 - `app` (string, optional): The application name or path (required for open/close actions).
26
27**Usage:**
28
29```bash
30# Set volume to 50%
31node skills/device-control/ctl.js --action set_volume --value 50
32
33# Change volume by +10 or -10
34node skills/device-control/ctl.js --action change_volume --value 10
35node skills/device-control/ctl.js --action change_volume --value -10
36
37# Set brightness to 75%
38node skills/device-control/ctl.js --action set_brightness --value 75
39
40# Open an application
41node skills/device-control/ctl.js --action open_app --app "firefox"
42node skills/device-control/ctl.js --action open_app --app "Visual Studio Code"
43
44# Close an application
45node skills/device-control/ctl.js --action close_app --app "firefox"
46```
47
48## Platform Support
49
50| Action | Linux | macOS | Windows | WSL |
51|--------|-------|-------|---------|-----|
52| set_volume | ✅ (pactl/amixer) | ✅ (osascript) | ✅ (nircmd) | ✅ (nircmd) |
53| change_volume | ✅ | ✅ | ❌ | ❌ |
54| set_brightness | ✅ (brightnessctl) | ⚠️ (requires brightness CLI) | ✅ (WMI) | ✅ (WMI) |
55| open_app | ✅ | ✅ | ✅ | ✅ |
56| close_app | ✅ (pkill) | ✅ (pkill) | ✅ (taskkill) | ✅ (taskkill) |
57
58## Requirements
59
60- **Linux:** `pactl` (PulseAudio) or `amixer` (ALSA), `brightnessctl` (optional, for brightness)
61- **macOS:** Built-in osascript, `brightness` CLI tool (optional, for brightness)
62- **Windows/WSL:** `nircmd.exe` for volume control (download from nirsoft.net)