readme update
Some checks failed
code scans / scans (pull_request) Failing after 13s

This commit is contained in:
jake 2025-06-19 17:53:12 -04:00
parent f421bd906a
commit 5d580e7766

114
README.md
View File

@ -24,85 +24,78 @@ mctl requires a one-time setup via the 'init' command before using any other com
mctl init mctl init
``` ```
<br />
### Add a server ### Add a server
A To communicate with servers, they must be first added to the server list
### 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 ```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 <br />
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: ### 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
### 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 ```bash
mctl save <name> mctl server activate <name>
``` ```
### Viewing commands <br />
Saved commands can be viewed with:
### Login to server
To login to the activated server and start sending commands
```bash ```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 ```bash
mctl view all mctl login -s <name>
``` ```
### Running saved commands <br />
Commands that have been saved can be run with:
### Savind a command
Commands can be saved to be run later
```bash ```bash
mctl run <name> mctl command add
``` Command alias: seed
If the saved command contains placeholders, the necessary arguments must be supplied: Command: seed
```bash
mctl run <name> args...
``` ```
### 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 ```bash
#saving command named "test" to run "tp %s 0 0 0" mctl command run seed
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 contain placeholders to be filled in at runtime
Commands can be deleted with:
```bash ```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 ### CRUD Commands
To clear all fields from the configuration file use: Other create, read, update, and delete versions of subcommands are available. Use the -h flag for more information
```bash
#CAUTION: If the config file is cleared all data previously saved will be lost forever
mctl clear
```
<br /> <br />
@ -114,9 +107,4 @@ mctl utilizes [govulncheck](https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
<br /> <br />
# Development # Development
this repo is currently in development and may encounter breaking changes, use a tag to prevent any surprises 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