# cargo-run
[](https://crates.io/crates/cargo-run)
[](https://docs.rs/cargo-run)
[](https://docs.rs/cargo-run/0.1.0)


<br />
[](https://deps.rs/crate/cargo-run/0.1.0)
[](https://crates.io/crates/cargo-run)
A CLI tool to run custom scripts in Rust, defined in `Scripts.toml`.
## Features
- Run scripts defined in `Scripts.toml`.
- Specify interpreters for scripts (e.g., bash, zsh, PowerShell).
- Initialize a `Scripts.toml` file with default content.
- Chain multiple scripts together using the `include` feature.
## Installation
To install `cargo-run`, use the following command:
```sh
cargo install cargo-run
```
## Usage
To run a script, use the following command:
```sh
cargo-script <option> <script_name>
```
Or
```sh
cgs <option> <script_name>
```
Complete script:
```sh
cgs run <script_name>
// Or
cargo-script run <script_name>
```
## Scripts Examples
The `Scripts.toml` file is used to define scripts. The file is located in the root of the project directory. The following is an example of a `Scripts.toml` file:
```toml
[scripts]
# run a shell script
run_shell = "./.scripts/i_am_shell.sh"
# run a shell script with interpreter, also add script info
config = { interpreter = "bash", command = "echo 'test'", info = "Script to test" }
# run inline script
build = "echo 'build'"
# run chain of scripts
release = { include = ["i_am_shell", "build"] }
```