MCPSERV.CLUB
RconCli

RconCli

Self-Hosted

Command‑line RCON client for Source servers

Stale(65)
595stars
0views
Updated Jun 8, 2025

Overview

Discover what makes RconCli powerful

`rcon-cli` is a lightweight, cross‑platform command line tool written in **Go** that exposes the Source RCON protocol to developers who need programmatic access to a wide variety of game servers. From a technical standpoint, the application acts as an RCON client that can be invoked either once for a single command or in a streaming mode where it reads commands from standard input. Its primary use case is automating administrative tasks—reloading maps, kicking players, or querying server stats—directly from scripts, CI pipelines, or custom dashboards.

Language & Runtime

RCON Protocol Handling

Configuration & Environment

Logging

Overview

rcon-cli is a lightweight, cross‑platform command line tool written in Go that exposes the Source RCON protocol to developers who need programmatic access to a wide variety of game servers. From a technical standpoint, the application acts as an RCON client that can be invoked either once for a single command or in a streaming mode where it reads commands from standard input. Its primary use case is automating administrative tasks—reloading maps, kicking players, or querying server stats—directly from scripts, CI pipelines, or custom dashboards.

Architecture & Technical Stack

  • Language & Runtime: The core is implemented in Go 1.20+, leveraging the language’s excellent networking libraries and static compilation to produce a single binary with no external dependencies.
  • RCON Protocol Handling: The library github.com/gorcon/rcon provides a low‑level RCON implementation that supports the original Source protocol, Telnet fallback (-t telnet), and WebSocket‑based RCON for servers that expose a web interface (e.g., Rust). The CLI simply wires this library into command line parsing.
  • Configuration & Environment: YAML is used for configuration (rcon.yaml). The tool supports multiple environments via the --env flag, allowing developers to maintain separate credential sets for dev, staging, and prod servers.
  • Logging: A pluggable logging system writes to a file or stdout, with configurable verbosity. The --log flag can point to a custom path, facilitating integration with centralized log collectors.

Core Capabilities & APIs

  • Command Execution: Supports single or batch command execution (rcon -a addr -p pass cmd1 cmd2). The output is streamed back with optional filtering.
  • Streaming Mode: When no command argument is supplied, rcon-cli reads lines from stdin and forwards them to the server. This enables piping or interactive sessions.
  • Timeouts & Error Handling: The --timeout flag allows fine‑grained control over dial and command execution timeouts, which is critical for avoiding stalled pipelines.
  • Extensibility: While the CLI itself is minimal, it exposes a Go package that developers can import into their own applications. This makes rcon-cli a drop‑in replacement for custom RCON clients.

Deployment & Infrastructure

  • Self‑Hosting: The binary can run on any OS that Go supports (Linux, macOS, Windows). No runtime environment is required beyond the binary itself.
  • Containerization: A pre‑built Docker image (outdead/rcon) is available on Docker Hub, simplifying deployment in Kubernetes or Docker Compose. The image’s entrypoint is the CLI itself, making it trivial to expose as a sidecar or init container.
  • Scalability: Because each instance is stateless and communicates over TCP/UDP, horizontal scaling is straightforward. Load balancers can route to multiple RCON servers or use a message queue to distribute commands across several CLI instances.

Integration & Extensibility

  • Plugin Support: The underlying Go library can be extended with custom command handlers or pre/post‑processing hooks. For example, a developer could wrap rcon-cli in a Go service that exposes a REST API or WebSocket endpoint.
  • Webhooks & Callbacks: By embedding the library in a Go microservice, developers can trigger RCON commands in response to external events (e.g., GitHub webhook on a new release) and expose the results via HTTP callbacks.
  • Custom Protocols: The --type flag allows switching between native RCON, Telnet, and WebSocket modes. This flexibility lets developers target legacy servers or newer games that expose RCON over HTTP.

Developer Experience

  • Documentation: The README provides clear usage examples, a comprehensive list of supported games, and notes on environment configuration. Inline comments in the source make the codebase approachable for contributors.
  • Community & Licensing: Licensed under MIT, rcon-cli benefits from an active GitHub community. Issues and pull requests are handled promptly, and the project is listed in Awesome‑Selfhosted, increasing visibility among self‑hosted enthusiasts.
  • Extensibility: The Go package is well‑structured, with unit tests covering protocol nuances. Developers can fork the repository, add support for new games (e.g., Palworld), and submit a PR without touching the core CLI logic.

Use Cases

  1. Automated Server Maintenance – Schedule nightly map reloads or cleanups via cron jobs that invoke rcon-cli with the appropriate commands.
  2. CI/CD Pipelines – Integrate RCON calls into deployment scripts to trigger server restarts or apply configuration changes after a new build is pushed.
  3. Custom Dashboards – Build a web UI that sends RCON commands to multiple servers and displays real‑time responses, using the Go library as a backend service.
  4. Event‑Driven Triggers – Use RCON in response to external events (e.g., a player reaches a milestone) by wiring the CLI into event handlers or serverless functions.

Advantages Over Alternatives

  • Zero Runtime Footprint: A single statically linked binary eliminates the need for a JRE or Node runtime, simplifying deployment.
  • Native Go Performance: High throughput and low latency are achieved thanks to Go’s efficient networking stack, making it suitable for high‑frequency command streams.
  • Broad Game Support: The tool already covers a wide array of popular titles, and adding new ones is straightforward due to the generic RCON implementation.

Open SourceReady to get started?

Join the community and start self-hosting RconCli today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
other
License
MIT
Stars
595
Technical Specs
Pricing
Open Source
Database
None
Docker
Official
Supported OS
LinuxWindowsmacOS
Author
gorcon
gorcon
Last Updated
Jun 8, 2025