cmd-launcher

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 5 Imported by: 0

README

cmd-launcher

A minimal command line Minecraft launcher.
GitHub go.mod Go version

API Documentation

Installation

Make sure you have Go installed.

To install, run:

go install github.com/telecter/cmd-launcher@latest
Building from source
  1. Clone this repository with git
  2. 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
  }
}

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}]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd
pkg
Package env provides directories used by the launcher for various data.
Package env provides directories used by the launcher for various data.
auth
Package auth provides functions related to game authentication.
Package auth provides functions related to game authentication.
launcher
Package launcher provides the necessary functions to start the game.
Package launcher provides the necessary functions to start the game.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL