This is a command-line interface (CLI) tool that interacts with a MCConsoleAPI to start and stop servers, as well as list running servers. I plan to add a proper CLI for working with servers soon!
- Python 3.x
requests
library (can be installed viapip install requests
)textual
library (can be installed viapip install textual
)
-
Edit the
config.json
file and enter the url and port for your API server -
Create an
api_key.txt
file in the same directory as the script and place your API key in it as a single line of text.
To use the CLI tool, run the script with the appropriate command and arguments:
python main.py <command> [server_name] [server_path]
-
start
: Start a server with the specified server name and optional server path.server_name
: Required argument specifying the name of the server to start.server_path
: Optional argument specifying the path of the server to start.
-
stop
: Stop a server with the specified server name.server_name
: Required argument specifying the name of the server to stop.
-
servers
: List all running servers.
Start a server:
python main.py start my_server /path/to/server
Stop a server:
python main.py stop my_server
List running servers:
python main.py servers