A robust command-line interface for communicating with Minecraft servers using the RCON (Remote Console) protocol.
- π Full RCON Protocol Support - Complete implementation of the Minecraft RCON protocol
- π Async/Await - Built with Tokio for efficient async networking
- π― Multiple Modes - Single command execution, interactive sessions, and more
- π¨ Rich Output - Colored output and multiple formatting options (text/JSON)
- π Auto-Reconnection - Automatic reconnection on connection loss
- π¦ Response Fragmentation - Proper handling of large server responses
- π‘οΈ Error Handling - Comprehensive error handling and validation
git clone https://github.com/etheria-project/rcon-cli.git
cd rcon-cli
cargo build --releaseThe binary will be available at target/release/rcon-cli.
Prerequisites: Rust 1.70+ and a Minecraft server with RCON enabled.
-
Enable RCON in your
server.properties:enable-rcon=true rcon.password=your_password_here rcon.port=25575
-
Execute commands:
# Single command ./rcon-cli -a localhost:25575 -p your_password exec "list" # Interactive session ./rcon-cli -a localhost:25575 -p your_password interactive
rcon-cli [OPTIONS] <COMMAND>-a, --address <HOST:PORT>- Server address (default: localhost:25575)-p, --password <PASSWORD>- RCON password (or use RCON_PASSWORD env var)-t, --timeout <SECONDS>- Connection timeout (default: 5)-v, --verbose- Increase logging verbosity-f, --format <FORMAT>- Output format: text or json--no-color- Disable colored output
rcon-cli -a localhost:25575 -p secret exec "list"
rcon-cli -a localhost:25575 -p secret exec --time "weather clear"rcon-cli -a localhost:25575 -p secret interactive --prompt "minecraft> "Interactive commands: help, status, reconnect, quit/exit
# Test connectivity
rcon-cli -a localhost:25575 -p secret ping -c 5
# Server information
rcon-cli -a localhost:25575 -p secret info --detailed
# List players
rcon-cli -a localhost:25575 -p secret players --uuidsexport RCON_PASSWORD="your_secret_password"
rcon-cli -a localhost:25575 -f json exec "list"# Player management
rcon-cli exec "kick player_name reason"
rcon-cli exec "gamemode creative player_name"
# World management
rcon-cli exec "time set day"
rcon-cli exec "weather clear"
# Server management
rcon-cli exec "save-all"
rcon-cli exec "whitelist add player_name"use rcon_cli::{RconClient, RconConfig};
use std::net::SocketAddr;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let addr = "localhost:25575".parse::<SocketAddr>()?;
let config = RconConfig::new(addr, "my_password");
let mut client = RconClient::connect(config).await?;
let response = client.execute_command("list").await?;
println!("Server response: {}", response);
Ok(())
}src/
βββ lib.rs # Library root and public API
βββ main.rs # Binary entry point
βββ cli.rs # Command-line interface definitions
βββ client.rs # RCON client implementation
βββ protocol.rs # RCON protocol and packet handling
βββ error.rs # Error types and handling
- Update
changelog.mdwith your changes - Create and push a version tag:
git tag v1.1.0 git push origin v1.1.0
When you push a version tag (v*.*.*), GitHub Actions automatically:
- Builds cross-platform binaries (Windows, Linux, macOS)
- Creates a GitHub release with changelog and downloadable archives
- Updates the changelog with a new unreleased section
- Fork the repository
- Create a feature branch
- Add tests for your changes
- Submit a pull request
MIT License - see the LICENSE file for details.
This project is crafted with love by the Hezaerd for the Etheria Team. I'm passionate about creating tools that make Minecraft server management easier and more enjoyable.
- Built with Clap for CLI parsing
- Uses Tokio for async runtime
- Implements the Minecraft RCON Protocol