Automation / CT v4.3.0

Running without a window.

The command line module runs CT headless: java -jar CT-Main-<version>.jar ct [options]. It installs, verifies, and launches the game — including installed loader profiles — which makes it useful for automation and verification.

01 / Invocation

How to invoke it.

The command line is a module, not a second program: it needs the cli module and the modules it requires (installer, settings, launcher) in the modules folder.

java -jar CT-Main-<version>.jar ct [options]
  • Same host, module command. CT-Main starts, loads the modules, and dispatches the first argument to the matching command module. ct is the command line module's command name.
  • Module setup. Without the required modules CT-Main prints No module handled the command 'ct' and lists the commands it does have.
  • JDK 21 or later. The same requirement as the build and the desktop launcher. The Java runtime the game needs is downloaded separately by CT, so the host JDK only runs CT.

Run with --help for every option, or read the complete table in options. The desktop equivalent of each action is described in features.

02 / Reference

Every option.

The complete option table, with meanings and defaults exactly as --help reports them.

OptionMeaningDefault
--version <id>Any version ID listed in Mojang's official version manifest.Latest release
--game-dir <path>Game directory.game.directory from the settings, otherwise ~/.ct-client/game
--player <name>Offline profile name, 3 to 16 characters of letters, numbers, and underscores.CTPlayer
--memory-max <mb>Maximum heap size in megabytes.memory.maximumMb from the settings
--verifyRe-check every installed file against the official SHA-1 instead of trusting an existing installation.off
--install-onlyInstall and verify, then stop.off
--dry-runPrint the launch command and stop.off
--helpPrint usage and stop.off
Option names are --install-only, --dry-run, --game-dir, --memory-max, and --player — an invalid player name is rejected by the [A-Za-z0-9_]{3,16} rule from Account.offline(String). See accounts.
03 / Behavior

How a run behaves.

Behavior notes that apply to every invocation, whatever the option combination.

  • Offline only. Command line mode always uses an offline profile. Microsoft sign-in is only available in the desktop launcher, and the command line has no offline name persistence — pass --player each time if the default CTPlayer is not what you want.
  • Existing installation is reused. An already-installed version is trusted and not re-downloaded.
  • --verify forces a full re-check. Every installed file is re-checked against the official SHA-1 instead of being trusted. Pair it with --install-only for a pure verification run.
  • Heap pairing rule. --memory-max also lowers the minimum heap when the configured minimum is larger, so the pair stays valid — it never produces a maximum below the minimum.
  • --dry-run prints the resolved runtime path. It prints the exact argument list without starting the game, including the resolved official Java runtime path, which makes it a quick way to inspect argument construction and rule evaluation.
  • Waits and exits with the game's exit code. When the game does start, the process waits for it and exits with the game's exit code, so CI and scripts can act on the outcome.
  • Resume. If installation stops partway, re-run the same command — verified files are kept, so the install resumes rather than restarting. See verification.

What is and is not persisted in command line mode is part of the current limitations in features; the settings keys the defaults come from are in configuration.

04 / Recipes

Common invocations.

Copy-paste invocations covering the usual automation jobs.

Install and verify, then stop

java -jar CT-Main-<version>.jar ct --install-only

Launch with a named offline profile

java -jar CT-Main-<version>.jar ct --player DevPlayer

Print the launch command without starting the game

java -jar CT-Main-<version>.jar ct --dry-run

Verify a pinned version without launching

java -jar CT-Main-<version>.jar ct --version 1.20.4 --verify --install-only

Print usage and stop

java -jar CT-Main-<version>.jar ct --help

When something goes wrong, the launcher prints an actionable message — the causes and fixes are in error messages explained.