cmd-launcher

command module
v1.0.0 Latest Latest
Warning

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

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

README

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@main
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 create command.
You can use the --loader, -l flag to set the mod loader. Only Fabric and Quilt are supported at the moment.

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 create -v 1.21.5 -l fabric CoolInstance

If you want to delete an instance, use the delete command.

[!IMPORTANT] This launcher has not been tested for versions < 1.19. 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
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.

Currently configurable values are:

  • 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 versions or instances that you have. 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