devrun-0.1.1 is not a library.
run
A simple scripting language for CLI automation. Define functions in a Runfile (or ~/.runfile) and call them from the command line to streamline your development workflow (a cross between make, just, and sh, but simpler than all three!)
Prerequisites
- Rust toolchain with Cargo
- Windows users: You must have Git Bash, WSL, or MSYS2 installed. The tool requires a bash-compatible shell for command execution.
Installation
Install via crates.io with Cargo:
Usage
- Run a script file:
- Call a function defined in your
Runfile: - Pass arguments to functions:
- Start an interactive shell (REPL):
- List all available functions defined in your Runfile:
If no Runfile is found, you'll see:
If your Runfile exists but has no functions, you'll see:Error: No Runfile found. Create ~/.runfile or ./Runfile to define functions.No functions defined in Runfile.
Note for Windows users: All commands are executed using bash. Ensure you launch your terminal in Git Bash, WSL, or MSYS2 for full compatibility with Runfile syntax and shell features.
Runfile Examples (npm, uv, docker, arguments)
# Example for python, node, and docker
python:install() uv venv && uv pip install -r requirements.txt
python:test() uv pip install pytest && pytest
node:dev() npm install && npm run dev
node:lint() npm run lint
docker:build() docker build -t myapp .
docker:run() docker run -it --rm myapp
docker:shell() docker compose exec $1 bash
docker:logs() docker compose logs -f $1
git:commit() git commit -m "$1" && echo "${2:-Done}"
echo_all() echo "$@"
Calling Nested Functions and Passing Arguments
- To call a nested function, use space-separated names:
- Arguments are passed positionally and available as
$1,$2,$@, etc. Default values can be set using shell syntax (e.g.,${2:-done}).
Configuration
- Place your
Runfilein the project root or in your home directory as.runfile. - Functions are defined as
name()followed by a command on the same line. - Arguments can be passed to functions and accessed as
$1,$2,$@, etc. - Defaults are also supported (as in bash)
${1:-default}
License
MIT