A CLI tool to easily get a new project up and running by using pre-made templates. This is a more powerful version of an equivalent tool in Python, cookiecutter.
Currently, kickstart
is available only through crates.io:
bash
$ cargo install kickstart
{{ repo_name }}/{{author.md}}
is a valid path```bash
$ kickstart examples/super-basic $ kickstart examples/complex -o Hello
$ kickstart https://github.com/Keats/kickstart-sample -o sample ```
Creating a template is fairly simple: create files and then just add a template.toml
in the root folder. Here is a description of all the fields available in it:
```toml
name = "Django"
description = "A fully-featured Django template"
1
is usedkickstart_version = 1
url = "https://google.com"
authors = [
]
kewyords = [
]
ignore = [ "README.md", "CONTRIBUTING.md", ".travis.yml", "docs", ]
copywithoutrender = [ "*.html", ]
[[variables]] name = "project_name" default = "My Project" prompt = "What is the name of this project?"
[[variables]] name = "database" default = "postgres" prompt = "Which database do you want to use?" choices = ["postgres", "mysql", "sqlite"]
[[variables]] name = "pgversion" default = "10.4" prompt = "Which version of Postgres?" choices = [ "10.4", "10.3", "10.2", "10.1", "9.6", "9.5", "9.4", "9.3", ] onlyif = { name = "database", value = "postgres" }
[[variables]] name = "auth_method" default = "jwt" prompt = "How are users going to be authenticated?" choices = ["jwt", "sessions", "none"]
[[variables]] name = "sentry" default = true prompt = "Do you want to add Sentry integration?"
[[variables]] name = "spa" default = false prompt = "Is the frontend a SPA?"
[[variables]] name = "jsframework" default = "React" prompt = "Which JS framework do you want to setup?" choices = [ "React", "Angular", "Vue", "None", ] onlyif = { name = "spa", value = true }
[[variables]] name = "typescript" default = true prompt = "Do you want to use TypeScript?" only_if = { name = "spa", value = true }
```
A variable has the following required fields:
name
: the name of the variable in Tera contextdefault
: the default value for that question, kickstart
uses that to deduce the type of that value (only string, bool and integer are currently supported)prompt
: the text to display to the userAnd two more optional fields:
choices
: a list of potential values, kickstart
will make the user pick oneonly_if
: this question will only be asked if the variable name
has the value value
None for now.