A simple CLI tool to test, build and run Rust projects with specific command-line arguments.
- Automatically detects and tests or builds Rust projects
- Supports building in debug and release modes
- Can copy release builds to a specified directory
- Passes through command-line arguments to the target application
- Flexible project selection via current directory, project name, or explicit flag
# Run a project (builds in release mode and executes)
rustr [--project PROJECT] [PROJECT] [ARGS...]
# Run tests for a project
rustr [--project PROJECT] [PROJECT] --test
# Build project
rustr [--project PROJECT] [PROJECT] --build
# Build in release mode
rustr [--project PROJECT] [PROJECT] --release
# Build in release mode and copy to ~/bin (or specified path)
rustr [--project PROJECT] [PROJECT] --release-bin [DESTINATION]Note: rustr is designed to operate on other projects. If you are inside the rustr repository itself, just run the usual cargo build, cargo test, etc.
The target project can be specified in three ways:
- Using the
--projectflag:rustr --project myprojectorrustr --project=myproject - As a positional argument:
rustr myproject - Automatically when in a project directory:
rustr
The --project flag takes precedence over other methods.
When multiple task runner flags are specified, they are handled in this order:
--test(highest precedence)--build--release--release-bin
For example:
rustr myproject --release-bin --testwill only perform the--testoperationrustr myproject --build --release --release-binwill only perform the--buildoperationrustr myproject --release --release-binwill only perform the--releaseoperationrustr myproject --release-binwill perform the--release-binoperation
If no task runner flags are specified, the target project will be built in release mode and executed with any provided arguments.
# Run a project with arguments
rustr myproject --arg1 value1 --arg2 value2
# Build a project in release mode
rustr myproject --release
# Copy release build to ~/bin
rustr myproject --release-bin
# Copy release build to custom directory
rustr myproject --release-bin=/path/to/dir
# Run tests for the project in the current directory
rustr --testcargo install --path .This project is not intended for active development or contributions. You are welcome to fork the project, adapt the code, and use it in your own projects under the terms of the license. There is no expectation of future updates or contributions back to this repository.
MIT