Skip to content
/ bab Public

Bab is a modern, dependency free task runner that simplifies development workflows. It replaces Makefiles and npm scripts with a universal solution that’s easy to use for small scripts but powerful enough to orchestrate hundreds of tasks, keeping your projects organized and maintainable.

License

Notifications You must be signed in to change notification settings

bab-sh/bab

Repository files navigation

Bab Logo

Bab

Clean commands for any project.

Go Version Release Status Discord

WebsiteDocumentationDiscord


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.

Quick Start

# macOS / Linux
curl -sSfL https://bab.sh/install.sh | sh

# Windows (PowerShell)
iwr -useb https://bab.sh/install.ps1 | iex

For 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

Support

  • 💬 Discord - Questions and discussions
  • 📚 Documentation - Comprehensive guides
  • 🐛 Issues - Bug reports and feature requests

Acknowledgments

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

About

Bab is a modern, dependency free task runner that simplifies development workflows. It replaces Makefiles and npm scripts with a universal solution that’s easy to use for small scripts but powerful enough to orchestrate hundreds of tasks, keeping your projects organized and maintainable.

Topics

Resources

License

Stars

Watchers

Forks