- added 'command' subcommand - removed viper - setup commands added - still a WIP - readme TODO update
126 lines
3.2 KiB
Markdown
126 lines
3.2 KiB
Markdown
# mctl
|
|
mctl is a terminal-friendly remote console client
|
|
|
|
# Index
|
|
1. [Installation](#installation)
|
|
2. [Use](#use)
|
|
4. [Security](#security)
|
|
5. [Development](#development)
|
|
|
|
<br />
|
|
|
|
# Installation
|
|
Install mctl using golang
|
|
```bash
|
|
go install code.jakeyoungdev.com/jake/mctl@main
|
|
```
|
|
|
|
<br />
|
|
|
|
# Use
|
|
### Configuring mctl
|
|
mctl requires a one-time setup via the 'init' command before using any other commands
|
|
```bash
|
|
mctl init
|
|
```
|
|
|
|
### Add a server
|
|
A
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Connecting to server
|
|
Once the client has been configured commands can be sent to the server using the 'login' command. This will authenticate you with the game server and enter the command loop, the session is logged out when the command loop is broken
|
|
|
|
```bash
|
|
mctl login #makes auth request to server with saved password
|
|
```
|
|
|
|
### Sending commands
|
|
If login is successful the app will enter the command loop, which allows commands to be sent directly to the server. Commands are sent as-is to the server, there is no validation of command syntax within mctl
|
|
```
|
|
Logging into X.X.X.X on port 61695
|
|
Connected! Type 'mctl' to close
|
|
RCON@X.X.X.X /> list
|
|
|
|
There are 0 of a max of 20 players online:
|
|
```
|
|
|
|
### Saving commands
|
|
Commands can be saved under an alias for quick execution later, saved commands can contain placeholders '%s' that can be populated at runtime to allow for commands with unique runtime args to still be saved, see [example](#saving-and-running-example) for more:
|
|
```bash
|
|
mctl save <name>
|
|
```
|
|
|
|
### Viewing commands
|
|
Saved commands can be viewed with:
|
|
```bash
|
|
mctl view <name>
|
|
```
|
|
All saved commands can be viewed with:
|
|
```bash
|
|
mctl view all
|
|
```
|
|
|
|
### Running saved commands
|
|
Commands that have been saved can be run with:
|
|
```bash
|
|
mctl run <name>
|
|
```
|
|
If the saved command contains placeholders, the necessary arguments must be supplied:
|
|
```bash
|
|
mctl run <name> args...
|
|
```
|
|
|
|
### Saving and running example
|
|
```bash
|
|
#saving command named "test" to run "tp %s 0 0 0"
|
|
mctl save test
|
|
Command: tp %s 0 0 0
|
|
|
|
#run command on user "jake"
|
|
mctl run test jake
|
|
#will run: tp jake 0 0 0 on remote server
|
|
```
|
|
|
|
### Delete saved command
|
|
Commands can be deleted with:
|
|
```bash
|
|
mctl delete <name>
|
|
```
|
|
|
|
### Clear configuration file
|
|
To clear all fields from the configuration file use:
|
|
```bash
|
|
#CAUTION: If the config file is cleared all data previously saved will be lost forever
|
|
mctl clear
|
|
```
|
|
|
|
<br />
|
|
|
|
# Security
|
|
RCon is an inherently insecure protocol, passwords are sent in plaintext and, if possible, the port should not be exposed to the internet. It is best to keep these connections local or over a VPN.
|
|
|
|
mctl utilizes [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck) and [gosec](https://github.com/securego/gosec) in workflows to ensure quality, secure code is being pushed. These workflow steps must pass before a PR will be accepted
|
|
|
|
<br />
|
|
|
|
# Development
|
|
this repo is currently in development and may encounter breaking changes, use a tag to prevent any surprises
|
|
|
|
# TODO
|
|
6. Do we use CheckErr or use RunE
|
|
7. update readme, the commands are all broken
|
|
9. do saved commands run on default server only? Yes, but add -s
|
|
mctl command run tp nutlift -s server
|
|
10. RUN COMMAND
|
|
11. Command descriptions, examples, and silence usage
|
|
12. lol "default" server functionality (which means setting which one w default command) |