{"id":21954195,"url":"https://github.com/woozymasta/bercon-cli","last_synced_at":"2026-01-24T00:49:09.992Z","repository":{"id":265358102,"uuid":"895841637","full_name":"WoozyMasta/bercon-cli","owner":"WoozyMasta","description":"bercon-cli — cross-platform go command line utility and package for BattlEye RCON","archived":false,"fork":false,"pushed_at":"2025-02-25T15:22:21.000Z","size":404,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T17:53:43.922Z","etag":null,"topics":["arma","arma3","battleye","battleye-rcon","bercon","cli","dayz","rcon"],"latest_commit_sha":null,"homepage":"https://woozymasta.github.io/bercon-cli/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WoozyMasta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-29T02:50:22.000Z","updated_at":"2025-03-01T19:28:46.000Z","dependencies_parsed_at":"2024-11-29T03:34:38.817Z","dependency_job_id":"57e0ed58-c3d5-4466-a22b-66015f4c648d","html_url":"https://github.com/WoozyMasta/bercon-cli","commit_stats":null,"previous_names":["woozymasta/bercon-cli"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/WoozyMasta/bercon-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fbercon-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fbercon-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fbercon-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fbercon-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WoozyMasta","download_url":"https://codeload.github.com/WoozyMasta/bercon-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WoozyMasta%2Fbercon-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003189,"owners_count":26083533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arma","arma3","battleye","battleye-rcon","bercon","cli","dayz","rcon"],"created_at":"2024-11-29T07:17:08.528Z","updated_at":"2026-01-24T00:49:09.986Z","avatar_url":"https://github.com/WoozyMasta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bercon-cli\n\n![logo][]\n\n`./bercon-cli` is the command line interface and go package for the\n**BattlEye RCON** protocol\n\n## Description\n\n`bercon` provides a convenient way to interact with the server using the\nBattlEye RCON (Remote Console) protocol.\nThis tool allows you to execute various commands,\ncontrol the server, and track responses from the server.\n\nIt is suitable for such servers as Arma2, Arma3, DayZ, etc. using the\nprotocol [BERConProtocol][], with a full list of games you can\ncheck out the full list of games on the [BattlEye][] website\n\n## Installation\n\nYou can download the latest version of the programme by following the links:\n\n|  Arch/OS  |      MacOS      |      Linux      |      Windows      |\n| --------- | --------------- | --------------- | ----------------- |\n| **AMD64** | [MacOS amd64][] | [Linux amd64][] | [Windows amd64][] |\n| **ARM64** | [MacOS arm64][] | [Linux arm64][] | [Windows arm64][] |\n\nFor Linux you can also use the command\n\n```bash\ncurl -#SfLo /usr/bin/bercon-cli \\\n  https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-linux-amd64\nchmod +x /usr/bin/bercon-cli\nbercon-cli -h \u0026\u0026 bercon-cli -v\n```\n\n## Parameters\n\nThis help information is available when running the program\nwith the `--help` flag\n\n```bash\nbercon-cli --help\n```\n\n```txt\nUsage:\n  bercon-cli [OPTIONS] command [command, command, ...]\n\nBattlEye RCon CLI — command-line tool for interacting with BattlEye RCON servers (used by DayZ, Arma 2/3, etc).\nIt allows executing server commands, reading responses, and formatting results in table, JSON, Markdown, or HTML.\n\nConfiguration can be provided via:\n- CLI flags\n- Environment variables\n- RC config file (INI) with globals and profiles\n- beserver_x64*.cfg — to auto-load RConIP, RConPort and RConPassword\n\nApplication Options:\n  -i, --ip=                             Server IPv4 address (default: 127.0.0.1) [$BERCON_ADDRESS]\n  -P, --password=                       Server RCON password [$BERCON_PASSWORD]\n  -c, --config=                         Path to rc file (INI). If not set, standard locations are used [$BERCON_CONFIG]\n  -n, --profile=                        Profile name from rc file [$BERCON_PROFILE]\n  -r, --server-cfg=                     Path to beserver_x64.cfg file or directory to search beserver_x64*.cfg [$BERCON_SERVER_CFG]\n  -g, --geo-db=                         Path to Country GeoDB mmdb file [$BERCON_GEO_DB]\n  -f, --format=[json|table|raw|md|html] Output format (default: table) [$BERCON_FORMAT]\n  -p, --port=                           Server RCON port (default: 2305) [$BERCON_PORT]\n  -t, --timeout=                        Deadline and timeout in seconds (default: 3) [$BERCON_TIMEOUT]\n  -b, --buffer-size=                    Buffer size for RCON connection (default: 1024) [$BERCON_BUFFER_SIZE]\n  -j, --json                            Print result in JSON format (deprecated, use --format=json) [$BERCON_JSON_OUTPUT]\n  -l, --list-profiles                   List profiles from rc file and exit\n  -e, --example                         Print example rc (INI) config and exit\n  -h, --help                            Show version, commit, and build time\n  -v, --version                         Prints this help message\n```\n\nYou can use environment variables, they are specified in the help in\nsquare brackets `[]`, and are also listed in the file\n[example.env](example.env)\n\nRCON connection parameters (`RConIP`, `RConPort`, `RConPassword`)\nfrom the `beserver_x64*.cfg` file used by BattlEye.  \nTo do this, specify the file or directory path with the `--beserver-cfg`\n(`-r`) option or the environment variable `BERCON_SERVER_CFG`.\nIf a directory is specified, the tool will automatically find the active\nor latest config file (e.g. `beserver_x64_active_*.cfg`).\n\n## Usage Examples\n\nYou can use arguments, variables, or a combination of both\n\n```bash\nbercon-cli -p 2306 -P myPass players\nBERCON_PASSWORD=myPass BERCON_PORT=2306 bercon-cli players\nBERCON_PASSWORD=myPass bercon-cli -p 2306 players\n```\n\nThe argument value has the highest priority over the environment variable,\nbut the BattlEye config overrides both.\n\n```bash\n# password from arg will be used\nBERCON_PASSWORD='strong' bercon-cli --password 'pas$$word' players\n# password from config will be used\nBERCON_PASSWORD='strong' bercon-cli -r beserver_x64.cfg players\n# password from config will be used\nBERCON_PASSWORD='strong' bercon-cli -P 'pas$$word' -r beserver_x64.cfg players\n```\n\nYou can pass multiple commands within a single context.\nIf a command consists of multiple words separated by spaces,\nor contains `#` or `-` characters, you must enclose them in quotes.\nYou can also explicitly separate commands after flags using `--`.\n\n```bash\nbercon-cli --ip 192.168.0.10 --port 2306 --password 'pas$$word' -- '#unlock'\nbercon-cli -t 1 -i 192.168.0.10 -p 2306 -P 'pas$$word' '#shutdown'\nbercon-cli -i 192.168.0.10 -p 2306 -P 'pas$$word' -- '#lock' 'say -1 server restart in 5 min'\n```\n\nYou can use json output for further processing\n\n```bash\nbercon-cli -p 2306 -P myPass -j players | jq -er .\n```\n\n## Profiles config (INI)\n\n`bercon-cli` supports reusable configuration profiles stored in an INI file,\nallowing you to define multiple RCON connections and global defaults.\n\nThe tool automatically looks for an RC config file in platform-specific\nlocations if `--config` (`-c`) is not provided:\n\n* **Linux/BSD:**\n  `~/.config/bercon-cli/config.ini`,\n  `~/.bercon-cli.ini`\n* **macOS:**\n  `~/Library/Application Support/bercon-cli/config.ini`,\n  plus Linux paths\n* **Windows:** `%APPDATA%\\bercon-cli\\config.ini`,\n  `%USERPROFILE%\\.config\\bercon-cli\\config.ini`,\n  `%USERPROFILE%\\.bercon-cli.ini`\n\nConfiguration priority (lowest -\u003e highest):\n\n```txt\nRC [globals] -\u003e RC [profile.*] -\u003e Environment -\u003e CLI flags -\u003e beserver_x64*.cfg\n```\n\nIf a profile specifies `server_cfg`, it overrides `ip`, `port`, and `password`\nwith values parsed from the active `beserver_x64*.cfg`.\n\n### Example `config.ini`\n\n```ini\n[globals]\nip = 127.0.0.1\nport = 2305\npassword = MyDefaultPass\ngeo_db = /srv/geoip/GeoLite2-Country.mmdb\nformat = table\ntimeout = 3\nbuffer_size = 1024\n\n[profile.dayz-local]\n# Load BattlEye RCon params automatically from beserver_x64*.cfg\nserver_cfg = /home/dayz/server/battleye\nformat = json\n\n[profile.dayz-eu]\nip = 192.168.1.55\nport = 2310\npassword = strongPass\n\n[profile.arma3-test]\nserver_cfg = C:\\Games\\Arma3Server\\battleye\ntimeout = 5\n```\n\n### Usage examples\n\n```bash\n# Use a profile from the default config locations\nbercon-cli --profile dayz-local players\n# Explicitly specify a config file\nbercon-cli --config ~/.config/bercon-cli/config.ini -n arma3-test players\n# List all profiles with resolved IP/Port\nbercon-cli --list-profiles\n# Print example config\nbercon-cli --example\n```\n\n## Geo IP\n\nIf you specify the path to the GeoIP city database in `mmdb` format,\nthe `Country` column with the short country code or the `country` key\nin json format will be added to the output.  \nGeoIP processing supported for **Players**, **IP Bans** and **Admins**.\n\n```bash\n# pass as flag\nbercon-cli -p 2306 -P myPass -g /path/to/GeoLite2-Country.mmdb players\n# or as variable\nBERCON_GEO_DB=/pat/to/GeoLite2-Country.mmdb BERCON_PASSWORD='myPass' bercon-cli -p 2306 players\n```\n\n\u003e [!TIP]  \n\u003e An empty value in `--geo-db`, `-g` or `BERCON_GEO_DB`\n\u003e will disable geoip processing.\n\nBelow are examples of responses:\n\n```txt\n╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n│ Players on server (17 in total)                                                                                                                                       │\n├────┬─────────────────┬───────┬──────┬──────────────────────────────────┬────────────────────────┬───────┬───────┬─────────┬──────────────────┬───────────┬────────────┤\n│  # │ IP              │  Port │ Ping │ GUID                             │ Name                   │ Valid │ Lobby │ Country │ City             │ Lat       │ Lon        │\n├────┼─────────────────┼───────┼──────┼──────────────────────────────────┼────────────────────────┼───────┼───────┼─────────┼──────────────────┼───────────┼────────────┤\n│  0 │ 175.78.137.224  │ 46534 │   33 │ 20501A3C348F41D8B7AC3F4D1BB2B11C │ Avtonom Fedenko        │ true  │ false │ CN      │                  │ 34.77320  │ 113.72200  │\n│  1 │ 99.245.38.37    │ 31924 │  156 │ 8DA159D526C95D590303BF5DE422D044 │ Budislav Dovgalyuk     │ true  │ false │ CA      │ Mississauga      │ 43.56390  │ -79.71720  │\n│  2 │ 213.242.6.7     │ 29653 │  274 │ 090B1EAD1075519FC30942580067EB48 │ Vernislav Moyseienko   │ true  │ true  │ RU      │ Teykovo          │ 56.85650  │ 40.53460   │\n│  3 │ 14.186.90.206   │ 48687 │   16 │ 2E1589F4CF2E3EF553A4DA9F6C2ADB4C │ Radimir Sosnovskiy     │ true  │ false │ VN      │ Ho Chi Minh City │ 10.82200  │ 106.62570  │\n│  4 │ 5.64.182.98     │ 33898 │  272 │ EE77B327B8ADB31B15F058FD9DAA13BD │ Ladolyub Semchuk       │ true  │ false │ GB      │ Plymouth         │ 50.39070  │ -4.06020   │\n│  5 │ 109.137.98.204  │ 49085 │  185 │ BF14CC820DAA9BB3293DE24FBE75E7F8 │ Osemrit Fesun          │ true  │ false │ BE      │ Antwerp          │ 51.21920  │ 4.39170    │\n│  6 │ 135.18.149.138  │ 23544 │  282 │ 8A9A96D2FA5466CB8BAA5951711FE028 │ Ulichan Venislavskiy   │ true  │ false │ US      │ Chicago          │ 41.88350  │ -87.63050  │\n│  7 │ 42.59.192.137   │ 49326 │  243 │ 3C32AC2FF50AE08EF000D7E88CDE0C47 │ Snovid Poloviy         │ true  │ false │ CN      │                  │ 34.77320  │ 113.72200  │\n│  8 │ 213.229.129.71  │ 25891 │  235 │ 062E3F4183B90DA6534AA738FB4CE501 │ Hristofor Kirpan       │ true  │ false │ ES      │ Madrid           │ 40.41530  │ -3.69400   │\n│  9 │ 136.152.138.124 │ 21192 │  148 │ 33C81E25895ADCE458AA22F2A55D668A │ Hvalimir Chamata       │ true  │ false │ US      │ Berkeley         │ 37.87360  │ -122.25700 │\n│ 10 │ 76.4.61.28      │ 29028 │   94 │ D5F7BC1D4D113C180AE2A6A18C3E40CF │ Solomon Haieckiy       │ false │ false │ US      │                  │ 37.75100  │ -97.82200  │\n│ 11 │ 132.181.34.254  │ 50362 │  120 │ 4F069086BDAB40183121F0CA2F6F7E34 │ Gorun Yashchenko       │ true  │ false │ NZ      │ Christchurch     │ -43.52340 │ 172.59900  │\n│ 12 │ 176.247.54.236  │ 46487 │   23 │ 38DF0773821E8D0A1BDAB620981302E8 │ Yarosvit Tobilevich    │ true  │ false │ IT      │ Cagliari         │ 39.23020  │ 9.12100    │\n│ 13 │ 5.252.240.44    │ 48936 │  227 │ 256D87ED2B7D0ADB664B372C297E1B4D │ Virodan Bogovin        │ true  │ false │ IT      │ Melegnano        │ 45.35690  │ 9.32670    │\n│ 14 │ 2.153.187.194   │ 42007 │  181 │ 796CAA8F77E01D48B2D4E91F156E4387 │ Naslav Mazurok         │ true  │ false │ ES      │ Madrid           │ 40.34820  │ -3.69890   │\n│ 15 │ 39.127.252.69   │ 44989 │  106 │ CFBAC3F0F22C492FA238D9ED159F3E6C │ Vodogray Zhigalko      │ true  │ false │ KR      │ Yongin-si        │ 37.27280  │ 127.11180  │\n│ 16 │ 125.202.166.119 │ 31839 │  277 │ ADD6FEB25F352F0F6C01F0731E49EF43 │ Toligniv Doshchenko    │ true  │ false │ JP      │ Hachinohe        │ 40.50260  │ 141.48540  │\n╰────┴─────────────────┴───────┴──────┴──────────────────────────────────┴────────────────────────┴───────┴───────┴─────────┴──────────────────┴───────────┴────────────╯\n```\n\n```json\n[\n  {\n    \"ip\": \"213.229.129.71\",\n    \"guid\": \"062E3F4183B90DA6534AA738FB4CE501\",\n    \"name\": \"Hristofor Kirpan\",\n    \"country\": \"ES\",\n    \"city\": \"Madrid\",\n    \"lat\": 40.41530,\n    \"lon\": -3.69400,\n    \"port\": 25891,\n    \"ping\": 33,\n    \"id\": 8,\n    \"valid\": true,\n    \"lobby\": false\n  }\n]\n```\n\n\u003e [!TIP]  \n\u003e `XX` country code is used for local addresses and other cases when it\n\u003e was not possible to get data from the GeoIP DB\n\n## More useful bash examples\n\nYou can also use variables to store parameters for\ndifferent servers in different files\n\n```bash\n# in the ~/.server-1.env file\nBERCON_IP=192.168.0.10\nBERCON_PORT=2306\nBERCON_PASSWORD='pas$$word'.\n\n# read the file and execute the command\n. .server-1.env \u0026\u0026 bercon-cli players\n```\n\nAn example function that will allow you to execute commands on several of your\nDayZ servers at the same time\n\n\u003e [!TIP]  \n\u003e Functions can be placed in `~/.bashrc` for quick access to them\n\n```bash\nexport DAYZ_SERVERS_COUNT=5\n\ndayz-all-rcon() {\n  for i in $(seq 1 \"$DAYZ_SERVERS_COUNT\"); do\n    printf '[$s] ' \"Server-$i\"\n    . \"~/.server-$i.env\".\n    bercon-cli -t 1 -- \"$@\";\n    echo\n  done\n}\n\n# show players on all servers\ndayz-all-rcon players\n```\n\nThis example will allow you to conveniently perform a delayed restart on all\nDayZ servers at the same time, notifying players that a restart is imminent\n\n\u003e [!TIP]  \n\u003e This example recycles the function from the previous example\n\n```bash\ndayz-all-restart() {\n  local timer=\"${1:-120}\" step=\"${2:-10}\"\n  dayz-all-rcon \\\n    '#lock' \\\n    \"say -1 Server locked for new connection, restart after $timer seconds\"\n\n  for i in $(seq \"$timer\" \"-$step\" 0); do\n    sleep \"$step\"\n    ((timer-=step)) || :\n    dayz-all-rcon \"say -1 Restart server after $timer seconds\"\n  done\n\n  dayz-all-rcon 'kick -1'\n  sleep \"$step\"\n  dayz-all-rcon '#shutdown'\n}\n\n# restart all servers after 120 (default) seconds\ndayz-all-restart\n# restart all servers after 360 seconds and send messages every 20 seconds\ndayz-all-restart 360 20\n```\n\n## 👉 [Support Me](https://gist.github.com/WoozyMasta/7b0cabb538236b7307002c1fbc2d94ea)\n\nYour support is greatly appreciated!\n\n\u003c!-- Links --\u003e\n[logo]: assets/bercon.png\n[BattlEye]: https://www.battleye.com/ \"BattlEye – The Anti-Cheat Gold Standard\"\n[BERConProtocol]: pkg/bercon/spec/bercon-protocol.md \"BattlEye RCON Protocol Specification\"\n[MacOS arm64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-darwin-arm64 \"MacOS arm64 file\"\n[MacOS amd64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-darwin-amd64 \"MacOS amd64 file\"\n[Linux amd64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-linux-amd64 \"Linux amd64 file\"\n[Linux arm64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-linux-arm64 \"Linux arm64 file\"\n[Windows amd64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-windows-amd64.exe \"Windows amd64 file\"\n[Windows arm64]: https://github.com/WoozyMasta/bercon-cli/releases/latest/download/bercon-cli-windows-arm64.exe \"Windows arm64 file\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoozymasta%2Fbercon-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwoozymasta%2Fbercon-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwoozymasta%2Fbercon-cli/lists"}