PiKVM Control
Use this skill when the user wants to interact with a PiKVM-managed machine or PiKVM hardware.
What this skill covers
- Authentication against PiKVM HTTP API
- Device info and health checks
- ATX power state and button actions
- HID typing, key presses, shortcuts, and mouse actions
- Streamer status, screenshots, and OCR
- Mass Storage Device (virtual media) status and image handling
- PiKVM Switch active-port and port-level ATX control
Read references/api-reference.md for endpoint details and parameter notes.
Safety rules
Treat these actions as high impact and get explicit user approval before performing them unless the user already clearly requested the exact action in the current conversation:
- Power off, hard power off, or reset
- Clicking ATX power/reset buttons
- Connecting or disconnecting virtual media
- Uploading, removing, or replacing MSD images
- Switching active KVM ports in environments that may affect another machine
- Sending destructive keyboard shortcuts or arbitrary typed commands
For read-only requests, proceed without extra confirmation.
Environment and auth
Prefer these environment variables when running the script:
PIKVM_URL— base URL likehttps://pikvm.localorhttps://10.0.0.7PIKVM_USERPIKVM_PASSPIKVM_VERIFY_SSL—trueorfalsePIKVM_USE_BASIC_AUTH—trueto use HTTP Basic Auth instead ofX-KVMD-User/X-KVMD-Passwd
Notes:
- PiKVM requires authentication for all API calls.
- For single-request auth, PiKVM supports either
X-KVMD-UserandX-KVMD-Passwdheaders, or HTTP Basic Auth. - If 2FA is enabled, append the current TOTP code directly to the password with no spaces.
Default workflow
- Validate that
PIKVM_URL,PIKVM_USER, andPIKVM_PASSare available. - Start with a read-only request such as
info,atx-state,streamer-state,msd-state, orswitch-state. - Summarize the current state before taking action.
- For write operations, restate the exact action being taken.
- After any state-changing action, re-read the relevant state endpoint and report the result.
Script
Use scripts/pikvm_api.py.
Common examples:
python scripts/pikvm_api.py info
python scripts/pikvm_api.py atx-state
python scripts/pikvm_api.py atx-power --action on
python scripts/pikvm_api.py atx-click --button reset
python scripts/pikvm_api.py hid-print --text "reboot\n" --slow
python scripts/pikvm_api.py hid-shortcut --keys ControlLeft,AltLeft,Delete
python scripts/pikvm_api.py snapshot --save-path /tmp/pikvm.jpg
python scripts/pikvm_api.py ocr --langs eng
python scripts/pikvm_api.py msd-state
python scripts/pikvm_api.py msd-set --image debian.iso --cdrom true --rw false
python scripts/pikvm_api.py msd-connect --connected true
python scripts/pikvm_api.py switch-active --port 2
python scripts/pikvm_api.py switch-atx-power --port 2 --action reset_hard
When to use which operation
Read-only inspection
info→ general PiKVM/device metadataatx-state→ current power LED/busy statestreamer-state→ stream and capture healthmsd-state→ mounted image and storage availabilityswitch-state→ PiKVM Switch overview
Input control
hid-printfor plain text entryhid-shortcutfor combinations like Ctrl+Alt+Deletehid-keyfor a single key pressmouse-button/mouse-movefor pointer actions
Screen capture
snapshotto save a JPEG locallyocrto extract visible text from the host screen- Use OCR bounding box flags when only part of the screen matters
Power and media
atx-powerfor requested state changes (on,off,off_hard,reset_hard)atx-clickto emulate case buttonsmsd-setto choose image and drive flagsmsd-connectto attach or detach the virtual drive from the host
Switch environments
switch-activeto select a target portswitch-atx-powerfor port-specific power control
Reporting style
When using this skill in an agent workflow:
- State the PiKVM host being targeted.
- State whether SSL verification is enabled.
- For each action, show the endpoint-level intent in plain English.
- After changes, include the returned PiKVM state that matters most.
- Do not expose passwords, TOTP values, or session cookies.