bakefile command (short: bf) manages your bakefile.py:
init
Create a newbakefile.py:
add-inline
Add PEP 723 inline metadata to an existing bakefile:lint
Lintbakefile.py (or the entire project) with ruff format, ruff check, and ty. Disable any with --no-ruff-format, --no-ruff-check, or --no-ty:
uv-based commands (PEP 723 bakefile.py only)
Convenience wrappers arounduv commands with --script bakefile.py added. For PEP 723 bakefile.py files only. For normal Python projects, use your preferred dependency manager (pip, poetry, uv, etc.):
uv (e.g. bakefile sync --frozen, bakefile lock --no-build).
venv
Ensure a.venv exists in the repo root. For PEP 723 standalone bakefiles, symlinks .venv to the uv-managed environment. For standard Python projects (pyproject.toml), it just runs uv sync, so prefer uv directly there:
find-python
Print the Python path used bybake, bakefile env, bakefile export, bakefile run, and bakefile lint (the bakefile’s Python):
which
Diagnose which Python each command uses.bake, bakefile env, and bakefile export reinvoke under the bakefile’s Python (they re-run themselves and load the bakebook). bakefile run and bakefile lint spawn that Python directly to run your code (no self-reinvoke, no bakebook). All other subcommands use the invoked Python:
run
Run a script or module under the bakefile’s Python (likeuv run for the bakefile’s environment). If the first argument is an existing file, it runs as python script.py. Otherwise it runs as python -m module:
env
Print or inject bakebook variables. Given thisbakefile.py:
-- (printenv reads the injected value):
export
Export bakebook variables to shell, dotenv, JSON, or YAML. By default it exports every field, including bake’s internal settings, so use-i to focus on your own. Using the same bakefile.py as env above:
sh (default), dotenv, json, yaml. Secrets stay masked unless you pass -s. Write to a file with -o: