ironlark-cli
ironlark-cli creates, builds and checks mods, and keeps itself current. How to
install it is The command-line tool; this page lists everything
it does.
ironlark-cli [OPTIONS] <COMMAND>A command is what you act on, then what to do with it: mod create,
mod build, self update. ironlark-cli <command> --help prints the same
facts as this page, for that one command, and ends with a link to its section
here. man ironlark-cli-<command>, as in man ironlark-cli-mod-build, does
the same once the manual pages are installed.
Options every command takes
Section titled “Options every command takes”--config <PATH>reads this configuration file instead of the default one. A file named here must exist.--no-inputnever asks for a missing value; it refuses instead. The same happens when no terminal is attached.-vsays what is being done:-veach step,-vvhow each value was resolved,-vvvevery item. The long form is--verbose.-qprints failures and nothing else. The long form is--quiet.-hprints help for the command it follows. The long form is--help.-Vprints the version. The long form is--version.
mod create
Section titled “mod create”ironlark-cli mod create [AUTHOR:]NAME [OPTIONS]Writes a new mod in <workshop>/<author>/<name>/. The directory is the mod’s
id, author:name; see Identity.
| Argument | What it sets |
|---|---|
[AUTHOR:]NAME |
The mod’s id. Without an author, the author comes from the configuration, or is asked for. The whole id is asked for when left out. |
--realms |
Which halves to write: server (the default), client, or server,client. |
--workshop |
The directory <author>/<name>/ is created under. The default is the current directory. |
It writes:
mod.tomldeclares the version and one section per half; see The manifest.Cargo.tomlis one cargo workspace for both halves, on theironlarkSDK..cargo/config.tomlpins thewasm32-wasip2target, so a plaincargo buildcannot build for your own machine by mistake.server/andclient/are one crate per half, each starting with aninithook that logs one line.
At a terminal, anything left off the line is asked for, one question at a time; realms are picked from a list. An author typed there can be remembered in the configuration. When it is done, the terminal shows:
A new mod
· author · you· remember this author in /home/you/.config/ironlark/config.toml · yes· name · greeter· realms · server· create you/greeter · yes
you/greeter ├─ mod.toml ├─ Cargo.toml ├─ .cargo/ │ └─ config.toml └─ server/ ├─ Cargo.toml └─ src/ └─ lib.rs
next, inside you/greeter: ironlark-cli mod build a walkthrough: https://docs.ironlark.net/modding/first-mod/It writes all the files or none, and refuses before writing anything when:
- a name breaks the naming rules;
- the directory already exists and is not empty;
- no author is given, configured or typed.
On success it prints the new mod’s directory.
mod build
Section titled “mod build”ironlark-cli mod build [--path DIR]Builds the mod the current directory is in, or the one at --path. It finds
the mod by looking for mod.toml here and in every directory above.
- Checks the toolchain: Rust with the
wasm32-wasip2target. When it is missing, it says which command installs it. - Compiles
protocol.protointoprotocol.pbbesidemod.toml, when the mod has one; see The protocol schema. Aprotocol.pbleft over from a removed schema is deleted. - Builds every half in release mode, showing cargo’s output.
- Places each component beside
mod.toml, where the game opens it:<mod>_server.wasmand<mod>_client.wasm. A-in the mod’s name becomes_in these names, sodoor-lockbuildsdoor_lock_server.wasm.
It prints the path of every component it placed:
/home/you/.ironlark/assets/workshop/you/greeter/greeter_server.wasmmod check
Section titled “mod check”ironlark-cli mod check [--path DIR]Checks the mod without building it and without changing a file. It fails when:
protocol.pbno longer matchesprotocol.proto: runmod build;- the code is not formatted (
cargo fmt); - a lint fires. Lints run for the WebAssembly target, the one the game loads,
and this is also where the SDK checks the code against
mod.toml.
It needs the rustfmt and clippy components besides the target. When all
passes:
you:greeter is readyself update
Section titled “self update”ironlark-cli self updateReplaces the running copy with the newest release for your platform, from GitHub:
- Refuses, before anything else, a copy anywhere but
~/.local/bin/ironlark-cli, or on Windows%LOCALAPPDATA%\Programs\ironlark-cli\ironlark-cli.exe, where the install guide puts a copy by hand. A link sitting there counts as the copy it points to. - Refuses a copy another user owns, as when run with
sudo. - Finds the newest release. Already on it, it stops:
ironlark-cli <version> is the newest release. - At a terminal, asks before it changes anything.
- Downloads the program and the release’s
B3SUMS, and refuses a download whose BLAKE3 checksum does not match, or a release with no build for your platform. - Swaps the new copy in, runs it once, and puts the old copy back if it does not start. If even that fails, the message names where the old copy is kept.
A refused copy is never touched, and the refusal says how to update it:
| Where the copy is | What it says to run |
|---|---|
| Homebrew | brew upgrade ironlark-cli |
| Scoop | scoop update ironlark-cli |
| winget | winget upgrade Ironlark.IronlarkCli |
| Nix | update the flake or profile that holds it |
| cargo, mise | update it with that tool |
/usr, /opt and the other system directories |
the package manager that installed it, or the newer package from the release page |
| anywhere else | move it to the place above, or replace it by hand |
Once a day, any command run at a terminal from the copy self update would
replace also checks for a newer release and mentions it after its own output.
check = false under [update] turns that off.
self completion
Section titled “self completion”ironlark-cli self completion <SHELL>Prints the script that makes a shell complete commands, options and their
values, for bash, zsh, fish, powershell or elvish. The script asks
the program for the candidates on every Tab, so it always matches the
installed version. The zsh script works both from ~/.zshrc and from a
completion directory such as site-functions.
The Linux packages and Nix install it for bash, zsh and fish. To turn it on yourself, run the line for your shell once:
| Shell | Line |
|---|---|
| bash | echo 'eval "$(ironlark-cli self completion bash)"' >> ~/.bashrc |
| zsh | echo 'eval "$(ironlark-cli self completion zsh)"' >> ~/.zshrc |
| fish | mkdir -p ~/.config/fish/completions; echo 'ironlark-cli self completion fish | source' > ~/.config/fish/completions/ironlark-cli.fish |
| PowerShell | if (!(Test-Path $PROFILE)) { New-Item -Force $PROFILE | Out-Null }; Add-Content $PROFILE 'ironlark-cli self completion powershell | Out-String | Invoke-Expression' |
| elvish | mkdir -p ~/.config/elvish; echo 'eval (ironlark-cli self completion elvish | slurp)' >> ~/.config/elvish/rc.elv |
Windows PowerShell 5.1 runs no profile until Set-ExecutionPolicy -Scope CurrentUser RemoteSigned allows it.
self manual
Section titled “self manual”ironlark-cli self manual <DIR>Writes a manual page for every command into DIR, creating it when missing,
and prints the path of each: ironlark-cli.1, ironlark-cli-mod-build.1 and
so on. On Linux and macOS, man finds pages in ~/.local/share/man/man1 when
~/.local/bin is on your PATH:
ironlark-cli self manual ~/.local/share/man/man1man ironlark-cli-mod-buildThe Linux packages and Nix install the pages themselves.
config show
Section titled “config show”ironlark-cli config showPrints the configuration in use, after the file and the environment are applied, under the name of the file it came from:
author = "you"
[logging]
[update]check = trueAn author and a mod name are lowercase ASCII letters and digits, starting with a
letter or a digit, with single - between words.
| Name | Accepted |
|---|---|
greeter, door-lock, 2d-physics |
yes |
door- |
no: ends with - |
door--lock |
no: two - in a row |
Door |
no: uppercase |
door_lock |
no: _ |
Configuration
Section titled “Configuration”The configuration is optional. Without it, every value has a default and an author is asked for when one is needed.
| System | File |
|---|---|
| Windows | %APPDATA%\ironlark\config.toml |
| Linux | ~/.config/ironlark/config.toml |
| macOS | ~/Library/Application Support/ironlark/config.toml |
| Key | What it sets | Environment variable |
|---|---|---|
author |
The author mod create uses when the id has none. |
IRONLARK_AUTHOR |
[logging] filter |
A standing diagnostic filter, in RUST_LOG syntax. -v, -q and RUST_LOG override it. |
IRONLARK_LOGGING__FILTER |
[update] check |
false stops the daily mention of a newer release. Default true. |
author = "you"
[update]check = falseAn environment variable wins over the file. A key the tool does not know is refused, so a misspelt key cannot be silently ignored.
Files it writes
Section titled “Files it writes”Besides the mods you create and build, and the manual pages self manual
writes where you name, the tool writes two files:
- the configuration, only when you agree to remember an author;
ironlark/cli-update.tomlin your cache directory (%LOCALAPPDATA%on Windows,~/.cacheon Linux,~/Library/Cacheson macOS): when it last looked for a newer release, and what it found.
Output and exit codes
Section titled “Output and exit codes”The result goes to standard output: the directory a mod was created in, the components that were placed. Questions, progress and errors go to standard error, so the result can be read by a script.
An error names what is wrong and where to change it:
error: 'door-' is not a usable name: a name cannot end with `-` at the command line| Exit code | Meaning |
|---|---|
0 |
Done. |
1 |
Refused: something you can fix, named in the message. |
2 |
The tool failed. |
3 |
The release server could not be reached; trying again may work. |