A simple, fast task runner that executes commands defined in TOML files with environment variable support and Node.js/npm script integration.
curl -sSL https://raw.githubusercontent.com/lassejlv/taskfile/main/install.sh | bash
# to uninstall use
curl -sSL https://raw.githubusercontent.com/lassejlv/taskfile/main/uninstall.sh | bashDownload the latest release for your platform from GitHub Releases.
git clone https://github.com/lassejlv/taskfile.git
cd taskfile
cargo build --release
cp target/release/task ~/.local/bin/- Initialize a new Taskfile or create a
Taskfile.toml:
task init # Creates a default Taskfile.tomlOr manually create a Taskfile.toml:
[env]
files = [".env", ".env.local"]
[tasks.hello]
cmd = "echo 'Hello $USER_NAME!'"
desc = "Greet user"
[tasks.build]
cmd = "cargo build"
desc = "Build project"
[tasks.format]
cmd = "prettier . --write"
desc = "Format code using prettier from node_modules"
[tasks.test]
cmd = "jest"
desc = "Run tests using npm script"- Create
.envfile:
USER_NAME=Developer- Run tasks:
task init # Initialize new Taskfile.toml
task list # List all tasks
task hello # Run hello task
task build # Run build task- ✅ Environment variable substitution (
$VAR_NAME) - 🔗 Task dependencies with
depends_on - 📋 Clean table output for task listing
- 🎨 Colored success/error indicators with real-time spinner
- ⏱️ Task execution timing
- 📁 Multi-file env support with precedence
- 🟢 Node.js/npm script integration
- 📦 Automatic
node_modules/.binPATH enhancement - 🏗️ Modular crate architecture
- 🚫 Circular dependency detection
- 🚀 Auto-initialization of Taskfile.toml
When a package.json file is detected, the task runner automatically:
- Detects npm scripts and runs them with the appropriate package manager (npm/yarn/pnpm)
- Adds
node_modules/.binto PATH for direct access to installed tools - Supports commands like
prettier,eslint,jestwithout full paths
Example:
[tasks.lint]
cmd = "eslint ."
desc = "Lint code (will use node_modules/.bin/eslint)"
[tasks.format]
cmd = "prettier . --write"
desc = "Format code (will use node_modules/.bin/prettier)"
[tasks.test]
cmd = "test"
desc = "Run npm test script"- Linux (x86_64, ARM64)
- macOS (Intel, Apple Silicon)
crates/env-parser- Environment variable parsing and substitutioncrates/runner- Task execution engine with Node.js integrationcrates/cli- Command-line interface