21 releases (stable)
1.3.7 | Oct 22, 2024 |
---|---|
1.2.4 | Aug 14, 2024 |
1.1.0 | Jun 3, 2024 |
0.1.4 | Mar 30, 2024 |
0.1.2 | Nov 27, 2023 |
#184 in Parser implementations
1,321 downloads per month
140KB
1K
SLoC
Runnables CLI
CLI to run executables in a (usually cargo) workspace.
Install
cargo install runnables-cli
Note. requires Cargo. Install with rustup.
Usage
It's just run
in the workspace directory.
The TUI will load in, and you can use j
and k
(or up / down arrows) to move the selector.
Press Enter
over the desired selection to run it. Or you can use another letter to do something specific,
like R
for cargo run --release
. All possible letters / actions are displayed in the right pane.
Press Tab
to activate search mode, and Tab
again to exit search and return to the filtered selections.
Pressing Esc
while in search mode will clear the selection and exit search, and pressing Esc
again will close the TUI (just like q
).
cli to run executables in a workspace
Usage: run [OPTIONS] [PATH]
Arguments:
[PATH] The root path to search for runnables. Default: "." [default: .]
Options:
-r, --runnable <RUNNABLE> Specify a specific runnable to run. Example: - "just-ls" or "RunFile:just-ls" - match to a runnable declared in runfile. - "RustBin:runnables-cli" - match to a runnable picked up as a rust binary crate
-s, --search <SEARCH> Open the interface with a pre-filled search query
-c, --color <COLOR> Specify the color theme to use [default: Blue]
-i, --ignore <IGNORE> Ignore specific runnable types [possible values: none, run-file, shell, rust-bin, rust-lib]
-h, --help Print help
-V, --version Print version
What it does:
- Recursively scans the current and any nested directories.
- Picks up any shell scripts, runfile.toml, and reads Cargo.tomls.
- Presents user with the options.
Cargo projects
All member crates in a workspace will be picked up. It doesn't need to be a workspace either, any folder with multiple nested cargo projects (containing Cargo.toml) will be picked up.
They will be split by binary / library crate.
Runfile
Define specific commands to run in the runfile.toml
.
[just-ls]
description = "logs files / folders in current directory"
cmd = "ls -a"
[ls-in-src]
description = "logs files / folders in src directory"
cmd = "ls -a"
path = "src"
[ls-in-example]
description = "logs files / folders in example directory"
cmd = "ls -a"
path = "runnables-example"
.runignore
Since runnables-cli is scanning your directories recursively, folders which are deeply nested, or containing many files can make the cli take a noticable amount of time to load.
In this case, we can tell runnables to skip the directory by adding a .runignore
file.
This file contains directories (relative or absolute) to skip.
Dependencies
~9–19MB
~279K SLoC