Skip to content

Repository files navigation

tests release quality-gate-status security-rating vulnerabilities codecov ruff ty pypi status license downloads python

bakefile logo

bakefile

An OOP task runner. Write tasks once, reuse everywhere. Like a Makefile, but reusable and in Python.

Documentation: bakefile.wisl.dev

Why bakefile?

  • Reusable - Makefile and Justfile work well, but reusing tasks across projects is hard. bakefile makes tasks Python class methods, so you inherit and share them like any other code.
  • Python - Write Python instead of a DSL. Real language features, type checking with ruff and ty, and the rest of Python's tooling. ctx.run() still handles normal CLI commands through subprocess.
  • Language-agnostic - Tasks are Python, but the commands they run can target any language (Go, Rust, JS, etc.).

Tasks are class methods you inherit, override, and compose, so reusable task libraries (bakelib Spaces) just work. bakefile is new, built on modern typed Python (Typer + Pydantic). Production-proven: I run it daily at my company.

See how bakefile compares to Make, Just, Task, mise, and Invoke in Why bakefile.

Installation

pip install bakefile

Or via uv:

uv tool install bakefile

Quick Start

from bake import Bakebook, command, console


class MyBakebook(Bakebook):
    @command()
    def build(self) -> None:
        console.echo("Building...")
        self.ctx.run("cargo build")


bakebook = MyBakebook()
bake build

Generate a bakefile with bakefile init, or start from the simple example. Full walkthrough in the quickstart.

Documentation

Full documentation lives at bakefile.wisl.dev:

Development

git clone https://github.com/wislertt/bakefile.git
cd bakefile

uv tool install bakefile

bake setup-dev        # Setup development environment (macOS only)
bake assert-setup-dev # Verify the setup is correct

bake test             # Unit tests (fast)
bake test-integration # Integration tests (slow, real subprocess)
bake lint             # prettier, toml-sort, ruff format, ruff check, ty, deptry

bake setup-dev only supports macOS. On other platforms, run bake --dry-run setup-dev to see the commands and follow platform-specific alternatives.

The project uses uv for dependency management.

Contributing

Contributions are welcome. See CLAUDE.md for development guidelines, including project structure, testing conventions, and the development workflow.

Author

Wisaroot Lertthaweedech – wisl.dev

License

Licensed under the Apache License 2.0. See LICENSE for the full text.

The wordmark in docs/img/brand/ uses outlined paths from Shantell Sans, licensed under the SIL Open Font License 1.1.

About

An OOP task runner. Write tasks once, reuse everywhere. Like a Makefile, but reusable and in Python.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages