Project Case Study
Fluxfile
Modern task runner and build automation tool with a clean, minimal syntax.
FluxFile
Modern task runner and build automation tool with a clean, minimal syntax.
โก Single binary, zero config โ Define tasks with a beautiful DSL and run them anywhere.
โจ Key Features
๐ Task Runner
Clean, indentation-based DSL for defining tasks
๐ Smart Dependencies
Automatic resolution with cycle detection
โก Parallel Execution
Run tasks concurrently for faster builds
๐พ Smart Caching
Input/output tracking for incremental builds
๐ File Watching
Auto-rerun tasks when files change
๐ณ Docker Support
Run tasks inside containers seamlessly
๐ Comparison
| Feature | FluxFile | Make | Taskfile | just | Mage |
|---|---|---|---|---|---|
| Clean Syntax | โ | โ | โ | โ | โ ๏ธ |
| Smart Caching | โ | โ | โ ๏ธ | โ | โ |
| Watch Mode | โ | โ | โ | โ | โ |
| Parallel Tasks | โ | โ ๏ธ | โ | โ | โ ๏ธ |
| Matrix Builds | โ | โ | โ | โ | โ |
| Docker Support | โ | โ | โ | โ | โ |
| Remote SSH | โ | โ | โ | โ | โ |
| Profiles | โ | โ | โ | โ ๏ธ | โ ๏ธ |
๐ฆ Installation
Package Managers
# macOS / Linux (Homebrew)
brew install ashavijit/tap/flux
# Windows (Scoop)
scoop bucket add flux https://github.com/ashavijit/fluxfile
scoop install flux
Quick Install
๐ง Linux / macOS
curl -fsSL https://raw.githubusercontent.com/ashavijit/fluxfile/main/scripts/install.sh | sh
๐ช Windows
iwr -useb https://raw.githubusercontent.com/ashavijit/fluxfile/main/scripts/install.ps1 | iex
Download Binaries
| Platform | Architecture | File |
|---|---|---|
| Linux | x64 | flux-linux-amd64.tar.gz |
| Linux | ARM64 | flux-linux-arm64.tar.gz |
| macOS | Intel | flux-darwin-amd64.tar.gz |
| macOS | Apple Silicon | flux-darwin-arm64.tar.gz |
| Windows | x64 | flux-windows-amd64.zip |
๐ Quick Start
Create a FluxFile in your project root:
var PROJECT = myapp
task build:
desc: Build the binary
run:
go build -o bin/${PROJECT} ./cmd
task test:
desc: Run tests
deps: build
run:
go test ./... -v
task dev:
desc: Watch and rebuild
watch: **/*.go
run:
go run ./cmd
Run tasks:
flux build # Run build task
flux -t test # Run test task
flux -w dev # Watch mode
flux -l # List all tasks
flux --report test # Show timing report
๐ก Tip: Use
flux --graphto visualize task dependencies!
โ๏ธ Task DSL Reference
task name:
desc: string # Task description
deps: task1, task2 # Dependencies
parallel: true|false # Run deps in parallel
if: VAR == value # Conditional execution
env: # Environment variables
KEY = value
run: # Commands to execute
command1
command2
# Caching & Incremental Builds
cache: true # Enable caching
inputs: # Files that trigger rebuild
src/**/*.go
outputs: # Build outputs
dist/binary
# Watch Mode
watch: **/*.go # Glob pattern to watch
ignore: vendor/** # Patterns to ignore
# Execution Environment
docker: true # Run in Docker
remote: user@host # Run via SSH
# Matrix Builds
matrix:
os: linux, darwin, windows
arch: amd64, arm64
๐ Language Templates
Go Project
var PROJECT = $(shell "basename $(pwd)")
var VERSION = $(shell "git describe --tags --always")
task build:
desc: Build Go binary
deps: fmt, vet
cache: true
inputs:
**/*.go
go.mod
outputs:
bin/${PROJECT}
run:
go build -ldflags="-X main.version=${VERSION}" -o bin/${PROJECT} .
task dev:
desc: Watch and run
watch: **/*.go
run:
go run .
task build-all:
desc: Cross-compile
matrix:
os: linux, darwin, windows
arch: amd64, arm64
run:
GOOS=${os} GOARCH=${arch} go build -o dist/${PROJECT}-${os}-${arch}
Node.js Project
task install:
desc: Install dependencies
cache: true
inputs:
package.json
package-lock.json
outputs:
node_modules
run:
npm ci
task build:
desc: Build for production
deps: install
cache: true
inputs:
src/**/*
outputs:
dist
run:
npm run build
task dev:
desc: Start dev server
deps: install
watch: src/**/*
run:
npm run dev
Python Project
task venv:
desc: Create virtual environment
cache: true
inputs:
requirements.txt
outputs:
.venv
run:
python -m venv .venv
.venv/bin/pip install -r requirements.txt
task dev:
desc: Run development server
deps: venv
watch: **/*.py
run:
.venv/bin/uvicorn main:app --reload
๐ง CLI Reference
flux [options] <task>
Options:
-t string Task to execute
-p string Profile to apply
-l List all tasks
-w Watch mode
--no-cache Disable caching
--report Show execution report
--graph Show dependency graph
--dry-run Simulate execution
--tui Interactive TUI mode
๐ Performance
| Component | Time | Allocations |
|---|---|---|
| Lexer | 7.6ยตs | 47 allocs/op |
| Parser | 10.3ยตs | 34 allocs/op |
| Graph Build | ~1ยตs | minimal |
| Executor | 1.1ยตs | 112 B/op |
๐ค Contributing
git clone https://github.com/ashavijit/fluxfile
cd fluxfile
make test
make build
๐ License
MIT License ยฉ ashavijit