Skip to Content
Modlock

Command line

Every modlock command, its options and where it finds the game.

CommandEffect
modlock new [DIR]Create a mod project, asking for its name and language, then offering the editor extension and to open the project in VS Code. Pass --name and --language to answer up front. When a script runs it, or with --json, it asks nothing, so it needs DIR and uses TypeScript unless you pass --language.
modlock buildCheck the mod and write the built mod to build/.
modlock dev [DIR]Build the mod, run it in a local server, join it, and reload it on each save.
modlock play [MOD...]Play locally. Each MOD is a project or a built mod's directory, by default the current one. Only one of them can be a watched project.
modlock join CODEJoin a session another PC hosts, by its join code or its lobby's link, and launch Deadlock into it. With --no-game, it prints the connect line to enter in a running game's console instead of launching Deadlock.
modlock publish [DIR]Build and check the mod, then publish it.
modlock editorInstall the Modlock extension, and in a mod project its language's extension, into VS Code, VS Code Insiders, Cursor, Windsurf or VSCodium: the editor whose terminal this is, or every one installed. --editor picks one: code, code-insiders, cursor, windsurf or codium.
modlock loginSign in to hyperline.gg in the browser. --host, join and publish then use that sign-in.
modlock logoutRemove the saved sign-in. --host and join then connect the PCs directly.
modlock updateInstall the newest release over this modlock. --check only reports whether a newer release is out. --release v0.1.9 installs that one. A channel chooses between releases and builds of the master branch.
modlock versionPrint the version, as modlock --version does.
modlock configList the settings. modlock config set update-check off stops the check for releases, and editor-offer off stops new, dev and play offering the editor extension.
modlock daemonstatus shows the background process that keeps this PC's mod store and its connection to other PCs. probe PEER measures the link to another PC. stop ends it.
modlock lfs setupKeep this Git repository's LFS files in this PC's mod store, so git push sends the remote only their pointers.

When Deadlock is not installed, dev and play run your mod in the sandbox instead. Both take these options:

OptionEffect
--no-gameRun the server without launching Deadlock.
--port PORTServe on a UDP port other than 27067.
--arg VALUEPass VALUE to the mods' onStart handlers. Repeatable.
--sandboxRun in the sandbox even when the game is installed.
--watch=falseBuild once instead of reloading on each save. play then runs existing builds and can run several mods.
--releaseBuild as publish does.
--host, --lobbyplay only. Let friends join with a join code, or through a Hyperline lobby.
--ui-port PORTServe the mods' interfaces to the game on a port other than 4320. 0 turns them off.
--ui-relay ORIGINReach the interfaces through a site other than https://hyperline.gg.
--preview-port PORTServe the browser preview of the interface on a port other than 4322. 0 turns it off.

While dev or play watches a project, saving a file rebuilds the mod and replaces the running one. Saving files in build/ and node_modules, hidden files and *.log files does not. The terminal shows the mod's log, its reloads and the players who join, and the server's own console output goes to build/server.log. In the sandbox, a line you type in the terminal is sent as chat from the stand-in player.

In a Python mod, a line that starts with > runs in main.py's module, as at Python's own prompt, so > modlock.players() prints the players. When the line raises an error, the terminal shows its traceback and the mod keeps running. Mods in other languages have no such prompt yet.

Playing together explains --lobby, --host and join. join also takes --ui-port and --ui-relay, and login, join and publish take --origin to use a site other than https://hyperline.gg.

VariableUse it when
DEADLOCK_DIRDeadlock is installed outside the Steam libraries.
MODLOCK_HOSTYou built modlock-host.exe yourself. The sandbox reads the interpreters beside it.
MODLOCK_PROTONYou want a particular Proton installation.
MODLOCK_NO_UPDATE_CHECKYou want to turn off the check for a newer release in this environment.

Where it lives and how it updates

On Windows, the installer puts modlock in %LOCALAPPDATA%\Programs\modlock, adds that directory to your PATH, and modlock starts the game server directly. On macOS and Linux, the installer puts it in ~/.local/bin, and on Linux modlock starts the Windows game server through Steam's Proton.

Once a day at most, modlock checks in the background for a newer release and tells you when one is out. It skips the check in CI, when MODLOCK_NO_UPDATE_CHECK is set, and after modlock config set update-check off.

modlock update installs from a channel: releases, or builds of the master branch. It remembers the channel you choose, and the daily check uses that channel too:

CommandDoes
modlock update --channel masterInstalls the build of the master branch's newest commit. Its version reads master- and 12 digits of the commit.
modlock update --channel stableGoes back to releases, the default channel.
modlock config set channel masterSets the channel without updating.
modlock update --from-sourceBuilds the master branch on your computer, which needs Git, Go, Zig, CMake and Ninja.

Game files

These commands read and write the game's own file formats, and they work without the game or Valve's tools installed.

CommandEffect
modlock panorama compile DIRCompile the Panorama layouts (.xml), scripts (.js) and style sheets (.css) under DIR/panorama/ into DIR.vpk.
modlock panorama decompile FILEPrint a compiled layout (.vxml_c) as XML, a script (.vjs_c) as its source, or a style sheet (.vcss_c) as CSS.
modlock vpk list ARCHIVEList an archive's files and their sizes.
modlock vpk unpack ARCHIVE DIR [PATH...]Write the archive's files, or those under each PATH, into DIR.
modlock vpk pack DIR ARCHIVEPack a directory into an archive. Equal directories pack to equal bytes.
modlock kv3 FILEPrint a compiled resource's KeyValues3 data as JSON. --blocks lists its blocks.
modlock studioBrowse game assets and preview models, textures and sounds in Modlock Studio.

panorama compile copies every other file in DIR into the archive unchanged, so compiled resources such as images go in beside the layouts. -o writes to another archive, or to a directory. A style sheet's url() can point to an image or another sheet in the game's files, written as s2r://, file://{images}/ or file://{resources}/. The compiler rewrites it to the path of the resource the game loads: file://{images}/icons/mark.png becomes s2r://panorama/images/icons/mark_png.vtex. The compiler refuses any other URL and reports its line. decompile and kv3 take --archive to read FILE from inside an archive, including the game's split game/citadel/pak01_dir.vpk:

modlock panorama decompile --archive pak01_dir.vpk panorama/layout/hud.vxml_c

modlock studio prints a local address to open in a browser. Modlock Studio:

  • lists every file in the installed game's archive,
  • draws models with their levels of detail, mesh groups and materials,
  • shows textures as the GPU stores them,
  • plays and downloads MP3 and PCM sounds,
  • shows other resources' KeyValues3.

Modlock includes none of the game's files, so Studio reads each one from your own install when you open it. --port serves it on another port, and DEADLOCK_DIR points it at a game installed outside the Steam libraries.

When your mod tracks large files, such as VPKs, with Git LFS, you can keep them out of its Git remote. After git lfs track, run modlock lfs setup in the repository once. Git LFS then hands each file to modlock, which stores it in this PC's mod store. In a fresh clone, run the same setup before git lfs pull. modlock stores each file by its content, so a file that several repositories share is stored once. The files stay on this PC: a clone on another PC can pull them only from that PC's own store.

On this page