groom
- published
- reading time
- 2 minutes
🧹 groom
groom
is a yet another os-agnostic task runner.
✨ Features
- 🔥 Task runner with a simple yet powerful toml syntax
- 🧹 Single static binary without dependencies
- 💻 Neovim plugin for integration with
neovim
.
Functionality
Config file
- Requires a simple
groom.toml
file in the project root. groom
automatically recurses to the project root to find agroom.toml
file.- A global
[variables]
section for user variables. - They support inline variable substition.
1name = "example-project"
2
3[variables]
4version = "0.0.1"
5
6# Tasks start with '[task.<task-name>]'
7# They should contain, 'command' property.
8# Other fields are optional.
9[task.build]
10description = "Build the project."
11command = "go build ."
12
13# Tasks can contain 'commands' as a list of commands.
14[task.run]
15commands = [
16 "go run main.go",
17 "python -m exaple-project",
18]
19
20# Tasks can contain dependencies, and environment variables defined
21[task.test]
22environment = [ "TESTS=1" ]
23directory = "test"
24command = "python -m unittest"
25depends = [
26 "format"
27]
28
29[task.format]
30command = "go fmt ./..."
You can run
groom --example-config
to get a working example config.
Task
A task
in groom
needs a name and atleast a single command.
This can be a task.
It can contain
- Environment variables
- List of environment variables with it’s values as string.
- Task dependencies
- List of dependencies which should be valid groom tasks.
- Multiple commands
- List of commands to execute
sequentially
. - When
command
andcommands
both exist.commands
takes precedence.
- List of commands to execute
- Description
- A single line describing the purpose of the task.
- Directory
- A absolute path to change the working directory before executing the commands.
1[task.build]
2depends = [
3 "format"
4]
5description = "Build the project"
6directory = "src"
7environment = ["DEBUG_BUILD=0"]
8commands = [
9 "gcc -c main.o main.c",
10 "gcc -c game.o game.c",
11 "gcc -o $name game.o main.o"
12]
Everything except
name
andcommand
are optional
List
Run groom
without any arguments to list all configured tasks.
Use
--simple
to list all tasks without any fancy printing. Useful with scripts.
Executing tasks
Provide a list of tasks to execute and watch groom
execute them!
Use the
--dry-run
argument to show the log without actually running anything.
Neovim Plugin
A neovim
plugin is in the works for integrating groom
with Neovim.
It allows you to run tasks without leaving your editor.
Find it here
Contributing
⭐ Star the project if you like it!
Feel free to contribute to the project, by either raising a issue or opening a PR.