#automation #workflow #maintained #rust-lang #ready-for-use

build cargo_auto_lib

Automation tasks coded in Rust language for the workflow of Rust projects

37 stable releases

2.4.8 Apr 23, 2024
2.0.8 Mar 30, 2024
1.4.8 Mar 7, 2024
0.8.60 Oct 17, 2022
0.7.22 Sep 18, 2021

#399 in Build Utils

Download history 51/week @ 2024-02-01 9/week @ 2024-02-08 719/week @ 2024-02-15 1400/week @ 2024-02-22 990/week @ 2024-02-29 518/week @ 2024-03-07 41/week @ 2024-03-14 3/week @ 2024-03-21 404/week @ 2024-03-28 32/week @ 2024-04-04 391/week @ 2024-04-11 641/week @ 2024-04-18 95/week @ 2024-04-25

1,177 downloads per month
Used in 4 crates

MIT license

1.5K SLoC


Automation tasks coded in Rust language for the workflow of Rust projects
version: 2.4.8 date: 2024-04-23 author: Bestia.dev repository: GitHub

maintained ready-for-use rustlang automation workflow

logo cargo_auto_lib is part of the automation_tasks_rs project

crates.io Documentation crev reviews Lib.rs
License Rust Newest docs cargo_auto_lib

Lines in Rust code Lines in Doc comments Lines in Comments Lines in examples Lines in tests

Hashtags: #maintained #ready-for-use #rustlang #automation #workflow
My projects on GitHub are more like a tutorial than a finished product: bestia-dev tutorials.
I recommend using the CRUSTDE - Containerized Rust Development Environment to write Rust projects on Linux, isolated from your system.

Try it

First, install the tool for task automation in Rust projects:

cargo install cargo-auto
# Generate a new Rust CLI project:
cargo auto new_cli hello_world
# Open the `hello_world` project in VSCode:
code hello_world
# Open the generated directory `automation_tasks_rs` as an independent rust project in VSCode.
code hello_world/automation_tasks_rs

Now we can analyze the automation code. There is already this dependency inside Cargo.toml for our library:


Review the code in automation_tasks_rs/main.rs. The cl:: namespace is the alias for cargo_auto_lib.

/// cargo build --release
fn task_release() {
    let cargo_toml = CargoToml::read();

    cl::run_shell_command("cargo fmt");
    cl::run_shell_command("cargo build --release");
    {YELLOW}After `cargo auto release`, run the compiled binary, examples and/or tests{RESET}
{GREEN}./target/release/{package_name} arg_1{RESET}
    {YELLOW}if ok then{RESET}
{GREEN}cargo auto doc{RESET}
package_name = cargo_toml.package_name(),

You can see this function will increment the version in Cargo.toml.
Then it will copy some data from Cargo.toml to README.md (title, description, version, author,...).
It will count the lines of code and create badges in README.md.
Then comes the traditional Rust part: cargo fmt and cargo build --release.
Finally, it will show on the screen the instructions on how to continue developing.

Run (in your main rust project):

cargo auto release

Now open the README.md and you will see the data that this automation task copied from other places. Therefore you change this data only in one place, the automation task copies them wherever needed.

Panic!() and unwrap()

I want the tasks to exit immediately on any error. So I use unwrap() and panic!() a lot.
On purpose. And because I wrote this before I learned Rust error handling.

Development details

Read the development details in a separate md file:

Releases changelog

Read the release changelog in a separate md file:


  • remove the existing support for workspaces. Workspaces are a mess
  • change it so that every member must have its own automation
  • the workspace automation then calls the member's automation
  • It is better to have a non-workspace group of projects that are
  • developed together using single workflow automation

Open-source and free as a beer

My open-source projects are free as a beer (MIT license).
I just love programming.
But I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my PayPal.
You know the price of a beer in your local bar ;-)
So I can drink a free beer for your health :-)
Na zdravje! Alla salute! Prost! Nazdravlje! 🍻



~573K SLoC