Skip to main content

The simplicity of just. The power of Bazel. bam is a build and workflow tool with smart caching, parallel execution, and a beautiful live UI.

Project description

bam

The simplicity of just. The power of Bazel.

bam is a build and workflow tool that stays out of your way. Drop a YAML file in your project, list your tasks, and bam handles the rest — parallel execution, smart caching, dependency graphs, and a beautiful live UI — without asking you to restructure anything.

It scales from a one-person side project to a multi-team monorepo, and feels native to every stack.

Quick Start

Installation

# Using uv (recommended)
uv pip install bam-tool

# Using pip
pip install bam-tool

Your First Workflow

Run bam --init in any project directory. bam detects your stack and writes a ready-to-run bam.yaml:

bam --init wizard

The generated config is plain YAML — inputs, outputs, caching, and dependencies all wired up. Here's what it produces for a Node.js project:

version: 1

tasks:
  install:
    command: npm ci
    inputs: [package.json, package-lock.json]
    outputs: [node_modules/]

  lint:
    command: npm run lint
    inputs: ["src/**/*"]
    depends_on: [install]

  test:
    command: npm test
    inputs: ["src/**/*", "tests/**/*"]
    depends_on: [lint]

  build:
    command: npm run build
    inputs: ["src/**/*"]
    outputs: [dist/]
    depends_on: [test]

Use bam --graph to visualise the dependency tree before running anything:

bam --graph

Then run the pipeline. Independent tasks execute in parallel automatically — bam shows live progress as a dependency tree:

parallel execution

Run it again. Nothing changed, so every task restores from cache instantly:

cache hit

For long-running processes like dev servers, mark the task interactive: true. bam restores all dependencies from cache first, then hands the terminal directly to your process:

interactive dev server

tasks:
  serve:
    command: npm run dev
    interactive: true
    depends_on: [build]

Features

Simple by design

  • Clean YAML config — no DSL to learn, no project restructuring required
  • bam <task> to run; flags for everything else
  • Shell tab completion for task names
  • Works with any language or toolchain

Powerful where it counts

  • Parallel execution out of the box — auto-detects CPU cores
  • Content-addressed caching: tasks only re-run when inputs actually change
  • Topological dependency resolution with cycle detection
  • Docker and inline Python runners for hermetic or scripted steps
  • Distributed cache to share hits across your whole team
  • CI pipeline generation for GitHub Actions and GitLab CI

Beautiful

  • Live dependency tree with per-task progress bars
  • Rich error context: shows the full dependency chain and which tasks were skipped
  • ASCII and DOT graph output for dependency visualisation
  • Plain-output mode for CI/CD

Use Cases

Python Project

version: 1

tasks:
  lint:
    command: ruff check src/
    inputs: ["src/**/*.py", "pyproject.toml"]

  typecheck:
    command: pyright
    inputs: ["src/**/*.py"]

  test:
    command: pytest
    inputs: ["src/**/*.py", "tests/**/*.py"]
    depends_on: [lint, typecheck]

  build:
    command: python -m build
    inputs: ["src/**/*.py", "pyproject.toml"]
    outputs: ["dist/"]
    depends_on: [test]

Multi-Stage Build

version: 1

tasks:
  generate:
    command: protoc --python_out=. schema.proto
    inputs: ["schema.proto"]
    outputs: ["schema_pb2.py"]

  build-backend:
    command: go build -o backend cmd/server/main.go
    inputs: ["cmd/**/*.go", "*.proto"]
    outputs: ["backend"]
    depends_on: [generate]

  build-frontend:
    command: npm run build
    inputs: ["src/**/*.ts"]
    outputs: ["dist/"]
    depends_on: [generate]

  package:
    command: docker build -t myapp .
    inputs: ["backend", "dist/", "Dockerfile"]
    depends_on: [build-backend, build-frontend]

CLI Reference

bam uses a flat command interface — tasks run as bam <task>, management operations are flags.

Running Tasks

bam build                  # Run a task (and all its dependencies)
bam build --jobs 8         # Use 8 parallel workers
bam build --jobs auto      # Auto-detect CPUs (default)
bam build --jobs 1         # Sequential
bam build --dry-run        # Show execution plan without running
bam build --no-cache       # Disable caching for this run
bam build --plain          # Plain output for CI/CD

Live dependency tree:

📦 Tasks
├── ✓ lint               ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
├── ✓ typecheck          ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
│   └── ✓ test           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
│       └── ✓ build      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%

✓ Successfully executed 4 task(s)

Error context:

✗ Task failed: test
  Dependency chain:
    ├─ lint
    ├─ typecheck
    └─ test

⊘ Skipped 1 task(s) due to failure:
  • build

Management Flags

bam --list              # List all configured tasks
bam --validate          # Validate config (YAML, deps, cycles)
bam --graph             # Show ASCII dependency graph
bam --graph-dot         # Output DOT format (pipe to Graphviz)
bam --clean             # Clean cache (prompts for confirmation)
bam --clean-force       # Clean cache without confirmation
bam --version           # Show version

CI Pipeline Generation

bam --ci                # Generate CI pipeline (writes file)
bam --ci-dry-run        # Preview CI YAML without writing
bam --ci-output FILE    # Write to custom path

Distributed Cache

Share cache across your team with a remote CAS server:

cache:
  local:
    enabled: true
    path: .bam/cache
  remote:
    enabled: true
    url: grpc://cas.example.com:50051
    token_file: ~/.bam/cas-token
    timeout: 30.0
    max_retries: 3

Local cache is checked first; remote is a transparent fallback. Gracefully degrades on network errors. See examples/remote-cache/ for a complete setup guide.

Development

git clone https://gitlab.com/cascascade/bam.git
cd bam
uv sync
uv run ruff check src tests     # Lint
uv run pyright                  # Type checking
uv run pytest                   # Tests
bam build                       # Full build via bam

Documentation

Contributing

Contributions welcome. Add tests for new functionality, follow PEP 8 and project code style, and run bam build before submitting.

License

MIT — see LICENSE.


Built with: Python 3.14+ · uv · Typer · Rich · NetworkX · Pydantic · Claude

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bam_tool-0.9.1.tar.gz (60.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bam_tool-0.9.1-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file bam_tool-0.9.1.tar.gz.

File metadata

  • Download URL: bam_tool-0.9.1.tar.gz
  • Upload date:
  • Size: 60.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bam_tool-0.9.1.tar.gz
Algorithm Hash digest
SHA256 26f476cb85a116c73da20b96401e21c6fc5b7df489427ec6ba263a41ec560ae6
MD5 9c6f72b85b3ec37ec8640a2b072b4209
BLAKE2b-256 ce0e9d830efd8e67b92726bc97e05a36d9c61c6f87759a42ba90ef3cd34e4a63

See more details on using hashes here.

File details

Details for the file bam_tool-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: bam_tool-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 39.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for bam_tool-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32daa824ca2c4c7479c6903bc1921ae24b6f340fa5ca622eaffb1e832faedd15
MD5 80d45d4627109e53b307a807cb57e5ad
BLAKE2b-256 f8dfcf3bb87fdd30ba274edd53e3e766d0516c3fbc02c99af470e4743e07d40b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page