Introducing Cakecutter🍰- Start projects quickly from Cakes (templates)

Dhravya - Mar 9 '22 - - Dev Community

After I posted the create-python-app blog, a member of the dev community (@abhinav1217) suggested me to modularize it - so that people can write all sorts of templates and can do all sorts of stuff with it.

This was an amazing idea for me. I started thinking about the implementation right away. Here's what I came up with - Cakecutter.

Cakecutter is a utility tool that helps you to create new projects quickly from pre-built cakes - The cakes can be as insane as your imagination, with multiple files, boilerplate code, command runs, etc. (More to be added soon, but I'm not sure what I should add)

All Cakefiles (The file that act as templates) are easily shareable and can be made by beginners because of the easy syntax of TOML (tom's obvious, minimal language).

According to the Cakefile, the rust script automatically generates the project for you, almost instantly, and runs any commands in a chronological order. Here's a Demo:
Demo

(Notice how it initialised venv and ran requirements.txt)

Cakefiles are incredibly easy to configure, here's a simple file that generates a python project (same as create-python-project)

[filestructure]
root = ['.gitignore', '.env', 'requirements.txt', 'README.md', 'LICENSE']
src = ['main.py']

[content]
src--main-py = """
print("Hello World")
"""

-gitignore = """
target/
.env
venv/
"""

requirements-txt = """requests"""

[commands]
1 = ['python', '-m', 'venv', 'venv']
3 = ['python', 'src/main.py']
Enter fullscreen mode Exit fullscreen mode

So you can write multiple cakefiles for yourself (according to your needs, for different languages) and run them every time you start a project. Add a Cake.toml file in your github repository to encourage others to use the cakefile and the project as a template!

Features

  • Create projects from pre-built cakes (templates) and make your own!
  • Supports all languages (Python, Js, Rust, Go, you name it.)
  • Cross-platform
  • Super fast ⚡
  • Get Cakes from github or use local Cakefiles

Usage

cakecutter [TEMPLATE_NAME]
Enter fullscreen mode Exit fullscreen mode

You can also use cakes from github (Provided they have a Cake.toml file in the root directory of the repository):

cakecutter https://github.com/dhravya/cakecutter
Enter fullscreen mode Exit fullscreen mode

I'll add example templates (For python, js, etc. ) soon. Feel free to comment your thoughts below!

  • What more can I add?
  • What should python, js, rust, etc. templates have?
  • Would you use it in your everyday lives?

The project is super duper light ,a little more than 40 kbs so don't worry about that either

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .