https://github.com/dhravya/cakecutter
Deprecated. Move to https://github.com/cake-cutter/cc
https://github.com/dhravya/cakecutter
cli devops rust template
Last synced: 5 months ago
JSON representation
Deprecated. Move to https://github.com/cake-cutter/cc
- Host: GitHub
- URL: https://github.com/dhravya/cakecutter
- Owner: Dhravya
- Created: 2022-03-08T20:31:25.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-13T04:52:41.000Z (over 3 years ago)
- Last Synced: 2025-05-07T11:16:11.201Z (5 months ago)
- Topics: cli, devops, rust, template
- Language: Rust
- Homepage: https://github.com/cake-cutter/cc
- Size: 51.8 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
Cakecutter
Create projects from pre-built cakes (templates)! Supports files, packages, content, running commands and more!***
Cakecutter is a utility tool that quickly sets up a project from a pre-built template.
All template files are in `.toml` format, which means they are easy to edit and share with others.
Here's a python project demo
Notice how it created the files and ran the VENV command to initialise the virtual environment, and started installing the dependencies
## 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### Installation
```
cargo install cakecutter
```### Usage
```
cakecutter [TEMPLATE_NAME]
```
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
```## Making your own Cakefile
It's really easy to make your own cakefile. There are 4 main sections:
```toml
[metadata][filestructure]
[content]
[commands]
```### Basic rules
Since TOML doesn't support `.` and `/` as keys, we use `-` and `--` instead.so instead of `main.py`, we use `main-py` and instead of `src/main.py` we use `src--main-py`
#### Metadata
Metadata is optional, but when you include it, make sure to include the following:
- `name`: The name of your cake
- `version`: Cake version
- `description`: What the cake is for
- `author`: The author of Cake#### File structure
The file structure is where you define the structure of your project.To include files in the current directory, put them in the `root` list
`root = [".gitignore", "Cargo.toml", "README.md", "LICENSE"]`For every other directory, use the following syntax:
`directory_name = [file1, file2]`
So for this repository, it looks something like
```toml
root = [".gitignore", "Cargo.toml", "README.md", "LICENSE"]
examples = ["Python.toml"]
```#### Content
Content is where you define the content of your files.
It's pretty simple, just write the name of file (following the basic rules) and the content of the files after it
```toml
[content]
src--main-py = """
print("Hello World")
"""
```
This will fill in the file `src/main.py` with the content of the string.#### Commands
These are the commands that run when a cake is made (Stuff like installing dependencies)All keys here should be numbers starting from one and increasing progressively.
Commands should be written as if written in a Dockerfile
Here's an examples:
```toml
[commands]
1 = ['python', '-m', 'venv', 'venv']
2 = ['pip', 'install', '-r', 'requirements.txt']
3 = ['python', 'src/main.py']
```### License
This project is licensed under the mit license
### Show your support
Leave a ⭐ if you like this project***
Readme made with 💖 using [README Generator by Dhravya Shah](https://github.com/Dhravya/readme-generator)