A spiritual successor to cruft for managing cookiecutter projects
Project description
rebake
A spiritual successor to cruft for managing cookiecutter projects.
rebake improves on cruft in two key areas:
- Partial apply on conflict — uses
git apply --rejectto apply all applicable hunks; only the unresolvable portions are saved as.rejfiles - New variable detection — prompts for variables added to the template since the project was last updated
Requirements
- Python 3.12+
- uv
- Git
Quick Start
uvx rebake check
uvx rebake update
No installation required. Uses uv.
Installation
To install permanently:
uv tool install rebake
Or add it to a project:
uv add rebake
Usage
rebake check
Check whether the project is up-to-date with its template.
rebake check [PROJECT_DIR]
Exit codes:
0— up-to-date1— outdated2— error (e.g..cruft.jsonnot found)
rebake update
Apply the latest template changes to the project.
rebake update [PROJECT_DIR] [OPTIONS]
rebake will:
- Abort if there are uncommitted changes (commit or stash first)
- Run
pre-updatehooks (if defined) — abort if any hook fails - Detect new variables added to the template and prompt for their values
- Generate a diff between the old and new rendered templates
- Apply the diff with
git apply --reject— applicable hunks are written immediately; unresolvable hunks are saved as.rejfiles for manual resolution - Update
rebake.yamlwith the new commit hash and any newly added variables - Run
post-updatehooks (if defined)
Options
| Option | Description |
|---|---|
--allow-untracked-files |
Allow update even if untracked files exist (no other changes) |
--quiet |
Disable interactive prompts; exit 1 if new variables are found without a supplied value |
--checkout, -c |
Branch, tag or commit to follow |
Hooks
Define shell commands to run before or after the update in rebake.yaml:
hooks:
pre-update:
- make lint # runs before the patch is applied; abort on failure
post-update:
- go generate ./... # runs after rebake.yaml is saved; abort on failure
- make fmt
Hooks run in the project directory with the following environment variables available:
| Variable | Value |
|---|---|
REBAKE_TEMPLATE |
Template repository URL |
REBAKE_OLD_COMMIT |
Commit hash before the update |
REBAKE_NEW_COMMIT |
Commit hash after the update |
REBAKE_PROJECT_DIR |
Absolute path to the project directory |
Non-interactive usage (e.g. from an LLM agent)
--quiet is designed for automated workflows where interactive prompts are not possible.
# Attempt update non-interactively; exit 1 if new variables need values
rebake update --quiet
When --quiet is used and new variables are found, rebake prints each variable name and its default value to stderr, then exits with code 1.
Migrating from cruft
rebake reads .cruft.json as-is. No migration needed — just replace cruft with rebake in your commands.
# before
cruft check
cruft update
# after
rebake check
rebake update
rebake.yaml format
template: https://github.com/owner/template
commit: abc123...
checkout: main # optional: branch/tag/commit to track
context:
cookiecutter:
project_name: my-project
author: Jane Doe
skip: # optional: file patterns to skip
- go.sum
- "*.lock"
hooks: # optional: shell commands to run on update
pre-update:
- make lint
post-update:
- make fmt
Development
git clone https://github.com/kitagry/rebake
cd rebake
uv sync
uv run pytest
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rebake-0.1.1.tar.gz.
File metadata
- Download URL: rebake-0.1.1.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62b9d4c2bdc4f424dc88b9a87c6b6e1c62534f771421769e8cc152056f36b695
|
|
| MD5 |
3bd98f80895b6c85fb4dd22c2cc738d1
|
|
| BLAKE2b-256 |
de9ee1745334738dade8340fcc619ed4739a84e1b31248bf6c50b1edbd1d6667
|
Provenance
The following attestation bundles were made for rebake-0.1.1.tar.gz:
Publisher:
release.yml on kitagry/rebake
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rebake-0.1.1.tar.gz -
Subject digest:
62b9d4c2bdc4f424dc88b9a87c6b6e1c62534f771421769e8cc152056f36b695 - Sigstore transparency entry: 1571423877
- Sigstore integration time:
-
Permalink:
kitagry/rebake@77eaa372af206a2d7cc4521993f59cc3c96d7412 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/kitagry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@77eaa372af206a2d7cc4521993f59cc3c96d7412 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rebake-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rebake-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af403b5530595c6483084982c5a3301ebef9b045f4b1c3fb7d3f125582f86a80
|
|
| MD5 |
6fdb87bdb1d6dac495b5ae9651be4ea0
|
|
| BLAKE2b-256 |
0a4602710b1e15254ec33244d604729406ea34f8372c6dbf6295e51803de1b9e
|
Provenance
The following attestation bundles were made for rebake-0.1.1-py3-none-any.whl:
Publisher:
release.yml on kitagry/rebake
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rebake-0.1.1-py3-none-any.whl -
Subject digest:
af403b5530595c6483084982c5a3301ebef9b045f4b1c3fb7d3f125582f86a80 - Sigstore transparency entry: 1571423895
- Sigstore integration time:
-
Permalink:
kitagry/rebake@77eaa372af206a2d7cc4521993f59cc3c96d7412 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/kitagry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@77eaa372af206a2d7cc4521993f59cc3c96d7412 -
Trigger Event:
push
-
Statement type: