CLI
Binary name: factorio-rs (from crate factorio-rs-cli).
Commands
Section titled “Commands”factorio-rs init
Section titled “factorio-rs init”Create a new project in the current directory (or --manifest-path).
| Flag | Description |
|---|---|
--name <NAME> |
Cargo package name (default: directory name) |
--manifest-path <PATH> |
Project directory or Factorio.toml |
--bacon |
Also write a bacon.toml with check / reload / test jobs |
factorio-rs check
Section titled “factorio-rs check”Run cargo check (Factorio API stubs + deps), then lower every module and
apply transpile lints - without writing output_dir.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--skip-typecheck |
Skip cargo check; only validate lowering / lints |
Lint levels come from [lints] in Factorio.toml (not from build profiles).
factorio-rs build
Section titled “factorio-rs build”Typecheck, then transpile source into output_dir.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--debug-level <N> |
Override profile debug comments |
--package |
Also write {name}_{version}.zip after building |
--skip-typecheck |
Skip cargo check before transpile |
factorio-rs package
Section titled “factorio-rs package”Build then create a Factorio-ready zip at the project root.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: release |
--debug-level <N> |
Override profile debug comments |
--skip-typecheck |
Skip cargo check before transpile |
factorio-rs install
Section titled “factorio-rs install”Build and copy output_dir to {mods_dir}/{name}_{version}/.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--debug-level <N> |
Override profile debug comments |
--open |
Launch Factorio after installing |
--skip-typecheck |
Skip cargo check before transpile |
Mods directory: FACTORIO_MODS_DIR or ~/.factorio/mods.
factorio-rs sync
Section titled “factorio-rs sync”Build and deploy for Bacon / hot-reload workflows. Prefer this over install
when iterating with a running Factorio save.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--debug-level <N> |
Override profile debug comments |
--skip-typecheck |
Skip cargo check before transpile |
--symlink |
Symlink mods entry to output_dir (Unix; falls back to copy) |
--hot-reload |
UDP reload ping + control probe (game.reload_mods()); needs --enable-lua-udp |
--to-test-run |
Deploy into .factorio-rs/test-run/mods/ instead of user mods |
Typical Bacon job: factorio-rs sync --symlink --hot-reload. See
Hot reload with Bacon.
factorio-rs add
Section titled “factorio-rs add”Add another factorio-rs library as a Cargo path dependency and merge Factorio.toml deps. See Sharing code between mods.
factorio-rs open
Section titled “factorio-rs open”Launch Factorio if detected (FACTORIO_PATH, Steam installs, PATH, or Steam
protocol). Prefers steam-run when available.
factorio-rs test
Section titled “factorio-rs test”Build the mod, discover #[test] functions under #[cfg(test)], launch Factorio
(headless by default), run the suite in-game, and print a colored report.
See Testing.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--debug-level <N> |
Override profile debug comments |
[FILTER] |
Only run tests whose name contains this substring |
--skip-typecheck |
Skip cargo check --tests |
--gui |
Open a Factorio window; stays open after the suite |
--timeout <SECS> |
Kill Factorio if the suite does not finish (default: 120) |
--listen |
Keep Factorio alive after the suite (for hot-reload re-runs) |
--rerun |
Rebuild, sync into the listen workdir, wait for the next suite |
--listen and --rerun are mutually exclusive. --rerun starts a listen
process if none is running (Bacon-friendly). Recipe:
Hot reload with Bacon.
Requires a Factorio binary (FACTORIO_PATH recommended). Steam protocol-only
installs are not supported for testing.
factorio-rs bench
Section titled “factorio-rs bench”Build the mod, discover #[factorio_rs::bench] functions, launch Factorio
(headless by default), time each bench with LuaProfiler, and print a sample
report.
See Benchmarking.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: release |
--debug-level <N> |
Override profile debug comments |
[FILTER] |
Only run benches whose name contains this substring |
--skip-typecheck |
Skip cargo check --tests |
--gui |
Open a Factorio window; stays open after the suite |
--timeout <SECS> |
Kill Factorio if the suite does not finish (default: 120) |
Requires a Factorio binary (FACTORIO_PATH recommended), same as test.
factorio-rs dap
Section titled “factorio-rs dap”Build/sync the mod (default profile debug), launch Factorio with --dap,
and proxy the Debug Adapter Protocol on stdio while remapping Rust↔Lua via
*.lua.map.json sourcemaps.
See Debugging.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--debug-level <N> |
Override profile debug comments |
--gui |
Open a Factorio window |
--mods-path <PATH> |
Mods parent dir (default FACTORIO_MODS_DIR / ~/.factorio/mods) |
--skip-build |
Use existing dist/ + deployed mod |
--skip-typecheck |
Skip cargo check before transpile |
factorio-rs profile
Section titled “factorio-rs profile”Build/sync, run Factorio under DAP, collect profiler output from
script-output, remap Lua locations to Rust, and emit a speedscope JSON when
possible.
See Debugging.
| Flag | Description |
|---|---|
--manifest-path <PATH> |
Project directory or Factorio.toml |
--profile <NAME> |
Default: debug |
--gui |
Open a Factorio window |
--mods-path <PATH> |
Mods parent dir |
--skip-build |
Use existing dist/ + deployed mod |
--timeout <SECS> |
Max wait for profiler dump (default: 180) |