The CLI
Three commands. Each does a little more than the one before.
| Command | Does |
|---|---|
opys build | Runs your config and writes a bundle. |
opys install | Downloads and unpacks everything. No game. |
opys launch | Installs what is missing, then starts the game. |
npm install -g @opys/cliDay to day
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 playerConfig 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.
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/installA URL is read in pieces, as a launcher reads one: the bundle's directory and manifest, then only the files the installation lacks.
Flags
| Flag | Commands | Does |
|---|---|---|
-i, --input | all | Config file. Default opys.config.mjs. |
-o, --output | build | Bundle to write. Overrides the config's output. |
--mode <name> | all | Passed to the config as mode. |
--var key=value | install, launch | Sets a variable. Repeatable. |
--feature a,b | install, launch | Switches on a feature, such as java_console. |
--log-level <l> | all | silent, error, warn, info, debug. |
-h, --help | Prints usage. |
Good to know:
--varwins over the same variable fromrun.- A relative
-ooroutputis relative to the config file. - With no output named at all,
buildprints 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
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | A mistake in the command or config, or a failed build. |
| 2 | A download failed. |
| 3 | A file did not match its hash. |
| 4 | An archive could not be unpacked. |
| 5 | The game started, then exited with its own error. |
What to do about each: Troubleshooting.