Command line tool
theonaris-mod creates, checks, packs and installs mods from a terminal. It runs the same validator the game uses, so a mod it accepts is a mod the game accepts. It works well in scripts and CI.
Getting it
Download theonaris-mod for Windows and unpack it anywhere. The folder holds theonaris-mod.exe with its Templates and Reference folders; keep them together. Nothing else needs to be installed. Open a terminal in that folder and run:
theonaris-mod helptheonaris-mod version prints its version. Add the folder to your PATH to run it from anywhere.
Commands
new
theonaris-mod new <template> <folder> --id yourname.my-mod --name "My Mod" [--author "You"] [--description "…"]Creates a mod from a template and sets up editor autocompletion.
templates
theonaris-mod templates| Template | Starts you with |
|---|---|
empty | A manifest and one script that runs on both sides |
ui-panel | A window from .uxml and .uss that opens with a key; client only and personal |
block | A new building block based on one of the game's blocks |
build-tool | A building toolbar button with a window, and a server script that acts on the selection |
map | A map built on one of the game's scenes, with lights, spawns and a script |
multiplayer | A server script that owns the rules, a client script that asks, and replicated state |
validate
theonaris-mod validate <folder or .zip> [--strict] [--reference api.json]Checks everything a player's game would check, and everything it would only find out while running: every script compiles, every JSON, UXML and USS file parses, every model, picture, sound and video can be read, content definitions have valid ids and existing files, and permissions and content types exist. Output lines look like scripts/client.lua:12: error lua.syntax: 'end' expected near '<eof>'. It lists the permissions players will be asked to allow. The exit code is 1 when there are errors.
--strict treats unknown file types as errors, as they are for downloaded mods; a .zip is always checked strictly. --reference checks against another game version's api.json.
pack
theonaris-mod pack <folder> [--out folder]Validates, then writes <id>-<version>.zip. Hidden files (names starting with .) and unknown file types are left out, and the mod must fit the download limits, since that is what servers send.
install
theonaris-mod install <folder or .zip> [--mods folder]Copies a mod into the game mods folder, found automatically. Use --mods if it isn't found.
setup-editor
theonaris-mod setup-editor <folder>Writes .luarc.json pointing the Lua language server at the API reference.
In CI
for mod in mods/*/; do theonaris-mod validate "$mod" || exit 1; done
theonaris-mod pack mods/my-mod --out dist