cargo-exec brings the npm run functionality to the Rust and Cargo ecosystem.
bash
cargo install cargo-exec
Scripts are defined by adding a [package.metadata.scripts] section to the Cargo.toml file of your project, as shown below.
toml
[package.metadata.scripts]
hello = "echo Hello"
bash
cargo exec hello