Skip to content
Ironlark is in closed pre-alpha. Join the Discord for access.

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.

  • --config <PATH> reads this configuration file instead of the default one. A file named here must exist.
  • --no-input never asks for a missing value; it refuses instead. The same happens when no terminal is attached.
  • -v says what is being done: -v each step, -vv how each value was resolved, -vvv every item. The long form is --verbose.
  • -q prints failures and nothing else. The long form is --quiet.
  • -h prints help for the command it follows. The long form is --help.
  • -V prints the version. The long form is --version.
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.toml declares the version and one section per half; see The manifest.
  • Cargo.toml is one cargo workspace for both halves, on the ironlark SDK.
  • .cargo/config.toml pins the wasm32-wasip2 target, so a plain cargo build cannot build for your own machine by mistake.
  • server/ and client/ are one crate per half, each starting with an init hook 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.

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.

  1. Checks the toolchain: Rust with the wasm32-wasip2 target. When it is missing, it says which command installs it.
  2. Compiles protocol.proto into protocol.pb beside mod.toml, when the mod has one; see The protocol schema. A protocol.pb left over from a removed schema is deleted.
  3. Builds every half in release mode, showing cargo’s output.
  4. Places each component beside mod.toml, where the game opens it: <mod>_server.wasm and <mod>_client.wasm. A - in the mod’s name becomes _ in these names, so door-lock builds door_lock_server.wasm.

It prints the path of every component it placed:

/home/you/.ironlark/assets/workshop/you/greeter/greeter_server.wasm
ironlark-cli mod check [--path DIR]

Checks the mod without building it and without changing a file. It fails when:

  • protocol.pb no longer matches protocol.proto: run mod 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 ready
ironlark-cli self update

Replaces the running copy with the newest release for your platform, from GitHub:

  1. 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.
  2. Refuses a copy another user owns, as when run with sudo.
  3. Finds the newest release. Already on it, it stops: ironlark-cli <version> is the newest release.
  4. At a terminal, asks before it changes anything.
  5. 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.
  6. 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.

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.

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:

Terminal window
ironlark-cli self manual ~/.local/share/man/man1
man ironlark-cli-mod-build

The Linux packages and Nix install the pages themselves.

ironlark-cli config show

Prints the configuration in use, after the file and the environment are applied, under the name of the file it came from:

~/.config/ironlark/config.toml
author = "you"
[logging]
[update]
check = true

An 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: _

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 = false

An environment variable wins over the file. A key the tool does not know is refused, so a misspelt key cannot be silently ignored.

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.toml in your cache directory (%LOCALAPPDATA% on Windows, ~/.cache on Linux, ~/Library/Caches on macOS): when it last looked for a newer release, and what it found.

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.