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 likego) 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 ., preview with git -C <target> clean -nd, then run git -C <target> clean -fd. |
2 |
Precondition/config error (missing target, dirty tree, identity mismatch, existing receipt without --force, or unavailable atomic rename without --force). Nothing written. |
--dry-run exits 0 after printing the plan without touching the target (no receipt). It warns on a statically unsupported host; target-filesystem capability is probed only during real apply. Forced apply uses a guarded non-atomic fallback and warns about its destination-overwrite race.
Documentation
- Full docs: https://template-press.readthedocs.io/
- Design contract:
docs/design/0006-external-target-model.md - Agent runbooks:
press-target(drive a press) andrebrand-matrix(the R1/R2/R3 acceptance matrix)
Contributing
See AGENTS.md for the canonical toolchain and verification flow
(just setup → just check → commit) and
.github/CONTRIBUTING.md for the human contributor
guide.
License
MIT — see LICENSE.
Metadata
Release files for template_press 5.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| template_press-5.0.0.tar.gz | 266.0 kB | Without provenance | Details for template_press-5.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| template_press-5.0.0-py3-none-any.whl | Python 3 | none | any | Details for template_press-5.0.0-py3-none-any.whl |
Total release size: 548.0 kB
Release files / template_press-5.0.0.tar.gz
| Download URL | template_press-5.0.0.tar.gz |
|---|---|
| Size | 266.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce70f61d8b5a4b02ed487cfef45a31b9567c095955e4b2146432925da68d6d28
|
|
BLAKE2b-256 checksum How to use checksums |
44455bc30cb8eeea622aebcdac9e0043d0acb51c2c63f11d2c871a15c64d6ed0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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}
|
Release files / template_press-5.0.0-py3-none-any.whl
| Download URL | template_press-5.0.0-py3-none-any.whl |
|---|---|
| Size | 282.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f0b5871876b3a479e52f730bd8f6f7097c67d2df8a71f075d71126400afa9810
|
|
BLAKE2b-256 checksum How to use checksums |
f2576b77f80db9fd37c899370cfd3581506463df0b895128afd4e60c8da86fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","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}
|
Security for template_press 5.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.