RustRcon 2.0.0

dotnet add package RustRcon --version 2.0.0
                    
NuGet\Install-Package RustRcon -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RustRcon" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RustRcon" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RustRcon" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RustRcon --version 2.0.0
                    
#r "nuget: RustRcon, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RustRcon@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RustRcon&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RustRcon&version=2.0.0
                    
Install as a Cake Tool

RustRcon

NuGet NuGet GitHub Actions License: MIT

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:

  1. Downloads the latest Oxide.Rust.zip from OxideMod/Oxide.Rust and caches it under %LOCALAPPDATA%/RustRconGenerator.
  2. Decompiles Assembly-CSharp.dll with ICSharpCode.Decompiler.
  3. Parses ConsoleGen to extract every command definition, infers C# types for each argument and return value.
  4. Emits command classes, DTO records and enums.

License

This library is under the MIT License.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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