A simple, file-based task runner inspired by hereby, written in Go.
Velka helps you define and run project-specific tasks like building, testing, and linting using a straightforward YAML configuration file.
- Simple YAML Configuration: Define all your tasks in a single, easy-to-read
tasks.yamlfile. - Task Dependencies: Easily define dependencies between tasks.
- Parallel Execution: Run multiple tasks concurrently for maximum efficiency.
- Environment Variables: Set global or per-task environment variables.
- Custom Directories: Run tasks in specific working directories.
- Pre/Post Hooks: Execute commands before or after your main task commands.
- Discoverable Tasks: List all available tasks with a simple command.
- Dry Run Mode: Preview the tasks and commands that will be executed without running them.
To get started, clone the repository and build the executable:
git clone https://github.com/kyzsuukii/velka.git
cd velka
go build -o velka .You can then move the velka executable to a directory in your $PATH to make it available system-wide.
The Velka CLI is simple and intuitive.
To run one or more tasks, simply pass their names as arguments:
# Run the default task
./velka
# Run a single task
./velka build
# Run multiple tasks in parallel
./velka test lintTo see a list of all defined tasks and their descriptions:
./velka list--file, -f: Specify a custom path for the configuration file (default:tasks.yaml).--dry-run: Print the tasks and commands that would be executed without running them.
./velka --file=ci-tasks.yaml test
./velka --dry-run buildAll tasks are defined in a tasks.yaml file. Here is a complete example demonstrating all features:
# Global environment variables available to all tasks
env:
- "GLOBAL_VAR=hello from global"
# The task to run when no arguments are provided
default: test
# The main map of all available tasks
tasks:
build:
description: "Builds the main application."
pre_run:
- echo "Starting the build..."
run:
- echo "Building... ($GLOBAL_VAR)"
post_run:
- echo "Build finished."
test:
description: "Runs the test suite."
dependencies:
- build
env:
- "TEST_VAR=hello from test"
run:
- 'echo "Testing with var: $TEST_VAR"'
lint:
description: "Lints the codebase."
run:
- echo "Linting..."
frontend:
description: "Runs frontend tasks in its own directory."
dir: "packages/frontend"
run:
- echo "Running frontend task in $(pwd)"Contributions are welcome! Please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.