A Copier template for ONE Campaign Python projects, plus a CLI for working with it.
This repo holds two things:
bblocks-projects/— thebblocks-projectsCLI (create,update,add,doctor).template/— the Copier template the CLI renders.
If you just want to use the CLI to scaffold or maintain a project, jump to the package README. The rest of this file is for people working on the template or the CLI itself.
bblocks-projects/
├── bblocks-projects/ # CLI tool (published to PyPI)
│ ├── src/bblocks/projects/
│ ├── tests/
│ └── pyproject.toml
├── template/ # Copier template files
│ ├── copier.yml # questions and post-generation tasks
│ ├── {% if ... %}/ # conditional directories per project type
│ └── ... # files rendered into generated projects
├── docs/ # MkDocs site source (rendered at the repo root)
├── mkdocs.yml
└── README.md # this file
# Create a new project (no install needed)
uvx bblocks-projects create my-project
# Update an existing one
cd my-project && uvx bblocks-projects update
# Add a single component to any Python project
uvx bblocks-projects add pre-commit ruff ci
# Health-check a managed project
uvx bblocks-projects doctorFull usage and flag reference: docs/.
The CLI is a wrapper around Copier. If you'd rather drive Copier yourself:
uv tool install copier
copier copy gh:ONEcampaign/bblocks-projects my-project # create
cd my-project && copier update # updateThe CLI adds the GitHub-profile prefill, the add component flow, and doctor on top of plain Copier.
# CLI tests, lint, type-check
cd bblocks-projects
uv sync
uv run pytest
uv run ruff check .
uv run ty check src/bblocks/projects
# Docs site (run from the repo root)
uv run --project bblocks-projects mkdocs serveWhen changing the template:
- Edit files under
template/. - Render into a scratch directory:
copier copy . /tmp/test-project. - Verify the generated project's CI checks pass.
- Test both
packageandprojecttypes (and that the legacyresearchanswer still resolves toproject).
.copier-answers.yml must be present in the generated project for update to work — verify it's there before merging template changes.