Bab is a modern task runner that replaces the clunky syntax of Makefiles and the limitations of npm scripts with a universal, dependency-free solution that works across any language or project.
# macOS / Linux
curl -sSfL https://bab.sh/install.sh | sh
# Windows (PowerShell)
iwr -useb https://bab.sh/install.ps1 | iexFor more installation options, see the Installation Documentation.
Create a Babfile.yml in your project root:
vars:
app_name: myapp
version: "1.0.0"
build_dir: ./build
env:
APP_NAME: ${{ app_name }}
NODE_ENV: production
tasks:
setup:
desc: Install dependencies
run:
- cmd: npm install
lint:
desc: Run linter
run:
- cmd: npm run lint
test:unit:
desc: Run unit tests
deps: [setup]
run:
- cmd: npm test
test:all:
desc: Run all tests
run:
- task: test:unit
- log: All tests passed!
level: info
configure:
desc: Configure build options
run:
- prompt: environment
type: select
message: "Select environment:"
options: [dev, staging, prod]
default: dev
- log: Building for ${{ environment }}
build:
desc: Build ${{ app_name }} v${{ version }}
deps: [lint, test:unit]
vars:
output: ${{ build_dir }}/${{ app_name }}
run:
- log: Building ${{ app_name }}...
- cmd: npm run build
- cmd: cp -r dist ${{ output }}
platforms: [linux, darwin]
- cmd: xcopy dist ${{ output }} /E
platforms: [windows]
- log: Build complete!
level: info
deploy:
desc: Deploy to ${{ env.DEPLOY_ENV }}
deps: [build]
run:
- log: Deploying ${{ app_name }} to ${{ env.DEPLOY_ENV }}...
level: warn
- cmd: ./scripts/deploy.sh
env:
VERSION: ${{ version }}Run your tasks:
bab # Browse tasks interactively
bab --list # List all available tasks
bab build # Build the application- 💬 Discord - Questions and discussions
- 📚 Documentation - Comprehensive guides
- 🐛 Issues - Bug reports and feature requests
Bab stands on the shoulders of giants. Special thanks to:
- Task - The modern task runner that inspired Bab's approach
- Charm - For their beautiful terminal UI libraries that make Bab a joy to use
Built with ❤️ by AIO