# bakefile > An OOP task runner. Write tasks once, reuse everywhere. Like a Makefile, but reusable and in Python. > ## Agent Instructions > bakefile is a Python task runner with two CLIs: bake runs tasks from bakefile.py, bakefile manages the project. It is not a service or platform. > Tasks are methods on Bakebook classes in bakefile.py, decorated with @command. Subprocesses run through self.ctx.run(). > Examples are backed by tests; copy them verbatim. - [Python task runner, Makefile alternative](https://bakefile.wisl.dev/index.md): An OOP task runner. Write tasks once, reuse everywhere. Like a Makefile, but reusable and in Python. - [Install bakefile](https://bakefile.wisl.dev/getting-started/installation.md): Install bakefile with pip or uv, pin exact versions with the locked extra, plus the optional bakelib helpers. - [Quickstart](https://bakefile.wisl.dev/getting-started/quickstart.md): Create a bakefile.py, define tasks as class methods, and run them with bake. - [Why bakefile vs Make, Just, Task, mise](https://bakefile.wisl.dev/getting-started/why-bakefile.md): bakefile vs Make, Just, Task, mise, and Invoke. Tasks as Python class methods, typed arguments, validated config, and reusable task libraries. - [Bakebook](https://bakefile.wisl.dev/concepts/bakebook.md): A Bakebook is the class that holds your tasks. Subclass it to share tasks, extend it with Pydantic settings, and decorate methods with @command. - [Reuse tasks across projects](https://bakefile.wisl.dev/concepts/sharing-tasks.md): Publish a Bakebook as a Python package. Every project installs it next to bakefile, imports it, inherits every task, and overrides what differs. - [Commands](https://bakefile.wisl.dev/concepts/commands.md): Tasks are Typer commands. Define them as class methods or standalone functions, with typed arguments that become CLI options. - [Context](https://bakefile.wisl.dev/concepts/context.md): ctx.run() executes CLI commands through subprocess. Control streaming, error handling, working directory, environment, timeout, and dry-run. - [PEP 723 Support](https://bakefile.wisl.dev/concepts/pep723.md): Declare your bakefile.py's dependencies inline with PEP 723 metadata, so a single file carries its own dependencies. - [Logging and Console Output](https://bakefile.wisl.dev/usage/logging.md): console is your task's output and always prints. Logs are diagnostics gated by verbosity, from -v to -vvv, with per-module levels and a JSON format. - [Settings](https://bakefile.wisl.dev/usage/settings.md): Bakebooks extend Pydantic BaseSettings, so configuration is typed class attributes with validation, env-var and .env loading, and export to shell, dotenv, JSON, or YAML. - [bake CLI](https://bakefile.wisl.dev/cli/bake.md): Run tasks from bakefile.py. Chain commands, dry-run, pick a custom bakefile or bakebook, and control logging. - [bakefile CLI](https://bakefile.wisl.dev/cli/bakefile.md): Manage bakefile.py. Init, add-inline, lint, uv-based sync and lock, venv, run, env, and export. - [Spaces](https://bakefile.wisl.dev/bakelib/spaces.md): bakelib Spaces are Bakebooks preconfigured for a project type. Use them as-is, or inherit and override. - [Environments](https://bakefile.wisl.dev/bakelib/environments.md): EnvBakebook and environment mixins give each environment (dev, staging, prod) its own typed bakebook, selected by the ENV variable. - [Refreshable Cache](https://bakefile.wisl.dev/bakelib/cache.md): RefreshableCacheRegistry caches fetched values and refreshes them at runtime when a service rejects the cached one. No Bakebook required. - [Secrets](https://bakefile.wisl.dev/bakelib/secrets.md): SecretUtils wires a RefreshableCacheRegistry into your bakebook and adds the bake secret commands for tracked keys. - [Simple](https://bakefile.wisl.dev/examples/simple.md): A minimal standalone bakefile with PEP 723 inline metadata. No project files, no venv to manage. - [Python Package](https://bakefile.wisl.dev/examples/python-package.md): A pyproject-based Python package managed with PythonSpace. Inherited tasks, one override, one custom task. - [Common errors and fixes](https://bakefile.wisl.dev/troubleshooting/index.md): Fixes for common bakefile errors - command not found, bakebook not found, wrong bakebook type, load failures, dependency import errors, wrong Python, dry-run, and completion. - [bake: command not found](https://bakefile.wisl.dev/troubleshooting/command-not-found.md): The bake command is not on your PATH. Install bakefile with uv or pip, and add uv's tool bin directory to PATH if the shell still cannot find bake. - [BakebookError: No 'bakebook' found](https://bakefile.wisl.dev/troubleshooting/bakebook-not-found.md): bake cannot find a bakebook variable. Name the variable bakebook, select one with -b, or point bake at the right directory with -C or file with -f. - [Bakebook must be a Bakebook, got Typer](https://bakefile.wisl.dev/troubleshooting/wrong-bakebook-type.md): The bakebook variable must be a Bakebook instance, not a typer.Typer() app or a dict. Tasks use Typer syntax, but the bakebook itself is a Bakebook. - [Directory not found and file name errors](https://bakefile.wisl.dev/troubleshooting/file-name-errors.md): bake -f takes a file name only, never a path. Use -C to change directory and -f for the name, or create bakefile.py with bakefile init if it does not exist yet. - [Failed to load bakebook after dependency sync](https://bakefile.wisl.dev/troubleshooting/import-errors.md): bakefile.py fails to import after uv sync. Clean the uv cache, check PEP 723 dependencies, sync all extras and groups, or compile-check the file for real bugs. - [ImportError at startup from a dependency](https://bakefile.wisl.dev/troubleshooting/dependency-import-error.md): bake or bakefile crashes with an ImportError before doing anything, usually after a dependency released a breaking change. Upgrade bakefile, or reinstall with the locked extra. - [Tasks use the wrong Python interpreter](https://bakefile.wisl.dev/troubleshooting/wrong-python.md): bake, bakefile env, and bakefile export reinvoke under the bakefile's Python. Check which interpreter each command uses with bakefile which and bakefile find-python. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.