This commit is contained in:
parent
f421bd906a
commit
5d580e7766
112
README.md
112
README.md
@ -24,85 +24,78 @@ mctl requires a one-time setup via the 'init' command before using any other com
|
||||
mctl init
|
||||
```
|
||||
|
||||
<br />
|
||||
|
||||
### 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
|
||||
|
||||
To communicate with servers, they must be first added to the server list
|
||||
```bash
|
||||
mctl login #makes auth request to server with saved password
|
||||
mctl server add
|
||||
Server alias: home
|
||||
Server address: x.x.x.x
|
||||
Server port: 61695
|
||||
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
|
||||
<br />
|
||||
|
||||
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:
|
||||
### Activating a server
|
||||
Servers can be activated to be used as the default server for mctl operations, the server alias must be
|
||||
provided to activate it
|
||||
```bash
|
||||
mctl save <name>
|
||||
mctl server activate <name>
|
||||
```
|
||||
|
||||
### Viewing commands
|
||||
Saved commands can be viewed with:
|
||||
<br />
|
||||
|
||||
### Login to server
|
||||
To login to the activated server and start sending commands
|
||||
```bash
|
||||
mctl view <name>
|
||||
mctl login
|
||||
```
|
||||
All saved commands can be viewed with:
|
||||
The -s flag can be set to login to a non-activated server
|
||||
```bash
|
||||
mctl view all
|
||||
mctl login -s <name>
|
||||
```
|
||||
|
||||
### Running saved commands
|
||||
Commands that have been saved can be run with:
|
||||
<br />
|
||||
|
||||
### Savind a command
|
||||
Commands can be saved to be run later
|
||||
```bash
|
||||
mctl run <name>
|
||||
```
|
||||
If the saved command contains placeholders, the necessary arguments must be supplied:
|
||||
```bash
|
||||
mctl run <name> args...
|
||||
mctl command add
|
||||
Command alias: seed
|
||||
Command: seed
|
||||
```
|
||||
|
||||
### Saving and running example
|
||||
The command saved can then be run with the following command, this will run the 'seed' command on the activated
|
||||
server, or a different server using the -s flag
|
||||
```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
|
||||
mctl command run seed
|
||||
```
|
||||
|
||||
### Delete saved command
|
||||
Commands can be deleted with:
|
||||
Commands can contain placeholders to be filled in at runtime
|
||||
```bash
|
||||
mctl delete <name>
|
||||
#created the 'placeholder' command which runs the 'kill' command
|
||||
mctl command add
|
||||
Command alias: placeholder
|
||||
Command: kill %s
|
||||
```
|
||||
```bash
|
||||
#runs the 'kill' command on 'player'
|
||||
mctl command run placeholder kill player
|
||||
```
|
||||
Running the placeholder command with the arg 'player' will run 'kill player' on the server
|
||||
|
||||
<br />
|
||||
|
||||
### Clearing database
|
||||
The mctl database can be cleared with the destoy command. WARNING, this command will delete any saved servers or commands completely resetting mctl
|
||||
```bash
|
||||
mctl destroy
|
||||
```
|
||||
|
||||
### 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
|
||||
```
|
||||
### CRUD Commands
|
||||
Other create, read, update, and delete versions of subcommands are available. Use the -h flag for more information
|
||||
|
||||
<br />
|
||||
|
||||
@ -115,8 +108,3 @@ mctl utilizes [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
|
||||
|
||||
# Development
|
||||
this repo is currently in development and may encounter breaking changes, use a tag to prevent any surprises
|
||||
|
||||
# TODO
|
||||
7. update readme, the commands are all broken
|
||||
8. Maybe move off of fmt
|
||||
10. Testing results, list commands that have been tested here. Run command one errors if it cant find command, lets wrap that
|
Loading…
x
Reference in New Issue
Block a user