Skip to main content

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:

  1. Partial apply on conflict — uses git apply --reject to apply all applicable hunks; only the unresolvable portions are saved as .rej files
  2. 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-date
  • 1 — outdated
  • 2 — error (e.g. .cruft.json not found)

rebake update

Apply the latest template changes to the project.

rebake update [PROJECT_DIR] [OPTIONS]

rebake will:

  1. Abort if there are uncommitted changes (commit or stash first)
  2. Detect new variables added to the template and prompt for their values
  3. Generate a diff between the old and new rendered templates
  4. Apply the diff with git apply --reject — applicable hunks are written immediately; unresolvable hunks are saved as .rej files for manual resolution
  5. Update .cruft.json with the new commit hash and any newly added variables

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

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

.cruft.json format

{
  "template": "https://github.com/owner/template",
  "commit": "abc123...",
  "checkout": "main",
  "context": {
    "cookiecutter": {
      "project_name": "my-project",
      "author": "Jane Doe"
    }
  },
  "skip": ["go.sum", "*.lock"]
}

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

rebake-0.0.4.tar.gz (38.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rebake-0.0.4-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file rebake-0.0.4.tar.gz.

File metadata

  • Download URL: rebake-0.0.4.tar.gz
  • Upload date:
  • Size: 38.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rebake-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e622d6e913a3e8612cbd63071643080e4b82d745990e0a3c616ad0b719f526f5
MD5 4fd813a40b91e52573ea4483b706af9c
BLAKE2b-256 128b02d6d5a25bbae5f8f1df720a171afd4a122fc50b1e18601296f5ff4cc62a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rebake-0.0.4.tar.gz:

Publisher: release.yml on kitagry/rebake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rebake-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: rebake-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rebake-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bbf8cd38de4cc98979ad4858145946fa98c53dc56892cc3853e1ee55691d6c75
MD5 d6f5edba165c369a401e9d0da4dfc3d6
BLAKE2b-256 b7679a0a5fe42982822a86f468ede59cb901ee2eff134ae190c930c6702ce587

See more details on using hashes here.

Provenance

The following attestation bundles were made for rebake-0.0.4-py3-none-any.whl:

Publisher: release.yml on kitagry/rebake

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page