Runt is a polyglot command runner designed for managing menial commands. It automatically generates a CLI based off of a Runtfile in your current working directory. This Runtfile is a simple markdown file that contains a list of commands and their descriptions. It even works with nested commands. Check out the example Runtfile in this repo!
brew tap jharrilim/runt
brew install runt
To use runt, pass the name of a command to the runt command.
runt [command]
- Switch to typed recursive decent parsing to properly support different types of in headers and paragraphs, such as text, links, and a combination thereof
- Support other shells
- Setup some syntax for declaring arguments, probably using lists
The Runtfile consists of three parts:
- The command name, which is declared in a header
- A description for the command
- Code to be executed for that command
The command name is declared in a header using the #
character. The
number of #
characters determines the level of nesting your command
will reside in, relative to the nearest parent command. For example,
the following Runtfile:
# Containers
## ls
List all containers
```bash
docker ps -a
```
will generate a CLI that has a container command with an ls subcommand. This is how you would run the command with runt:
runt container ls
There is even autogenerated help which will include the description under ls! Running this command:
runt container --help
Will give you:
Usage: runt container [COMMAND]
Commands:
ls List all containers
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
Command names can also have spaces or capital letters. Spaces are automatically converted into hyphens and capital letters are automatically converted into lowercase letters. For example, the following Runtfile:
# Containers
## List All
List all containers
```bash
docker ps -a
```
will generate a CLI that has a container command with a list-all subcommand:
runt container list-all