kickstart

A CLI tool to easily get a new project up and running by using pre-made templates. This is a slightly more powerful version of an equivalent tool in Python, cookiecutter.

Linux build status Windows build status Crates.io

kickstart.gif

Installation

Currently, kickstart is available only through crates.io:

bash $ cargo install kickstart

Run kickstart --help for a full listing of the available commands and their flags/options.

Features

Try it out

```bash

From the root of this repo

$ kickstart examples/super-basic $ kickstart examples/complex -o Hello

Anywhere

$ kickstart https://github.com/Keats/kickstart-sample -o sample ```

Creating your own template

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

Required, name of the template

name = "Django"

Optional, longer form description

description = "A fully-featured Django template"

Required, the version of the kickstart schema, currently only 1 is used

kickstart_version = 1

Optional, the URL of the template

url = "https://google.com"

Optional, a list of authors for this template

authors = [

]

Optional, a list of keywords for this template

kewyords = [

]

Optional, those files will NOT be copied over when generating the template

Use it to remove template-specific like its CI or its README/docs

ignore = [ "README.md", "CONTRIBUTING.md", ".travis.yml", "docs", ]

Optional, a list of patterns. All files matching one of the patterns will

be copied over without going through Tera.

Use it for files that contain syntax similar to Tera for example

copywithoutrender = [ "*.html", ]

Optional, a list of cleanup actions to do.

All paths listed will be deleted if the name has the value value after

the questions have been answered and the project generated.

cleanup = [ { name = "spa", value = true, paths = ["{{ projectname }}/templates/"]}, { name = "authmethod", value = "none", paths = ["{{ project_name }}/docs/auth.md"]}, ]

A list of variables, the schema is explained in detail below

[[variables]] name = "projectname" default = "my-project" prompt = "What is the name of this project?" validation = "^([a-zA-Z][a-zA-Z0-9-]+)$"

[[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:

And two more optional fields:

List of templates

Changelog

0.1.6 (2018-08-02)

0.1.5 (2018-07-31)

0.1.4 (2018-07-31)

0.1.3 (2018-07-31)

0.1.2 (2018-07-31)