Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The rusteal CLI

Every Rusteal task is a rusteal command. Commands that act on a project take its directory as an argument, or find it by walking up from the current directory, so inside a project you can leave the path out.

CommandWhat it doesPage
rusteal new <Name>Creates a project from a template and builds it.Your first project
rusteal setup <path>Installs the Rusteal plugins into an existing project.Adding Rusteal to an existing project
rusteal buildBuilds the Rust libraries and deploys them.Building
rusteal build --allRuns the whole pipeline: engine build, bindings, Rust.Building
rusteal watchBuilds every time a Rust source file changes.rusteal watch
rusteal generateRegenerates the bindings crate and the C++ wrappers.Building
rusteal upgradeMoves the project to the CLI’s Rusteal version.Versions and upgrades
rusteal packageBuilds the release libraries and packages the game.Packaging a game
rusteal plugin new <Name>Creates a Rust plugin in the project.A new plugin
rusteal plugin package <Name>Copies a plugin out, ready for another project.Packaging a plugin

rusteal help <command> and rusteal <command> --help list the flags of each command.

A day with the CLI

A typical session, once the project exists:

cd ~/Projects/MyGame
rusteal watch

Open the editor, change Rust code, save: rusteal watch builds, the editor reloads the library, and you press Play. When you change rusteal.toml or the engine version, stop the watch and run rusteal build --all once. When the game is ready to be tried outside the editor, run rusteal package.

Use case: running the CLI from the IDE

The goal: start rusteal watch from the IDE, with one run configuration that works on Linux and on Windows.

Every command is also a Cargo subcommand: cargo rusteal watch is rusteal watch (cargo install rusteal installs both). In RustRover:

  1. Open Run > Edit Configurations….
  2. Click + and choose Cargo.
  3. Name it rusteal watch, and set Command to rusteal watch.
  4. Set Working directory to the project’s Rust directory: the command finds the project by walking up from it.
  5. Tick Store as project file to share it with the rest of the team, then click OK.

Screenshot: RustRover’s Run/Debug Configurations with a Cargo configuration whose command is rusteal watch. (images/cli/rustrover_watch.png)