Groolp is a Gulp-like task runner written in Go that streamlines your development workflows by automating common tasks—like building, testing, and deploying—with ease. It allows you to define tasks using a simple YAML configuration and extend its functionality with dynamic Lua scripts. Whether you need a quick one-liner or a complex build pipeline, Groolp offers a powerful and flexible, cross-platform solution to manage your project's tasks.
- Сross-platform
Runs seamlessly on Linux, macOS, and Windows.
- Simple task definition
Define simple tasks using an easy-to-read tasks.yaml file. Just specify the command and any dependencies,
and Groolp handles the rest. For more advanced tasks, use dynamic Lua scripts; Groolp exposes useful
bridging functions like run_command, set_data, and get_data.
- Task dependencies
Set dependencies in your tasks.yaml or Lua scripts to create robust, ordered pipelines. Groolp detects
circular dependencies and prevents them.
- File Changes Watcher
Groolp includes a file watcher that detects changes in your project and can automatically trigger tasks. Perfect for continuous integration or live development workflows.
- Persistent data storage
Can be accessed from Lua tasks for get/set interactions and is automatically saved in a per-project
.groolpdirectory.
Clone the repository and build Groolp:
git clone https://github.com/ystepanoff/groolp
cd groolp
go build -o groolp cmd/main.goDownload the latest release from the releases page and add it to your PATH.
- Initialize a new project:
groolp initThis creates a .groolp directory with:
tasks.yaml- Your task definitionsscripts/- Directory for Lua scripts- A sample Lua script to help you get started
- Basic task definition in
tasks.yaml:
tasks:
build:
command: go build -o myapp .
description: Build the application
watch:
- "*.go"
- "go.mod"
- "go.sum"
test:
command: go test ./...
description: Run tests
depends:
- build
lint:
command: golangci-lint run
description: Run linter
depends:
- build- Advanced tasks with Lua scripts:
Create a file in
.groolp/scripts/custom_task.lua:
function run()
-- Access persistent storage
local last_run = get_data("last_run")
if last_run then
print("Last run: " .. last_run)
end
-- Run commands
local result = run_command("go version")
print("Go version: " .. result)
-- Store data
set_data("last_run", os.date())
-- Complex logic
if some_condition then
run_command("go build -o myapp .")
end
end- Development Workflow
tasks:
dev:
command: go run main.go
watch:
- "*.go"
- "templates/*"
description: Run development server with hot reload
format:
command: go fmt ./...
description: Format all Go files
clean:
command: rm -rf build/
description: Clean build artifacts- Build Pipeline
tasks:
build-all:
depends:
- lint
- test
- build
description: Run complete build pipeline
build:
command: |
go build -o build/app
cp -r templates build/
description: Build application with assets
deploy:
command: ./scripts/deploy.sh
depends:
- build-all
description: Deploy to production- Testing and Quality
tasks:
test-coverage:
command: go test -coverprofile=coverage.out ./...
description: Generate test coverage
test-html:
command: go tool cover -html=coverage.out
depends:
- test-coverage
description: View coverage in browserTasks in tasks.yaml support the following options:
command: Shell command to executedescription: Human-readable task descriptiondepends: List of task dependencieswatch: List of file patterns to watch for changesscript: Path to Lua script (relative to.groolp/scripts/)env: Environment variables for the tasktimeout: Maximum execution time in seconds
Example with all options:
tasks:
complex-task:
command: ./build.sh
description: Complex build task
depends:
- prepare
- validate
watch:
- "src/**/*"
- "config/*.yaml"
script: complex_build.lua
env:
GOOS: linux
GOARCH: amd64
timeout: 300Available functions in Lua scripts:
run_command(cmd): Execute shell command and return outputget_data(key): Retrieve stored dataset_data(key, value): Store data persistentlywatch_files(patterns): Add file patterns to watchlog(message, level): Log messages (levels: info, warn, error)
-
Task Organization
- Group related tasks together
- Use meaningful task names
- Document complex tasks with descriptions
- Keep tasks focused and single-purpose
-
Performance
- Use file watching judiciously
- Implement proper task dependencies
- Cache expensive operations using persistent storage
- Use Lua scripts for complex logic
-
Maintenance
- Keep tasks.yaml clean and well-documented
- Version control your .groolp directory
- Use consistent naming conventions
- Document custom Lua scripts
Common issues and solutions:
-
Task not running:
- Check task dependencies
- Verify command syntax
- Ensure required tools are installed
- Check file permissions
-
Watch not working:
- Verify file patterns in watch section
- Check file system events are supported
- Ensure no circular dependencies
-
Lua script errors:
- Check script syntax
- Verify API function usage
- Review error messages in logs
Thank you for considering contributing to Groolp! Contributions of all kinds are welcome.
- Fork the repository:
- Click the "Fork" button on GitHub to create your own copy.
- Clone your fork:
git clone https://github.com/your-username/groolp.git
cd groolp- Create a new branch:
git checkout -b feature/your-feature-name- Make new changes:
- Implement your feature or fix.
- Commit & Push:
git commit -m "Add feature: your feature description"
git push origin feature/your-feature-name- Submit a pull request:
- Go to the original Groolp repository and submit a pull request.
- Follow Go's Effective Go guidelines.
- Ensure your code is formatted (
go fmt) and linted. - Write clear and concise commit messages.
If you encounter bugs or have feature requests, please open an issue on GitHub with detailed information.