Skip to main content

PyPI version Python versions CI codecov License: MIT Ruff uv Conventional Commits

template-press

Press a new identity onto an existing repository. template-press is a standalone command-line utility: you point it at a target repo, it discovers and validates that repo's current identity, rewrites every occurrence to a new identity, and — only after verifying that none of the old identity survives — writes a receipt. A wrong or partial run fails loudly instead of silently corrupting the target.

It is not a project template you fork; it is a tool you run against other repos, one at a time. The rebrand engine is pure standard library, so the installed package has zero runtime dependencies.

Install

uvx --from template-press press --help   # run without installing
# or
pip install template-press

Usage

# preview the plan (writes nothing)
press rebrand --target ../my-repo --config press-answers.toml --dry-run

# apply, verify, and write a receipt
press rebrand --target ../my-repo --config press-answers.toml

press-answers.toml describes the destination identity:

[answers]
package_name = "new_pkg"
repo_name    = "new-repo"
app_name     = "newcli"
author       = "Jane Dev"
email        = "jane@example.com"
owner        = "janedev"

Keep your filled-in press-answers.toml out of the target (it is transient operator input, not committed state). A repo may commit a press/press-answers.example.toml placeholder to advertise the field shape — copy it, fill it, and pass it via --config. It has the same [answers] fields shown above.

The target's current identity is read from a committed <target>/press/press-source.toml. On a first run, --dry-run prints a proposed source-config from discovery; review it and re-run with --accept-discovery to write and use it.

How it stays safe

  • Config-first identity, discovery as a guard. The committed source-config is authoritative; discovery cross-checks it against the target and refuses to run on a mismatch, so the press never rewrites the wrong repo.
  • Verify-then-mark. After rewriting, a no-leak scan confirms no source identity remains. Any leftover ⇒ exit 1 and no receipt — a partial rebrand is a loud failure, not a false success.
  • Boundary-safe replacement. Short tokens (press, an owner like go) match only at word boundaries, so ordinary prose (compress, ongoing) is never touched.

Exit codes

The exit code is the contract:

Code Meaning
0 Verified — rebrand complete, no source identity remains, receipt written.
1 Leaks found after applying. No receipt; restore with git -C <target> checkout . && git clean -fd.
2 Precondition/config error (missing target, dirty tree, identity mismatch, existing receipt without --force). Nothing written.

--dry-run exits 0 after printing the plan without touching the target (no receipt).

Documentation

Contributing

See AGENTS.md for the canonical toolchain and verification flow (just setupjust check → commit) and .github/CONTRIBUTING.md for the human contributor guide.

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

template_press-3.4.0.tar.gz (88.7 kB view details)

Uploaded Source

Built Distribution

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

template_press-3.4.0-py3-none-any.whl (101.7 kB view details)

Uploaded Python 3

File details

Details for the file template_press-3.4.0.tar.gz.

File metadata

  • Download URL: template_press-3.4.0.tar.gz
  • Upload date:
  • Size: 88.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for template_press-3.4.0.tar.gz
Algorithm Hash digest
SHA256 84167f53d2843dd8b77491a04f350f00d6c61f760b4bb75489aa4fd37c3480ec
MD5 2cfc3b1587a32777dfd6dac5810f6c91
BLAKE2b-256 ad57f7b87f9e942ce0d3adb3826839fdf0d5e384c8ba4a95815cf6583f1c4fb1

See more details on using hashes here.

File details

Details for the file template_press-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: template_press-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 101.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for template_press-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ec9e82b8bd6cc313698a4a794043442f945bfdd063274402a2a3fbde2512b61
MD5 04d14d548c1302031123842c7f1d6e53
BLAKE2b-256 98e4fd7423e2a672a4ecf098e08dc5da3e8795dcf5c670c6b4938b2dfdbbd9d6

See more details on using hashes here.

Release history Release notifications | RSS feed

4.0.1

2 files

4.0.0

2 files

3.6.0

2 files

3.5.0

2 files

This release

3.4.0 This release

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page