This is a CLI utility to transform a project in a cookiecutter template by substituting the contents in files and file paths with cookiecutter placeholders.
The name and value of placeholders will depend on the CLI arguments passed to the script.
I've used this only for .NET projects, but other project types should also work with minor tweaking.
If you like this project, you learned something from it, or you are using it in your applications, please press the star button. Thanks!
I needed a way to transform projects written in different programming languages to cookiecutter templates in order to simplify project bootstrapping.
Those projects do not follow the cookiecutter template folder structure out of the box, so I needed a way to do it on the fly.
Prerequisites: poetry
Change directory into the project one and just execute poetry run cookify
with these command-line arguments:
- The folder containing the project to convert
- The first placeholder name
- The first placeholder value
- The second placeholder name
- The second placeholder value
Note: only two placeholders are supported for the time being.
Example:
poetry run cookify /work/_temp/WebApiTemplate solution_name WebApiTemplate sample_entity_name Customer
I use this to generate a cookiecutter template for my other project. Here's the result: WebApiTemplate.