Skip to content

CLI

The killscript CLI owns the path from TypeScript source to a game-readable module. A generated project exposes the common commands as npm scripts, so most development does not require a global installation.

Terminal window
# Create a project and install its folder into the game.
npx killscript@0.1.2 new MyModule --modules "/path/to/Modules"
cd MyModule
# Watch, rebuild and synchronize valid changes.
npm run dev
# Validate types and generated Lua without installing or packaging.
npm run check
# Create dist/MyModule.KillScript.
npm run build

Use --reflex on new when the project also needs src/server/main.ts.

CommandPurpose
killscript new <directory>Create a new directory from the starter template
killscript init [directory]Initialize an existing empty directory

Both accept:

  • --author <name> — set module author metadata;
  • --reflex — add the Reflex server entry;
  • --modules <path> — remember the game Modules path and, unless --no-install is used, install the first build there;
  • --no-install — do not run dependency installation;
  • --no-git — do not initialize a Git repository.
CommandPurpose
killscript link <Modules>Save this machine’s game path
killscript installBuild and synchronize the folder module once
killscript devWatch source, configuration and assets; sync the last good build
killscript dev --oncePerform one watched-style build and sync, then exit

install and dev accept --modules <path>. Supplying it also saves the path in .killscript/local.json, which is ignored by Git because the path belongs to one machine.

CommandPurpose
killscript checkType-check each configured context and compile without packaging
killscript buildCompile and create dist/<name>.KillScript
killscript build --no-packCreate only the generated folder
killscript doctorValidate config, entries, compiler output and game link
killscript cleanRemove local generated output
killscript clean --gameAlso remove this project’s managed game folder

doctor --modules <path> checks a path without replacing the saved one.

The CLI treats the installed folder as managed output:

  • a failed build leaves the last working game folder untouched;
  • changed files prefer atomic rename and use a recoverable fallback where overwrite is unavailable;
  • a folder with another module UUID or without compatible ownership is not overwritten;
  • clean --game removes only the folder proven to belong to this project.

install and dev --once return a failing exit code when their one build fails, which makes them suitable for scripts and CI.

Run npx killscript@0.1.2 --help or npx killscript@0.1.2 <command> --help for the exact options documented here.