2025-04-15 20:09:03 +00:00
# mctl
2025-04-19 05:18:26 +00:00
mctl is a terminal-friendly remote console client
2025-04-15 20:09:03 +00:00
2025-05-31 15:11:03 +00:00
# Index
2025-05-11 04:27:47 +00:00
1. [Installation ](#installation )
2025-06-17 23:12:49 -04:00
2. [Use ](#use )
2025-05-11 04:27:47 +00:00
4. [Security ](#security )
5. [Development ](#development )
2025-05-31 15:11:03 +00:00
< br / >
# Installation
2025-04-16 16:18:40 -04:00
Install mctl using golang
```bash
2025-06-17 23:12:49 -04:00
go install code.jakeyoungdev.com/jake/mctl@main
2025-04-16 16:18:40 -04:00
```
2025-05-31 15:11:03 +00:00
< br / >
2025-06-17 23:12:49 -04:00
# Use
2025-04-16 16:18:40 -04:00
### Configuring mctl
2025-06-17 23:12:49 -04:00
mctl requires a one-time setup via the 'init' command before using any other commands
2025-04-16 16:18:40 -04:00
```bash
2025-06-17 23:12:49 -04:00
mctl init
2025-04-16 16:18:40 -04:00
```
2025-06-19 17:53:12 -04:00
< br / >
2025-04-16 16:18:40 -04:00
2025-06-19 17:53:12 -04:00
### Add a server
To communicate with servers, they must be first added to the server list
2025-04-16 16:18:40 -04:00
```bash
2025-06-19 17:53:12 -04:00
mctl server add
Server alias: home
Server address: x.x.x.x
Server port: 61695
Password:
2025-04-16 16:18:40 -04:00
```
2025-06-19 17:53:12 -04:00
< br / >
2025-04-16 16:18:40 -04:00
2025-06-19 17:53:12 -04:00
### 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
2025-04-17 15:40:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl server activate < name >
2025-04-17 15:40:54 +00:00
```
2025-06-19 17:53:12 -04:00
< br / >
### Login to server
To login to the activated server and start sending commands
2025-04-17 15:40:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl login
2025-04-17 15:40:54 +00:00
```
2025-06-19 17:53:12 -04:00
The -s flag can be set to login to a non-activated server
2025-04-20 05:28:56 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl login -s < name >
2025-04-20 05:28:56 +00:00
```
2025-04-17 15:40:54 +00:00
2025-06-19 17:53:12 -04:00
< br / >
### Savind a command
Commands can be saved to be run later
2025-04-17 15:40:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl command add
Command alias: seed
Command: seed
2025-04-17 15:40:54 +00:00
```
2025-06-19 17:53:12 -04:00
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
2025-04-17 15:40:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl command run seed
2025-04-17 15:40:54 +00:00
```
2025-06-19 17:53:12 -04:00
Commands can contain placeholders to be filled in at runtime
2025-04-17 15:40:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
#created the 'placeholder' command which runs the 'kill' command
mctl command add
Command alias: placeholder
Command: kill %s
2025-04-17 15:40:54 +00:00
```
2025-04-17 21:25:54 +00:00
```bash
2025-06-19 17:53:12 -04:00
#runs the 'kill' command on 'player'
mctl command run placeholder kill player
2025-04-17 21:25:54 +00:00
```
2025-06-19 17:53:12 -04:00
Running the placeholder command with the arg 'player' will run 'kill player' on the server
2025-04-17 21:25:54 +00:00
2025-06-19 17:53:12 -04:00
< 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
2025-05-11 04:27:47 +00:00
```bash
2025-06-19 17:53:12 -04:00
mctl destroy
2025-05-11 04:27:47 +00:00
```
2025-06-19 17:53:12 -04:00
### CRUD Commands
Other create, read, update, and delete versions of subcommands are available. Use the -h flag for more information
2025-05-31 15:11:03 +00:00
< br / >
# Security
2025-04-24 18:22:16 +00:00
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
2025-04-16 16:18:40 -04:00
2025-05-31 15:11:03 +00:00
< br / >
# Development
2025-06-19 17:53:12 -04:00
this repo is currently in development and may encounter breaking changes, use a tag to prevent any surprises