Loading repository data…
Loading repository data…
Zemerik / repository
A fast and flexible CLI task runner for managing development workflows
A fast and flexible CLI task runner for managing development workflows. Built in Rust for maximum performance and reliability.
${VAR} or $VAR syntax in commands and pathsnpm install -g task-runner
# Clone the repository
git clone https://github.com/Zemerik/task-runner.git
cd task-runner
# Build and install
cargo build --release
cargo install --path .
task-runner.json):{
"env": {
"NODE_ENV": "development"
},
"tasks": {
"dev": {
"description": "Start development environment",
"commands": [
"npm run build:watch",
"npm run server:dev",
"npm run test:watch"
],
"parallel": true
},
"build": {
"description": "Build for production",
"dependencies": ["clean"],
"commands": [
"npm run compile",
"npm run bundle",
"npm run optimize"
]
},
"deploy": {
"description": "Deploy to production",
"dependencies": ["build", "test"],
"commands": [
"npm run deploy:staging",
"npm run health-check",
"npm run deploy:prod"
],
"env": {
"NODE_ENV": "production"
}
}
}
}
# List available tasks
task-runner list
# Run a single task
task-runner run build
# Run multiple tasks in parallel
task-runner run dev --parallel
# Run with dependencies
task-runner run deploy
Task Runner supports multiple configuration file formats:
task-runner.json (JSON)task-runner.yaml or task-runner.yml (YAML)task-runner.toml (TOML){
"env": {
"GLOBAL_VAR": "value"
},
"default_timeout": 300,
"default_working_dir": "./src",
"tasks": {
"task-name": {
"description": "Task description",
"commands": ["command1", "command2"],
"dependencies": ["other-task"],
"env": {
"TASK_VAR": "value"
},
"parallel": false,
"sequential": true,
"working_dir": "./custom/path",
"timeout": 60,
"continue_on_error": false,
"hidden": false
}
}
}
Task Runner supports environment variable expansion in command strings and working directory paths. You can use either ${VAR} or $VAR syntax:
{
"env": {
"NODE_ENV": "production",
"PORT": "3000",
"BUILD_DIR": "./dist"
},
"tasks": {
"build": {
"commands": [
"npm run build -- --out-dir ${BUILD_DIR}",
"echo Server will run on port $PORT"
],
"working_dir": "${BUILD_DIR}/src"
}
}
}
Environment variables are expanded in the following order:
env from configurationenv (task env overrides global env)Variables are expanded in:
working_dir and default_working_dir)| Property | Type | Description |
|---|---|---|
description | string | Human-readable task description |
commands | string[] | Commands to execute (supports ${VAR} and $VAR expansion) |
dependencies | string[] | Tasks that must run before this task |
env | object | Environment variables for this task |
parallel | boolean | Run commands in parallel |
sequential | boolean | Run commands sequentially |
working_dir | string | Working directory for task execution (supports variable expansion) |
timeout | number | Timeout in seconds |
continue_on_error | boolean | Continue if commands fail |
hidden | boolean | Hide from task list |
# List all tasks
task-runner list
# List with details
task-runner list --details
# Run a single task
task-runner run build
# Run multiple tasks
task-runner run build test deploy
# Run in parallel
task-runner run build test --parallel
# Run sequentially
task-runner run build test --sequential
# Continue on error
task-runner run build test --continue-on-error
# Show task details
task-runner info build
# Validate config file
task-runner validate
| Option | Description |
|---|---|
--config, -c | Specify configuration file path |
--verbose, -v | Enable verbose output |
--env, -e | Set environment for task execution |
{
"tasks": {
"dev": {
"description": "Start development server",
"commands": [
"npm run dev",
"npm run storybook"
],
"parallel": true
},
"build": {
"description": "Build for production",
"dependencies": ["clean"],
"commands": [
"npm run build",
"npm run test:ci"
]
},
"deploy": {
"description": "Deploy to staging",
"dependencies": ["build"],
"commands": [
"npm run deploy:staging"
]
}
}
}
env:
NODE_ENV: development
DATABASE_URL: postgresql://localhost/dev
tasks:
backend:
description: Start backend server
commands:
- "cargo run"
- "cargo test --watch"
parallel: true
working_dir: "./backend"
frontend:
description: Start frontend development
commands:
- "npm run dev"
- "npm run test:watch"
parallel: true
working_dir: "./frontend"
dev:
description: Start full development environment
dependencies: ["backend", "frontend"]
commands: []
test:
description: Run all tests
commands:
- "cargo test"
- "npm run test"
working_dir: "."
Task Runner provides comprehensive error handling:
Built in Rust, Task Runner is designed for speed:
MIT License - see LICENSE file for details.