| Crates.io | bevy_brp_extras |
| lib.rs | bevy_brp_extras |
| version | 0.18.0 |
| created_at | 2025-06-20 20:43:31.523948+00 |
| updated_at | 2026-01-15 12:26:27.899281+00 |
| description | Extra BRP methods for Bevy apps including screenshot, shutdown, and keyboard input capabilities |
| homepage | |
| repository | https://github.com/natepiano/bevy_brp |
| max_upload_size | |
| id | 1720214 |
| size | 196,927 |
bevy_brp_extras does two things
| bevy | bevy_brp_extras |
|---|---|
| 0.18 | 0.18.0 |
| 0.17 | 0.17.0-0.17.2 |
| 0.16 | 0.1 - 0.2 |
Adds the following Bevvy Remote Protocol methods:
brp_extras/screenshot - Capture screenshots of the primary windowbrp_extras/shutdown - Gracefully shutdown the applicationbrp_extras/send_keys - Send keyboard input to the applicationbrp_extras/set_window_title - Change the primary window titleAdd to your Cargo.toml:
[dependencies]
bevy_brp_extras = "0.18.0"
Add the plugin to your Bevy app
use bevy::prelude::*;
use bevy_brp_extras::BrpExtrasPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(BrpExtrasPlugin) // will listen on BRP default port 15702
.run();
}
You can specify a custom port for the BRP server:
.add_plugins(BrpExtrasPlugin::with_port(8080))
Alternatively, you can set the port at runtime using the BRP_EXTRAS_PORT environment variable:
BRP_EXTRAS_PORT=8080 cargo run
Port priority: BRP_EXTRAS_PORT environment variable > with_port() > default port (15702)
brp_extras/screenshotpath (string, required): File path where the screenshot should be savedImportant: Your Bevy app must have the png feature enabled for screenshots to work:
[dependencies]
bevy = { version = "0.18", features = ["png"] }
Without this feature, screenshot files will be created but will be 0 bytes as Bevy cannot encode the image data.
Note: If you're not using this with bevy_brp_mcp, you'll need to tell your AI agent that this method requires a path parameter, or let it discover this by trying the method and getting an error message.
brp_extras/shutdownbrp_extras/send_keyskeys (array of strings, required): Key codes to send (e.g., ["KeyA", "Space", "Enter"])duration_ms (number, optional): How long to hold keys before releasing in milliseconds (default: 100, max: 60000)Simulates keyboard input by sending press and release events for the specified keys. Keys are pressed simultaneously and held for the specified duration before being released.
Example:
# Send "hi" by pressing H and I keys
curl -X POST http://localhost:15702/brp_extras/send_keys \
-H "Content-Type: application/json" \
-d '{"keys": ["KeyH", "KeyI"]}'
# Hold space key for 2 seconds
curl -X POST http://localhost:15702/brp_extras/send_keys \
-H "Content-Type: application/json" \
-d '{"keys": ["Space"], "duration_ms": 2000}'
brp_extras/set_window_titletitle (string, required): The new title for the primary windowChanges the title of the primary window.
Example:
curl -X POST http://localhost:15702/brp_extras/set_window_title \
-H "Content-Type: application/json" \
-d '{"title": "My Game - Level 2"}'
This crate is designed to work seamlessly with bevy_brp_mcp, which provides a Model Context Protocol (MCP) server for controlling Bevy apps. When both are used together:
BrpExtrasPlugin to your Bevy appbevy_brp_mcp with your AI coding assistantDual-licensed under either:
at your option.