Crates.io | awesome-cli |
lib.rs | awesome-cli |
version | 0.1.1 |
source | src |
created_at | 2024-01-10 00:13:10.992438 |
updated_at | 2024-06-02 17:30:18.764624 |
description | A command runner designed to streamline command orchestration. |
homepage | https://github.com/jeremychone/rust-awesome-cli |
repository | https://github.com/jeremychone/rust-awesome-cli |
max_upload_size | |
id | 1094756 |
size | 63,558 |
This is deprecated. The new crate is arun.
arun is the maintained version. It provides the lib arun
that can be embedded in code, or the CLI arun-cli
which uses the lib.
DISCLAIMER: Version
0.1.x
is still a work in progress and might see some changes. Awesome-cli will follow semver more strictly for version0.2.x
and onwards.
awesome-cli allows you to describe a set of commands as either groups or individually, and run them accordingly.
The configuration file is named Awesome.toml
and should be located in the same directory as this file.
A Runner
is a command description that can be executed by awesome-cli.
There are two types of "Runners":
Grouped Runners
[[runners._group_name_]]
TOML array of tables for each group name (e.g., [[runners.dev]]
).awesome _group_name_
(e.g., awesome dev
), all the runners in this group will be executed in the order they are listed in the file.awesome _group_name_._runner_name
(e.g., awesome dev.cargo_build
).Solo Runner
[[runner]]
TOML array of tables, where each runner has a name
or ref
property.awesome _runner_name
(e.g., awesome list_files
).# Solo Runner
[[runner]]
name = "list_files"
cmd = "ls"
args = ["-ll"]
[[runner]]
name = "list_files_human"
cmd = "ls"
args = ["-llh"]
[[runners.build]]
name = "tauri_icons"
working_dir = "crates/app-desktop/"
when.no_file_at = "icons/32x32.png"
cmd = "cargo"
args = ["tauri", "icon", "icons/app-icon.png"]
[[runners.build]]
name = "cargo_build"
working_dir = "crates/app-desktop/"
cmd = "cargo"
args = ["build"]
[[runners.build]]
name = "pcss"
working_dir = "frontend/"
cmd = "npm"
args = ["run", "pcss"]
# Now: runners, can ref other runner (only one hop for now)
[[runners.dev]]
ref = "build.tauri_icons"
[[runners.dev]]
ref = "build.pcss"
# The args from the target will be extended with the args_add items
args_add = ["--", "-w"]
# will run concurrently
concurrent = true
# if this process exit, end the dev session
end_all_on_exit = true
Then we can just run like so:
awesome build
- Will run all of the runners.build
in orderawesome dev
- Will run all runnders.dev
in orderawesome build.tauri_icons
- Will only run tauri icons commandawesome list_files
- Will execute the solo runner named list_files