11# rcon-cli
22[ ![ Go Report Card] ( https://goreportcard.com/badge/github.com/gorcon/rcon-cli )] ( https://goreportcard.com/report/github.com/gorcon/rcon-cli )
3- ![ GitHub All Releases] ( https://img.shields.io/github/downloads/gorcon/rcon-cli/total )
3+ [ ![ GitHub All Releases] ( https://img.shields.io/github/downloads/gorcon/rcon-cli/total )] ( https://github.com/gorcon/rcon-cli/releases )
44
55CLI for executing queries on a remote server
66
@@ -15,7 +15,9 @@ Open pull request if you have successfully used a package with another game with
1515
1616## Installation
1717
18- Download the binary for your platform from the [ releases] ( https://github.com/gorcon/rcon-cli/releases )
18+ Download the binary for your platform from the [ latest releases] ( https://github.com/gorcon/rcon-cli/releases/latest )
19+
20+ See [ Changelog] ( changelog.md ) for release details
1921
2022## Usage
2123
2426 rcon-cli [global options] command [command options] [arguments...]
2527
2628COMMANDS:
27- cli Run CLI for commands in the form of successive lines of text from the input stream
2829 help, h Shows a list of commands or help for one command
2930
3031GLOBAL OPTIONS:
@@ -33,8 +34,10 @@ GLOBAL OPTIONS:
3334 --password value, -p value set password to remote rcon server
3435 can be set in the config file rcon.yaml
3536 --command value, -c value command to execute on remote server. Required flag to run in single mode
36- --env value, -e value allows to select remote server address and password from the environment
37+ --env value, -e value allows to select remote server address and password from the environment
3738 in the configuration file
39+ --cfg value allows to specify the path and name of the configuration file. The default
40+ value is rcon.yaml. If not defined config is taken from the running directory.
3841 --help, -h show help
3942 --version, -v print the version
4043```
@@ -47,16 +50,15 @@ Server address, password and command to server must be specified in flags at sta
4750
4851 ./rcon -a 127.0.0.1:16260 -p mypassword -c help
4952
50- If flags are passed into the CLI, then the flags are sent as a single command.
51- The response is displayed, and the CLI will exit.
53+ If arguments are passed they will sent as a single command. The response will displayed, and the CLI will exit.
5254
53- ### Input stream mode
55+ ### Interactive input stream mode
5456
55- To run CLI in input stream mode add command cli . Example:
57+ To run CLI in interactive mode run ` rcon ` without ` -c ` argument . Example:
5658
57- ./rcon -a 127.0.0.1:16260 -p mypassword cli
59+ ./rcon -a 127.0.0.1:16260 -p mypassword
5860
59- Use ` ^C ` to terminate or type command ` :q ` in CLI to exit.
61+ Use ` ^C ` to terminate or type command ` :q ` to exit.
6062
6163## Configuration file
6264
@@ -66,19 +68,25 @@ and in it the default block is filled, then at startup the -a and -p flags can b
6668
6769 ./rcon -a 127.0.0.1:16260 -c players
6870 ./rcon -c status
69- ./rcon -p mypassword cli
70- ./rcon cli
71+ ./rcon -p mypassword
72+ ./rcon
7173
7274Default configuration file name is ` rcon.yaml ` . File must be saved in yaml format. It is also possible
73- to set the environment name and connection parameters for each server, for example:
75+ to set the environment name and connection parameters for each server. You can enable logging requests
76+ and responses. To do this, you need to define the log variable in the environment blocks. You can do
77+ this for each server separately and create different log files for them. If the path to the log file is
78+ not specified, then logging will not be conducted. You cannot control this in arguments, it is available
79+ only from the configuration file.
7480
7581``` yaml
7682default :
7783 address : " 127.0.0.1:16260"
7884 password : " password"
85+ log : " rcon-default.log"
7986zomboid :
8087 address : " 127.0.0.1:16260"
8188 password : " password"
89+ log : " rcon-zomboid.log"
8290rust :
8391 address : " 127.0.0.1:28003"
8492 password : " password"
8795You can choose the environment at the start:
8896
8997 ./rcon -e rust -c status
90- ./rcon -e zomboid cli
98+ ./rcon -e zomboid
99+
100+ And set custom config file
101+
102+ ./rcon --cfg /path/to/config/file.yaml
0 commit comments