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.
| Command | What it does | Page |
|---|---|---|
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 build | Builds the Rust libraries and deploys them. | Building |
rusteal build --all | Runs the whole pipeline: engine build, bindings, Rust. | Building |
rusteal watch | Builds every time a Rust source file changes. | rusteal watch |
rusteal generate | Regenerates the bindings crate and the C++ wrappers. | Building |
rusteal upgrade | Moves the project to the CLI’s Rusteal version. | Versions and upgrades |
rusteal package | Builds 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:
- Open Run > Edit Configurations….
- Click + and choose Cargo.
- Name it
rusteal watch, and set Command torusteal watch. - Set Working directory to the project’s
Rustdirectory: the command finds the project by walking up from it. - 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)