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]

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

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.2.tar.gz (36.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.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rebake-0.0.2.tar.gz
Algorithm Hash digest
SHA256 72a14d4a1307bf4bc609ec69c228c8855d8e8d3d2eac9bdf726fb82ee5be909f
MD5 0fd6a745313e0d0c3f076a30db22e932
BLAKE2b-256 f3cf165f1db666da42751bdba501d2f0133617eeedf374a909ab19d3012863f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for rebake-0.0.2.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.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for rebake-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 33d00ff21e93da18bec5cdad7d3883926a71504bb5521201aba4d3506af7e321
MD5 2bf2fe8a8fd6b7389bc49f2287806bee
BLAKE2b-256 50eb994c1f8d60b322a66a9bf82b03e43d538f1529a6732bab8aa54719d3d0dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for rebake-0.0.2-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