1 unstable release

new 0.2.0 Nov 27, 2024
0.1.1 Nov 26, 2024

#110 in Command-line interface

Download history 307/week @ 2024-11-25

307 downloads per month

MIT license

390KB
8K SLoC

Rust GameDig CLI

The official rust-GameDig Command Line Interface.

CI License:MIT node coverage

Installation

You can install the CLI via cargo:

cargo install gamedig_cli

or

cargo install gamedig_cli --git https://github.com/gamedig/rust-gamedig.git

Usage

Running gamedig_cli without any arguments will display the usage information. You can also use the --help (or -h) flag to see detailed usage instructions.

Here's also a quick rundown of a simple query with the json-pretty format:

Pick a game/service/protocol (check the GAMES, SERVICES and PROTOCOLS files to see the currently supported ones), provide the ip and the port (be aware that some game servers use a separate port for the info queries, the port can also be optional if the server is running the default ports) then query on it.

Team Fortress 2 query example:

gamedig_cli query -g teamfortress2 -i 127.0.0.1 -f json-pretty

What we are doing here:

  • -g (or --game) specifies the game.
  • -i (or --ip) target ip.
  • -f (or --format) our preferred format.

Note: We haven't specified a port (via -p or --port), so the default one for the game will be used (27015 in this case).

Response (note that some games have a different structure):

{
  "name": "A cool server.",
  "description": null,
  "game_mode": "Team Fortress",
  "game_version": "8690085",
  "map": "cp_foundry",
  "players_maximum": 24,
  "players_online": 0,
  "players_bots": 0,
  "has_password": false,
  "players": []
}

Contributing

Please read CONTRIBUTING.

Dependencies

~12–24MB
~413K SLoC