Skip to content
BlackCat edited this page Nov 29, 2026 · 2 revisions

CLI & GUI guide

TwilightMC ships two front ends over the same Rust core:

  • twilight — a dependency-free CLI for scripts, servers and headless machines.
  • twilight-ui — a Tauri v2 desktop app for instances, accounts, mods, servers and a live console.

CLI at a glance

twilight launch <VERSION_OR_ID> [flags]
twilight modpack install <PATH_OR_URL> [flags]
twilight java        # scan the system for JVMs and print them
twilight versions    # resolve the vanilla version list through the failover chain

VERSION_OR_ID accepts latest, an exact version id such as 1.21.4, or an instance name.

Launch examples

# See the fully assembled command without downloading or spawning anything
twilight launch latest --dry-run

# Plain vanilla 1.21.4 as the default offline user "Steve"
twilight launch 1.21.4

# Fabric with a pinned loader version
twilight launch 1.21.4 --loader fabric --loader-version 0.16.9

# Forge / NeoForge: omit --loader-version to use the recommended build
twilight launch 1.20.1 --loader forge
twilight launch 1.21.1 --loader neoforge

# Join a server immediately after the game starts
twilight launch 1.21.4 --server play.example.org

# Point the artifact root at a Prism Launcher data directory
twilight launch 1.21.4 --shared-dir "%APPDATA%\.jdks-dir" --username Alex

# Fixed JVM instead of discovery (PATH scan -> OS roots -> JAVA_HOME/registry)
twilight launch latest --java "C:\Program Files\Eclipse Adoptium\jdk-21\bin\java.exe"

# Download/install a managed Java runtime from the GUI (Settings -> Java & Memory):
# vendors: Adoptium, Mojang, Azul Zulu, BellSoft Liberica, Amazon Corretto,
# Microsoft OpenJDK, Oracle GraalVM, OpenLogic; checksums are verified before extraction.

Launch flags

Flag Meaning
--username NAME Offline profile name; deterministic v3 UUID. Defaults to Steve.
--instance-dir DIR Instance root. Defaults to <shared-dir>/instances/<version>.
--shared-dir DIR Shared artifact root (libraries/, assets/). Defaults to the current directory.
--temp-dir DIR Staging root. Defaults to <system-temp>/twilightmc_staging.
--java FILE Explicit JVM; without it, full JVM discovery + best-match selection runs.
--loader LOADER Composite a mod loader onto the launch (see below).
--loader-version VERSION Pin a loader release; omitted resolves the latest stable (Forge/NeoForge: the recommended build).
--horizon FILE Native horizon-client binary; omitted = discovered on PATH or beside the CLI.
--horizon-session FILE Read-once Horizon session JSON instead of handing the token over on stdin.
--server ADDRESS Quick-play: join this server right after the game starts.
--dry-run Print the assembled command and exit: no downloads, no native writes, no spawn.

Supported loaders

--loader is case-insensitive and ignores spaces, - and _:

Token Loader Metadata
fabric Fabric meta v2
quilt Quilt meta v3
forge Forge Prism/Freesm Meta v1
neoforge NeoForge Prism/Freesm Meta v1
legacyfabric Legacy Fabric (pre-1.14) meta v2
cleanroom / cleanroommc CleanroomMC (1.12.2) published MMC component pack
ornithe / ornithemc OrnitheMC Ornithe Meta v2
liteloader LiteLoader Prism/Freesm Meta v1
horizon Native Horizon engine no JVM, no classpath

The loader main class takes over, loader libraries join the shared store and lead the classpath, and the vanilla client jar stays last. CleanroomMC launches pass the BareBones core-mod gate. --dry-run prints the exact plan first.

Modpacks

# Local archive, staged into <shared>/instances/<pack-name-slug>
twilight modpack install path\to\pack.mrpack

# Straight from a CDN — prints a launch hint when it finishes
twilight modpack install https://cdn.example.org/pack.mrpack

# Inspect the plan first: files, overrides, loader, destinations, dependencies
twilight modpack install pack.mrpack --dry-run

The GUI also imports:

  • .mrpack (Modrinth) and .twpack (TwilightMC's 7z instance container);
  • Prism / MultiMC instances (instance.cfg + mmc-pack.json);
  • CurseForge manifest.json packs (keyless imports list skipped files instead of failing);
  • drag-and-drop .mrpack, .zip and .twpack anywhere in the window.

.mrpack installs use a strict modrinth.index.json parser, client-env filtering, zip-slip-guarded override extraction and SHA-1 verification.

On-disk layout

All state lives under one shared root plus per-instance game directories:

<shared-dir>/
├── libraries/                  # vanilla + loader libraries, shared across instances
├── assets/                     # asset store; virtual indexes also export assets/virtual/<id>
└── instances/
    └── <name>/
        └── minecraft/          # the game directory: saves/, options.txt, versions/, ...

<name> is the launched version id, or the pack-name slug generated by modpack install. --instance-dir renames it; --shared-dir relocates the artifact root (point it at a Prism data dir to reuse its stores).

The twilight-cas store sits beside the shared root and links blobs with a hardlink → NTFS junction → symlink → copy cascade, so instances share libraries/, assets/ and mods without admin privileges.

The desktop GUI

Section What it does
Instances version picker, loader selection, launch, kill, instance import/export, mod toggles
Accounts Microsoft device-code sign-in, offline profiles, custom Yggdrasil/Ely.by servers, 3D skin/cape editor
Modrinth searchable browser with 1-click SHA-1-verified installs and pack presets (including OneClient)
Servers create/manage Vanilla, Paper, Purpur, Fabric, Forge, NeoForge, Velocity, PumpkinMC and SteelMC; EULA, server.properties, console, metrics, files, backups, Minekube Connect
Settings Java discovery/download (8 vendors, checksum-verified JDK/JRE install), memory, theme, language, storage root, Horizon release install
Logs live game output, auto-scroll, clear/hide
Developer opt-in 7-click unlock: JDWP attach, Mixin flags, WebView DevTools, CAS/symlink diagnostics

Accessibility: nine theme presets, Blind Mode with Minecraft Access guidance, Deaf Mode with enforced subtitles, and a complete English/Vietnamese catalogue.

Environment variables

Every launch flag with an env binding can be set without repeating it:

Variable Flag
TWILIGHTMC_INSTANCE_DIR --instance-dir
TWILIGHTMC_SHARED_DIR --shared-dir
TWILIGHTMC_TEMP_DIR --temp-dir
TWILIGHTMC_JAVA --java
TWILIGHTMC_LOADER --loader
TWILIGHTMC_LOADER_VERSION --loader-version
TWILIGHTMC_HORIZON --horizon
TWILIGHTMC_HORIZON_SESSION --horizon-session

Tips

  • Run --dry-run first when debugging a loader or a custom JVM. It prints the fully assembled command and touches nothing.
  • twilight java shows every JVM the launcher can see, newest major first.
  • twilight versions exercises the metadata failover chain (Mojang → Prism → Freesm) without downloading a game.
  • The GUI embeds the Svelte frontend at compile time, so a source build always runs npm run build before cargo build.

Clone this wiki locally