beman.exemplar now has a new stamp.sh script, and instructions in the README for how to use it to create a new Beman library:
Previously, users needing to create a new Beman library properly would
need to follow the following set of (undocumented) instructions:
Go to the ‘exemplar’ repo, click ‘use this template,’ click ‘create a new repository’
create and checkout the new repository
cd cookiecutter
python3 -m pip install cookiecutter
cookiecutter .
Go through the prompts to populate the template
Copy the resulting directory somewhere outside of your repo
Blow away all the files in the repo (careful to include hidden files like .github while still including .git) and replace them with the contents of the directory that cookiecutter produced
The new stamp.sh script now automates all but the first two above
steps, and the new instructions in the README.md explain to users how
to use it.
I hope the switch to use copier will be merged soon:
from google AI:
Deep Dive into the Top 3 Differences
1. Smart Updating and Merging (The Killer Feature)
Cookiecutter: If you use a template to bootstrap 20 microservices, and you later find a security bug in your template’s CI pipeline, you have to manually copy-paste the fix into all 20 repositories. [1, 2]
Copier: It saves the answers to your initial questionnaire inside a hidden .copier-answers.yml file. If the original template is updated, you simply run copier update in your repository. Copier references your saved answers, fetches the new template version, and uses Git to automatically smart-merge the changes directly into your code. [1, 2]
2. Advanced Prompt Engineering
Copier’s prompt system is significantly more powerful. It allows for input type-casting (forcing integers or booleans), strict regex validations, conditional prompts (showing questions only if a previous answer matches), and detailed helper text descriptions for users answering the prompts. Cookiecutter prompts are simple, string-only key-value pairs. [1, 2, 3]
3. Post-Generation Lifecycle Tasks
While Cookiecutter can execute hooks (pre_gen_project.py or post_gen_project.py), Copier extends this capability by defining multi-stage tasks right inside your YAML configuration. It can trigger specific setup sequences not only when a project is first initialized but also precisely when it undergoes migrations or template upgrades.[1, 2, 3, 4]