Skip to content

The CLI ​

Three commands. Each does a little more than the one before.

CommandDoes
opys buildRuns your config and writes a bundle.
opys installDownloads and unpacks everything. No game.
opys launchInstalls what is missing, then starts the game.
sh
npm install -g @opys/cli

Day to day ​

sh
opys launch            # try the pack you are working on
opys build             # write the bundle to share
opys launch game.opys --var root=/tmp/test …   # test it as a player

Config or bundle ​

install and launch take either.

No argument: they read opys.config.mjs, build it into a temporary bundle, and apply your run. This is for you, while making the pack.

A bundle path or URL: they use that bundle as it is. No config is read, so there is no run, and the player's values come from --var. This is what a player does.

sh
opys launch game.opys --var root=/path/to/install --var username=Player \
  --var uuid=00000000-0000-0000-0000-000000000001 --var token=0
opys install https://example.com/packs/game.opys --var root=/path/to/install

A URL is read in pieces, as a launcher reads one: the bundle's directory and manifest, then only the files the installation lacks.

Flags ​

FlagCommandsDoes
-i, --inputallConfig file. Default opys.config.mjs.
-o, --outputbuildBundle to write. Overrides the config's output.
--mode <name>allPassed to the config as mode.
--var key=valueinstall, launchSets a variable. Repeatable.
--feature a,binstall, launchSwitches on a feature, such as java_console.
--log-level <l>allsilent, error, warn, info, debug.
-h, --helpPrints usage.

Good to know:

  • --var wins over the same variable from run.
  • A relative -o or output is relative to the config file.
  • With no output named at all, build prints the manifest as JSON. Good for reading and diffing, not for installing.

When to use install ​

It installs the files and stops. Use it to prepare an installation, or in a script that should not start the game.

Forge and NeoForge finish their setup on the player's machine when the game first starts. install does not run the game, so that still happens on the first launch.

Exit codes ​

CodeMeaning
0Success.
1A mistake in the command or config, or a failed build.
2A download failed.
3A file did not match its hash.
4An archive could not be unpacked.
5The game started, then exited with its own error.

What to do about each: Troubleshooting.