cmd-launcher
A minimal command line Minecraft launcher.

API Documentation
Installation
Make sure you have Go installed.
To install, run:
go install github.com/telecter/cmd-launcher@latest
Building from source
- Clone this repository with
git
- In the source directory, run
go build .
Usage
Use the --help flag to get the usage information.
Creating an instance
To create a new instance, use the inst create command.
You can use the --loader, -l flag to set the mod loader. Forge, NeoForge, Fabric, and Quilt are all supported. If you want to select a specific version of the loader, use the --loader-version flag. Otherwise, the latest applicable version is chosen.
Use the --version, -v flag to set the game version. If no value is supplied, the latest release is used. Acceptable values also include release or snapshot for the latest of either.
cmd-launcher inst create -v 1.21.5 -l fabric CoolInstance
If you want to delete an instance, use the inst delete command.
[!IMPORTANT]
This launcher has not been tested for versions < 1.14. It may not work, but I am working on fixing these issues.
Starting the Game
To start Minecraft, simply run the start command followed by the instance ID.
cmd-launcher start CoolInstance
To override instance configuration, you can set specific flags on the start command to set game options. Use the -h help flag to view them all.
To increase the verbosity of the output, use the -v flag.
Authentication
If you want to play the game in online mode, you will need to add a Microsoft account. To do this, use the auth login command. As part of Microsoft's OAuth2 flow, the default web browser will be opened to complete the authentication. This can be avoided with the --no-browser flag. The launcher will automatically attempt to start the game in online mode if there is an account present.
To play in offline mode, just pass the -u, --username <username> flag to the start command
to set your username and the game will automatically launch in offline mode.
Log out via the auth logout command.
Instance Configuration
To change configuration values for an instance, go to the instance directory and open the instance.json file.
Configurable values are:
- Game Version
- Mod Loader (and version)
- Window Resolution
- Java Executable Path
- Minimum and maximum memory
These values can be overriden when starting the game via command line flags in the start command.
Example instance.json file
{
"game_version": "1.21.5",
"mod_loader": "fabric",
"mod_loader_version": "0.16.14",
"config": {
"resolution": {
"width": 1708,
"height": 960
},
"java": "/usr/bin/java",
"min_memory": 512,
"max_memory": 4096
}
}
Search
The search command can search for Minecraft or mod loader versions. While it defaults to searching for installed instances, it can also search for game, Fabric, and Quilt versions.
cmd-launcher search [<query>] [--kind {instances, versions, fabric, quilt}]