Skip to content

bercon-cli

Command-line client for servers using BattlEye RCon.

Server profiles

Use [globals] for shared values and [profile.NAME] for each server. Select profiles with --profile NAME and config files with --config PATH.

When --config/-c is omitted, search these paths in order:

Linux / BSD

  1. If $XDG_CONFIG_HOME is set, use $XDG_CONFIG_HOME/bercon-cli/config.ini; otherwise, use ~/.config/bercon-cli/config.ini.
  2. ~/.bercon-cli.ini

macOS

  1. ~/Library/Application Support/bercon-cli/config.ini
  2. If $XDG_CONFIG_HOME is set, use $XDG_CONFIG_HOME/bercon-cli/config.ini; otherwise, use ~/.config/bercon-cli/config.ini.
  3. ~/.bercon-cli.ini

Windows

  1. If %APPDATA% is set, use %APPDATA%\bercon-cli\config.ini.
  2. If %XDG_CONFIG_HOME% is set, use %XDG_CONFIG_HOME%\bercon-cli\config.ini; otherwise, use %USERPROFILE%\.config\bercon-cli\config.ini.
  3. %USERPROFILE%\.bercon-cli.ini

Configuration priority

Parameter priority, lowest to highest:

  1. Built-in default values
  2. Variables loaded from the .env file
  3. Environment variables set in your shell or service
  4. Shared settings in the INI configuration file ([globals] section)
  5. Settings in the selected server profile in that INI file
  6. Connection settings from the BattlEye config
  7. Command-line flags

NAME

bercon-cli

SYNOPSIS

bercon-cli [OPTIONS]

OPTIONS

Connection

Option Description Default Environment Required
-i, --ip RCon server IP address or hostname 127.0.0.1 $BERCON_ADDRESS no
-P, --password BattlEye RCon password $BERCON_PASSWORD no
-p, --port BattlEye RCon server port 2305 $BERCON_PORT no
-t, --timeout Timeout for login and command responses 3s $BERCON_TIMEOUT no
-a, --attempts Number of login attempts 1 $BERCON_ATTEMPTS no
-k, --keepalive Keepalive interval (<45s; 0 disables) 30s $BERCON_KEEPALIVE no
-b, --buffer-size Reserved option (deprecated: ignored) $BERCON_BUFFER_SIZE no

Output

Option Description Default Environment Required
-f, --format Output format; choices: table, json, raw, md, html, csv table $BERCON_FORMAT no

Profile and config

Option Description Environment Required
-n, --profile Select a profile from the INI config file $BERCON_PROFILE no
-c, --config Read connection settings from this INI file $BERCON_CONFIG no
-r, --server-cfg Read RCon settings from a BattlEye config no
-l, --list-profiles List profiles and exit no
-e, --example Print an example INI profile and exit no

GeoIP

Option Description Environment Required
-g, --geo-db Path to the GeoIP MMDB file $BERCON_GEO_DB no
-G, --geo-db-url HTTPS URL for downloading or updating the GeoIP database $BERCON_GEO_DB_URL no
--geo-db-url-auth MaxMind account ID and license key $BERCON_GEO_DB_URL_AUTH no

Env Options

Option Description Default Required
--env-file FILE Path to .env file .env no
--no-env Disable .env file loading no
--env-override Override existing environment variables from .env file no

Help Options

Option Description Required
-h, --help Show this help message no
-v, --version Show version information no

COMMANDS

Help Commands

help

Show help

Usage: bercon-cli [OPTIONS] help

version

Show version information

Usage: bercon-cli [OPTIONS] version [version-OPTIONS]

Show version information

Option Description Required
--short Print version number only no
--commit Print commit SHA only no
--json Print version information as JSON no

completion

Generate shell completion

Usage: bercon-cli [OPTIONS] completion [completion-OPTIONS]

Generate shell completion

Option Description Required
--shell Shell completion format; choices: bash, zsh, pwsh no

Arguments

Name Description Required
output Output file path no

exec

Execute RCon commands

Usage: bercon-cli [OPTIONS] exec [exec-OPTIONS]

Examples

Connect directly to a server

bercon-cli exec --ip 192.0.2.10 --port 2305 --password '<RCON_PASSWORD>' players

Run a command against a saved profile

bercon-cli exec --profile dayz-local players

Pass a command with spaces to the server

bercon-cli exec --profile arma3-eu -- 'say -1 Server restart in 5 minutes'

Execute RCon commands

Option Description Default Environment Required
-x, --repeat Batches to run (-1 repeats forever) 1 $BERCON_REPEAT no
-s, --cmd-sleep Delay between commands 1ms $BERCON_SLEEP_CMD no
-S, --loop-sleep Delay between batches 5s $BERCON_SLEEP_LOOP no

shell

Start an interactive RCon session

Usage: bercon-cli [OPTIONS] shell [shell-OPTIONS]

Examples

bercon-cli shell --profile dayz-local

Start an interactive RCon session

Option Description Environment Required
--no-builtins Send CLI built-in commands such as exit and quit to the server $BERCON_NO_BUILTINS no

watch

Read server messages

Usage: bercon-cli [OPTIONS] watch [watch-OPTIONS]

Examples

bercon-cli watch --profile dayz-local --timestamps >> dayz-watch.log

Read server messages

Option Description Environment Required
--timestamps Prefix server messages with local timestamps (RFC 3339) $BERCON_TIMESTAMPS no

SEE ALSO

  • https://github.com/woozymasta/bercon-cli