AI prompts
base on RCON client for executing queries on game server. # rcon-cli
[![Mentioned in Awesome-Selfhosted](https://awesome.re/mentioned-badge.svg)](https://github.com/awesome-selfhosted/awesome-selfhosted)
[![GitHub Build](https://github.com/gorcon/rcon-cli/workflows/build/badge.svg)](https://github.com/gorcon/rcon-cli/actions)
[![Go Coverage](https://github.com/gorcon/rcon-cli/wiki/coverage.svg)](https://raw.githack.com/wiki/gorcon/rcon-cli/coverage.html)
[![Go Report Card](https://goreportcard.com/badge/github.com/gorcon/rcon-cli)](https://goreportcard.com/report/github.com/gorcon/rcon-cli)
[![GitHub All Releases](https://img.shields.io/github/downloads/gorcon/rcon-cli/total)](https://github.com/gorcon/rcon-cli/releases)
[![Docker Pulls](https://img.shields.io/docker/pulls/outdead/rcon.svg)](https://hub.docker.com/r/outdead/rcon)
CLI for executing queries on a remote [Source dedicated game server](https://developer.valvesoftware.com/wiki/Source_Dedicated_Server), using the [RCON](https://developer.valvesoftware.com/wiki/Source_RCON_Protocol) protocol.
## Supported Games
* [7 Days to Die](https://store.steampowered.com/app/251570) (add `-t telnet` to rcon-cli args)
* [ARK: Survival Evolved](https://store.steampowered.com/app/346110)
* [Avorion](https://store.steampowered.com/app/445220/Avorion/)
* [Conan Exiles](https://store.steampowered.com/app/440900)
* [Counter-Strike: Global Offensive](https://store.steampowered.com/app/730)
* [Factorio](https://factorio.com/)
* [Minecraft](https://www.minecraft.net)
* [Project Zomboid](https://store.steampowered.com/app/108600)
* [Rust](https://store.steampowered.com/app/252490) (add `+rcon.web 0` to the args when starting the server or add `-t web` to `rcon-cli` args)
* [Team Fortress 2](https://store.steampowered.com/app/440/Team_Fortress_2/)
* [V Rising](https://store.steampowered.com/app/1604030/V_Rising/)
* [Palworld](https://store.steampowered.com/app/1623730/Palworld/)
Open pull request if you have successfully used a package with another game with rcon support and add it to the list.
## Installation
Download the binary for your platform from the [latest releases](https://github.com/gorcon/rcon-cli/releases/latest)
See [Changelog](CHANGELOG.md) for release details
### Docker
```bash
docker pull outdead/rcon
```
## Usage
```text
USAGE:
rcon [options] [commands...]
GLOBAL OPTIONS:
--address value, -a value Set host and port to remote server. Example 127.0.0.1:16260
--password value, -p value Set password to remote server
--type value, -t value Specify type of connection (default: rcon)
--log value, -l value Path to the log file. If not specified it is taken from the config
--config value, -c value Path to the configuration file (default: rcon.yaml)
--env value, -e value Config environment with server credentials (default: default)
--skip, -s Skip errors and run next command (default: false)
--timeout value, -T value Set dial and execute timeout (default: 10s)
--help, -h show help (default: false)
--version, -v print the version (default: false)
```
Rcon CLI can be run in two modes - in the mode of a single query and in the mode of reading the input stream
### Single mode
Server address, password and command to server must be specified in flags at startup. Example:
```bash
./rcon -a 127.0.0.1:16260 -p mypassword command
```
It is possible to send several commands in one request. Example:
```bash
./rcon -a 127.0.0.1:16260 -p mypassword command "command with several words" 'command "with double quotes"'
```
If commands passed, they sent in a single mode. The response displayed, and the CLI will exit.
### Interactive input stream mode
To run CLI in interactive mode run `rcon` without commands. Example:
```bash
./rcon -a 127.0.0.1:16260 -p mypassword
```
Use `^C` to terminate or type command `:q` to exit.
### In Docker
```bash
docker run -it --rm outdead/rcon ./rcon [options] [commands...]
```
You can add your config file as volume:
```bash
docker run -it --rm \
-v /path/to/rcon-local.yaml:/rcon.yaml \
outdead/rcon ./rcon -c rcon.yaml -e default players
```
## Configuration file
For more convenient use, the ability to create the `rcon.yaml` configuration file provided. You can save the host and port of the remote server and its password. If the configuration file exists, and the default block filled in it, then at startup the `-a` and `-p` flags can be omitted. Examples:
```bash
./rcon -a 127.0.0.1:16260 players
./rcon status
./rcon -p mypassword
./rcon
```
Default configuration file name is `rcon.yaml`. File must be saved in yaml format. It is also possible to set the environment name and connection parameters for each server. You can enable logging requests and responses. To do this, you need to define the log variable in the environment blocks. You can do
this for each server separately and create different log files for them. If the path to the log file not specified, then logging will not be conducted.
```yaml
default:
address: "127.0.0.1:16260"
password: "password"
log: "rcon-default.log"
zomboid:
address: "127.0.0.1:16260"
password: "password"
log: "rcon-zomboid.log"
rust:
address: "127.0.0.1:28003"
password: "password"
7dtd:
address: "172.19.0.2:8081"
password: "password"
type: "telnet"
```
## Args
You can choose the environment at the start:
```bash
./rcon -e rust status
./rcon -e zomboid
```
Set custom config file:
```bash
./rcon -c /path/to/config/file.yaml
```
Use `-l` argument to specify path to log file:
```bash
./rcon -l /path/to/file.log
```
Use `-t` argument to specify the protocol type:
```bash
# 7 Days to Die
./rcon -a 172.19.0.2:8081 -p password -t telnet version
# Rust
./rcon -a 127.0.0.1:28016 -p password -t web status
```
Use `-T` argument to specify dial and execute timeout:
```bash
./rcon -a 172.19.0.2:8081 -p password -t telnet -T 10s version
```
## Contribute
If you think that you have found a bug, create an issue and indicate your operating system, platform, and the game on which the error reproduced. Also describe what you were doing so that the error could be reproduced.
## License
MIT License, see [LICENSE](LICENSE)
", Assign "at most 3 tags" to the expected json: {"id":"7297","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"