# rust-shell-script/rust_cmd_lib

Common rust command-line macros and utilities, to write shell-script like tasks in a clean, natural and rusty way

Repository: https://github.com/rust-shell-script/rust_cmd_lib
Canonical: https://ross.abutalabs.com/products/rust_cmd_lib
Homepage: https://docs.rs/cmd_lib/
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: rust, pipe, command-line, shell, script, bash
Last push: 2026-06-16T07:19:19+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 87, release rhythm 8, longevity 100
- inputs: {"age_days": 2540, "days_push": 78, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1155, forks 41 (observed 2026-08-28T04:03:47.880609+00:00)

## What it is
cmd_lib is a Rust library providing macros and utilities for running external commands with shell-like piping, redirection, and error handling, without spawning a shell. It lets developers write shell-script-style tasks as safe, maintainable Rust code.

## Use cases
- run external commands with pipes in rust
- replace bash scripts with rust
- pipe command output between processes in rust
- redirect stdin stdout in rust without std::process boilerplate
- write shell-like automation tasks in rust
- run command groups with set -euo pipefail semantics

## When to choose
- you need piping or redirection between external commands in Rust
- you want to migrate unmaintainable shell scripts to Rust
- you want shell ergonomics with Rust type safety and error handling

## When to avoid
- you only need to spawn a single process and collect output - std::process::Command suffices
- you need full POSIX shell features like variable expansion of complex expressions or job control
- your task is pure shell and will never grow beyond a few lines

## Facets
- artifact type: library
- maturity: active
- function: developer-tools, cli, concurrency, error-handling
- domain: developer-tools
- platform: rust, windows, cross-platform
- tags: shell-scripting, process-piping, macros, bash-replacement, command-execution, command-line, automation, linux, macos

## Member repositories
- rust-shell-script/rust_cmd_lib (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:47.880609+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:32:14.353176+00:00, confidence not recorded.
  - readme: https://github.com/rust-shell-script/rust_cmd_lib (fetched 2026-08-28T04:03:47.880609+00:00, sha 9ead79d8919c)
  - homepage: https://docs.rs/cmd_lib/ (fetched 2026-08-29T12:37:39.492025+00:00, sha 7213b8270165)
  - site_page: https://docs.rs/ (fetched 2026-08-29T12:37:39.501552+00:00, sha 91f79b08d1b4)
  - site_page: https://docs.rs/crate/cmd_lib/latest (fetched 2026-08-29T12:37:39.503416+00:00, sha eeb485dd7bde)
  - site_page: https://docs.rs/crate/cmd_lib/latest/features (fetched 2026-08-29T12:37:39.505494+00:00, sha decb622752e4)
  - site_page: https://docs.rs/about (fetched 2026-08-29T12:37:39.506934+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T12:37:39.508381+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T12:37:39.509957+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T12:37:39.511661+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T12:37:39.513126+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
