CookieCutter Contexts

CookieCutter Contexts

cookiecutter is an awesome command line utility created by Audrey Greenfeld, that is used to create projects from templates, especially useful if you create multiple projects with essentially the same boilerplate.

It is easy to take one of the many available templates that already exist, fork it, modify it to suit your specific needs and get reproducible, fast spin up of new projects.

Having only been using cookiecutter for a short time I was working with a new template I had created, and as I tested it with dummy projects, and tweaked it I was getting very fed up with continually entering the input context each time.

I brought out my Google-fu and was led to this question on Stack Overflow which had a similar problem to me, and was asking whether there existed a command flag that could be used to insert default context in the template at creation time, as in cookiecutter --no-input --context my-context.json <cookiecutter-template>.

Continue reading