RustRcon 2.0.0
dotnet add package RustRcon --version 2.0.0
NuGet\Install-Package RustRcon -Version 2.0.0
<PackageReference Include="RustRcon" Version="2.0.0" />
<PackageVersion Include="RustRcon" Version="2.0.0" />
<PackageReference Include="RustRcon" />
paket add RustRcon --version 2.0.0
#r "nuget: RustRcon, 2.0.0"
#:package RustRcon@2.0.0
#addin nuget:?package=RustRcon&version=2.0.0
#tool nuget:?package=RustRcon&version=2.0.0
RustRcon
Typed RCON client for Rust game servers. Ships with 1 600+ auto-generated command classes covering every ConVar, action command and admin utility exposed by the game — with correct argument types, get/set semantics for ConVars and structured response objects.
using RustRcon;
using RustRcon.Generated.Commands;
var client = new RconClient("localhost", 28016, "password");
await client.ConnectAsync();
// ConVar — get and set
var tfCmd = GlobalMaxplayersCommand.CreateGet();
await client.SendCommandAsync(tfCmd);
Console.WriteLine(tfCmd.Value); // 100
// Typed DTO response
var infoCmd = GlobalServerinfoCommand.Create();
await client.SendCommandAsync(infoCmd);
Console.WriteLine(infoCmd.Result?.Hostname);
// TextTable with --json flag → structured row access
var tcCmd = ServerListtoolcupboardsCommand.Create(json: true);
await client.SendCommandAsync(tcCmd);
foreach (var row in tcCmd.Result?.Rows ?? [])
Console.WriteLine($"{row["EntityId"]} {row["Position"]}");
Table of Contents
Installation
Library
dotnet add package RustRcon
Targets net10.0 and netstandard2.1.
CLI tool
Download the binary for your platform from the latest release:
| Platform | Archive |
|---|---|
| Linux x64 | rustrcon-cli-vX.X.X-linux-x64.zip |
| Windows x64 | rustrcon-cli-vX.X.X-win-x64.zip |
| macOS x64 | rustrcon-cli-vX.X.X-osx-x64.zip |
Extract and run:
# Linux / macOS
chmod +x rustrcon
./rustrcon --host localhost --port 28016 --password <password>
# Windows
rustrcon.exe --host localhost --port 28016 --password <password>
Getting started
using RustRcon;
// The logger parameter is optional — omit to write to console.
var client = new RconClient("localhost", 28016, "password");
await client.ConnectAsync();
// Subscribe to unsolicited server output before connecting if needed.
client.OnConsoleMessage += msg => Console.WriteLine(msg.Message);
client.OnChatMessage += msg => Console.WriteLine($"<{msg.Username}> {msg.Message}");
await client.DisconnectAsync("bye");
Commands
Every RCON command is a strongly-typed class generated from the game's ConsoleGen table.
<br>
All classes live in the RustRcon.Generated.Commands namespace.
ConVar commands
ConVars expose CreateGet() and CreateSet(T value).
<br>
After SendCommandAsync completes, Value holds the parsed result.
// Read
var getCmd = GlobalServeripCommand.CreateGet();
await client.SendCommandAsync(getCmd);
Console.WriteLine(getCmd.Value); // e.g. "0.0.0.0"
// Write
var setCmd = GlobalMaxplayersCommand.CreateSet(200);
await client.SendCommandAsync(setCmd);
Action commands
Commands with arguments have a Create(...) factory that validates types at compile time.
// Ban by Steam ID (SteamId is a validated wrapper around ulong)
var ban = GlobalBanidCommand.Create(
steamId: new SteamId(76561198000000000),
reason: "griefing",
duration: 86400);
await client.SendCommandAsync(ban);
// Kick all players
var kick = GlobalKickallCommand.Create("server restart in 5 min");
await client.SendCommandAsync(kick);
Commands that return a typed response inherit from BaseCallCommand<T>.
<br>
Result is populated after the command completes.
var players = GlobalPlayerlistCommand.Create();
await client.SendCommandAsync(players);
foreach (var p in players.Result ?? [])
Console.WriteLine($"{p.DisplayName} {p.SteamID} {p.Ping}ms");
TextTable commands
Commands that use TextTable internally support an optional --json flag.
<br>
Result.Rows is always populated regardless of which format the server returns.
// Without --json: server replies with padded text, parsed into rows automatically.
var tcText = ServerListtoolcupboardsCommand.Create();
await client.SendCommandAsync(tcText);
// With --json: server replies with a JSON array.
var tcJson = ServerListtoolcupboardsCommand.Create(json: true);
await client.SendCommandAsync(tcJson);
foreach (var row in tcJson.Result?.Rows ?? [])
Console.WriteLine($"{row["EntityId"]} {row["Position"]} authed={row["Authed"]}");
// Raw text is always available regardless of format.
Console.WriteLine(tcJson.Result?.Raw);
Unsolicited messages
The server pushes chat and console messages without a request. Subscribe before connecting.
client.OnConsoleMessage += msg =>
{
Console.WriteLine($"[{msg.Type}] {msg.Message}");
};
client.OnChatMessage += msg =>
{
Console.WriteLine($"[Chat] <{msg.Username}> {msg.Message}");
};
CLI tool
The rustrcon CLI connects to any Rust server and provides an interactive REPL with autocomplete, history and structured response rendering.
rustrcon --host localhost --port 28016 --password <password>
> _
| Key / command | Action |
|---|---|
TAB |
Cycle through completions (full name or short name) |
↑ / ↓ |
Navigate command history |
find <query> |
Search commands by name or description |
clear |
Clear the terminal |
exit |
Disconnect and quit |
Short names are resolved automatically when unambiguous:
> serverinfo → resolves to global.serverinfo
> ban <steamId> → ambiguous: global.ban / global.banid / …
Responses are rendered as structured tables where possible.
Code generation
The generated files under src/Runtime/Types/Generated/ are committed to this repository.
<br>
To regenerate against a new game version:
dotnet run --project src/Generator -- \
--output src/Runtime/Types/Generated
# Force re-download even if the cached Oxide.Rust tag matches:
dotnet run --project src/Generator -- \
--output src/Runtime/Types/Generated \
--force
The generator:
- Downloads the latest
Oxide.Rust.zipfrom OxideMod/Oxide.Rust and caches it under%LOCALAPPDATA%/RustRconGenerator. - Decompiles
Assembly-CSharp.dllwith ICSharpCode.Decompiler. - Parses
ConsoleGento extract every command definition, infers C# types for each argument and return value. - Emits command classes, DTO records and enums.
License
This library is under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- JetBrains.Annotations (>= 2024.2.0)
- Newtonsoft.Json (>= 13.0.3)
-
net10.0
- JetBrains.Annotations (>= 2024.2.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 111 | 4/21/2026 |