Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
jetkvm_client
jetkvm_client is a Rust client library for interacting with JetKVM devices using WebRTC and JSON‑RPC. It provides functionality to authenticate with a JetKVM device, set up a WebRTC PeerConnection with a DataChannel, and send various input events (keyboard and mouse) as well as receive notifications (such as screen resolution updates) from the device.
This is a fork of the original jetkvm_control by David Horner. Thank you for your work!
New Goals
The goal of this library is to be able to do programatically whatever a jetkvm user can do via the web interface.
TODO
- Screen capture (screenshot)
- Video recording from WebRTC stream
Features
- Keyboard Input: Functions for sending keyboard events including text, control combinations (Ctrl-A, Ctrl-C, Ctrl-V, Ctrl-X, etc.), and special keys (Return, Windows key, etc.).
- Mouse Control: Functions for absolute mouse movement, clicks (left, right, middle), double-click, and click-and-drag actions.
Installation
-
Install via cargo
cargo install jetkvm_client- or -
Clone the Repository
git clone https://github.com/nilp0inter/jetkvm_client.git cd jetkvm_client -
Running the Project You can build and run the project with Cargo:
Usage
The jetkvm_client executable provides a powerful command-line interface for interacting with your JetKVM device. It uses a subcommand-based system, and you can chain multiple commands together in a single execution, similar to xdotool.
All output is a JSON Lines stream, where each line is a JSON object representing the result of a command. This makes it easy to parse the output in scripts.
Basic Syntax
Global Options
These options control the connection to the JetKVM device and must be provided before any commands.
-H, --host <HOST>: The host address of the JetKVM device.-P, --password <PASSWORD>: The password for authentication.-p, --port <PORT>: The port number to use (default: 80).-a, --api <API>: The API endpoint (default: /webrtc/session).-v, --verbose: Enable verbose logging.
Examples
Get the device ID:
Output:
Chain multiple commands:
This example gets the device ID and then sends a ping.
Output:
Send text to the remote machine:
Output:
What's the code look like
The api is subject to change. This project adheres to the "Semantic Versioning" standard.
example code for rust:
let config = JetKvmConfig ;
let mut client = new;
if let Err = client.connect.await
// open notepad and say Hello World, copy and paste.
send_windows_key.await.ok;
sleep.await;
rpc_sendtext.await.ok;
sleep.await;
send_return.await.ok;
sleep.await;
rpc_sendtext.await.ok;
sleep.await;
send_ctrl_a.await.ok;
sleep.await;
send_ctrl_x.await.ok;
sleep.await;
send_ctrl_v.await.ok;
sleep.await;
send_return.await.ok;
sleep.await;
send_ctrl_v.await.ok;
Contributions
- 5/1/25 - Senator3223/JetKey - use python to control your JetKVM using an api very similiar to jetkvm_client.
License
This project is licensed under the MIT License. See LICENSE for details.
Contributing
Contributions are welcome! Please submit a pull request or open an issue to discuss changes.
Features
- Keyboard Control: Send keystrokes and text to the remote system
- Mouse Control: Move the mouse cursor and simulate clicks
- Video Capture: Capture screenshots from the WebRTC video feed
- System Management: Get device information and configure EDID settings
Screenshot Capture
The library now supports capturing screenshots from the WebRTC video stream:
Using the CLI
# Capture a screenshot (uses default or detected resolution)
# Capture with specific resolution
Using the Example
# Run the screenshot example
Using as a Library
use ;
use ;
async
How It Works
The screenshot functionality works by:
- Establishing a WebRTC connection with the JetKVM device
- Adding a video transceiver to receive the video stream
- Capturing RTP packets from the video track
- Decoding the raw frame data into PNG images
The video feed is received through WebRTC's media stream, similar to how the TypeScript web client displays video.