AS
Project Case Study

Fluxfile

Modern task runner and build automation tool with a clean, minimal syntax.

FluxFile

CI Go Report Card License: MIT Go Version

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

FeatureFluxFileMakeTaskfilejustMage
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

PlatformArchitectureFile
Linuxx64flux-linux-amd64.tar.gz
LinuxARM64flux-linux-arm64.tar.gz
macOSIntelflux-darwin-amd64.tar.gz
macOSApple Siliconflux-darwin-arm64.tar.gz
Windowsx64flux-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 --graph to 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

ComponentTimeAllocations
Lexer7.6ยตs47 allocs/op
Parser10.3ยตs34 allocs/op
Graph Build~1ยตsminimal
Executor1.1ยตs112 B/op

๐Ÿค Contributing

git clone https://github.com/ashavijit/fluxfile
cd fluxfile
make test
make build

๐Ÿ“„ License

MIT License ยฉ ashavijit