An OOP task runner. Write tasks once, reuse everywhere. Like a Makefile, but reusable and in Python.
Documentation: bakefile.wisl.dev
- 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.
pip install bakefileOr via uv:
uv tool install bakefilefrom bake import Bakebook, command, console
class MyBakebook(Bakebook):
@command()
def build(self) -> None:
console.echo("Building...")
self.ctx.run("cargo build")
bakebook = MyBakebook()bake buildbake finds the nearest bakefile.py walking up from the current directory, so bake build works from any subfolder of the project. Commands always run in the bakefile.py's directory.
For commands you want everywhere (dotfiles, personal utilities), create a Global bakefile.py in ~/.config/bake/ with bakefile -g init, or symlink a dotfiles repo there. bake <command> falls back to it outside any project, and bake -g <command> uses it from anywhere. See Finding bakefile.py.
Generate a bakefile with bakefile init, or start from the simple example. Full walkthrough in the quickstart.
Full documentation lives at bakefile.wisl.dev:
- Why bakefile - comparison with Make, Just, Task, mise, and Invoke
- Concepts - Bakebook, commands, context, PEP 723
- Usage - finding bakefile.py and the Global bakefile.py, logging, settings
- CLI reference -
bakeandbakefile - bakelib - Spaces, environments, cache, secrets
- Examples and troubleshooting
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 # oxfmt, toml-sort, ruff format, ruff check, ty, deptry
bake lint --slow # adds the locked-pins guard (CI runs this)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.
Contributions are welcome. See CONTRIBUTING.md for development guidelines, including project structure, testing conventions, and the development workflow.
Wisaroot Lertthaweedech – wisl.dev
Licensed under the Apache License 2.0. See LICENSE for the full text.
The wordmark in docs/site/img/brand/ uses outlined paths from Shantell Sans, licensed under the SIL Open Font License 1.1.
