No description
Find a file
ansgarz b29c390e26
All checks were successful
/ build (push) Successful in 4m12s
release: 0.0.6-SNAPSHOT
2026-04-11 11:03:21 +02:00
.forgejo/workflows add test to ci 2026-02-11 18:12:40 +01:00
demo add interactive commands 2026-03-20 17:53:43 +01:00
doc rename processor 2026-04-11 11:01:37 +02:00
rush_task initial 2026-02-11 17:50:23 +01:00
rust-script-demo initial 2026-02-11 17:50:23 +01:00
src rename processor 2026-04-11 11:01:37 +02:00
tests make dir_exists public 2026-03-23 20:04:19 +01:00
.gitignore initial 2026-02-11 17:50:23 +01:00
Cargo.lock rename processor 2026-04-11 11:01:37 +02:00
Cargo.toml release: 0.0.6-SNAPSHOT 2026-04-11 11:03:21 +02:00
README.md update README.md 2026-03-14 12:06:37 +01:00

Rush

Execute shell commands with Rust. With support for handling of output and errors.

Getting started

Add dependencies in Cargo.toml

rush = { git = "https://repo.prod.meissa.de/meissa/rush.git", tag = "0.0.1" }
rush_task = { git = "https://repo.prod.meissa.de/meissa/rush.git", tag = "0.0.1" }

Using a simple command

Add imports and use function cmd

use rush::core::command::cmd;

fn hello_world() {
    cmd("echo hello world");
}

Define a task (by proc macro)

use rush::core::command::cmd;
use rush_task::task;

#[task]
pub fn my_task() {
    cmd("echo my first command");
    cmd("echo my second command")
}

fn main() {
    my_task()
}

Output

There are several options to control the printed output. E.g. to suppress result output at all use:

set_output_mode(OutputMode::Quiet);
cmd("This command does not appear in the result output");

Run with rust-script

See rust-script-demo/README.md

Sessions

There are a bunch of sessions available to run your commands either

  • locally
  • in a container
  • as dry-run without any execution (commands are only printed)

Example for a container session:

use rush::core::command::{cmd};
use rush::core::file_io::{create_dirs, create_file};
use rush::core::session::{default_container_session};

fn main() {
   default_container_session(|| {
     cmd("echo hello from container!");
     // create folders and file
     create_dirs_in_current_dir("folder1/folder2");
     create_file("test-file.txt", "Hello from test file.\n", "folder1/folder2");
     cmd("echo good bye from session!");
   });
}

Output

You'll get an overview of all tasks and commands executed and if they succeeded, e.g.:

=============== Start ===============
---> Success task_a
-----> Success task_b
-----> Success task_c
-> Success task_d
=============== End ================

Examples

A bunch of examples can be found in: main.rs

Principles

principles.md

Api architecture

api-architecture.md

License

MIT License.

Project status

Under development.