{"id":13566139,"url":"https://github.com/Keats/kickstart","last_synced_at":"2025-04-03T23:31:12.428Z","repository":{"id":43043275,"uuid":"121667694","full_name":"Keats/kickstart","owner":"Keats","description":"A scaffolding tool to get new projects up and running quickly","archived":false,"fork":false,"pushed_at":"2024-03-26T19:32:32.000Z","size":1004,"stargazers_count":362,"open_issues_count":18,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-14T10:28:36.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Keats.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-15T18:46:35.000Z","updated_at":"2024-10-11T01:10:18.000Z","dependencies_parsed_at":"2023-02-09T15:16:35.353Z","dependency_job_id":"4d85558d-2b9b-47be-8980-7bbc64b24c94","html_url":"https://github.com/Keats/kickstart","commit_stats":{"total_commits":95,"total_committers":10,"mean_commits":9.5,"dds":0.6842105263157895,"last_synced_commit":"df2d817a8a3044071b3c1ce16dcbafe02ff0fc03"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keats%2Fkickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keats%2Fkickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keats%2Fkickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keats%2Fkickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keats","download_url":"https://codeload.github.com/Keats/kickstart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097713,"owners_count":20883124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:03.002Z","updated_at":"2025-04-03T23:31:12.422Z","avatar_url":"https://github.com/Keats.png","language":"Rust","readme":"# kickstart\n\nA CLI tool to easily get a new project up and running by using pre-made templates.\nThis is a slightly more powerful version of an equivalent tool in Python, [cookiecutter](https://github.com/cookiecutter/cookiecutter). It is an alternative to NodeJS projects such as [Yeoman](https://yeoman.io/) or [Slush](https://github.com/slushjs/slush).\n\n[![Crates.io](https://img.shields.io/crates/v/kickstart.svg)](https://crates.io/crates/kickstart)\n\n![kickstart.gif](./kickstart.gif)\n\n## Installation\n\n`kickstart` is available through crates.io:\n\n```bash\n$ cargo install kickstart --features=cli\n```\n\nOr as a pre-built binary [on the Releases page](https://github.com/Keats/kickstart/releases).\n\nRun `kickstart --help` for a full listing of the available commands and their flags/options.\n\n## Features\n\n- Cross-platform: Windows, Mac and Linux supported\n- Single binary: no need to install a virtualenv or anything else\n- Simple to use\n- Directory names and filenames can be templated: `{{ repo_name }}/{{author}}.md` is a valid path\n- All templating done through [Tera][] - a template engine inspired by Jinja2\n- Choose your own adventure: it supports conditional questions based on previous answers\n- It can load templates from a local directory or from a Git repository\n- It has conditional cleanup to not let irrelevant files in the output directory after generation\n- Templates can be made for any kind of projects/languages\n- Case conversion filters, e.g. `camelCase` to `CamelCase`\n- Pre-gen and post-gen hooks that can execute templated scripts\n\nSince Windows does not allow `|` in file paths, you may use a [tera built-in filter][builtin]\nby using the `$$` separator instead.\n\nNote that, in file templates, you should keep using `|` for filtering, as the `$$` syntax is only for files and directories. \nKeep in mind the characters `()` are not allowed on Windows so do not use filter parameters if you want to be cross-platform.\n\n[tera]: https://keats.github.io/tera/docs/\n[builtin]: https://keats.github.io/tera/docs/#built-in-filters\n\n## Try it out\n\n```bash\n# From the root of this repo\n$ kickstart examples/super-basic\n$ kickstart examples/complex -o Hello\n# Anywhere\n$ kickstart https://github.com/Keats/kickstart -s examples/super-basic\n$ kickstart https://github.com/Keats/kickstart-sample -o sample\n```\n\n## Creating your own template\nCreating 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:\n\n```toml\n# Required, name of the template\nname = \"Django\"\n\n# Optional, longer form description\ndescription = \"A fully-featured Django template\"\n\n# Required, the version of the kickstart schema, currently only `1` is used\nkickstart_version = 1\n\n# Optional, the URL of the template\nurl = \"https://google.com\"\n\n# Optional, a list of authors for this template\nauthors = [\n\n]\n\n# Whether to follow the symlinks when going through the files in the template\nfollow_symlinks = false\n\n# Optional, a list of keywords for this template\nkeywords = [\n\n]\n\n# Optional, those files will NOT be copied over when generating the template\n# Use it to remove template-specific like its CI or its README/docs\nignore = [\n    \"README.md\",\n    \"CONTRIBUTING.md\",\n    \".travis.yml\",\n    \"docs\",\n]\n\n# If this is set, kickstart will use this directory as a base for the template instead of\n# the root directory. This is useful when your template has its own documentation/CI/etc and you don't want\n# to ignore it.\ndirectory = \"some-directory\"\n\n# Optional, a list of patterns. All files matching one of the patterns will\n# be copied over without going through Tera.\n# If you want to match a specific file in the template, you can refer to it directly with its template relative path\n# Use it for files that contain syntax similar to Tera for example.\n# The patterns themselves can be templated.\ncopy_without_render = [\n    \"*.html\",\n    \"{{project_name}}/something.html\",\n]\n\n# Optional, a list of cleanup actions to do.\n# All paths listed will be deleted if the `name` has the value `value` after\n# the questions have been answered and the project generated.\ncleanup = [\n    { name = \"spa\", value = true, paths = [\"{{ project_name }}/templates/\"]},\n    { name = \"auth_method\", value = \"none\", paths = [\"{{ project_name }}/docs/auth.md\"]},\n]\n\n# A list of hooks we can run at various stages of the template.\n# This will execute the given files in the given order and they will be templated with access to all the variables.\n# Hooks can also be run conditionally depending on a variable value.\n# If a hook is meant to fail, make sure to exit with a non 0 error code.\n# The files need to be executable, no restrictions otherwise. It can be python, bash, bat etc.\n# Hooks are automatically ignored, no need to add them to the ignore array\n\n# pre-gen hooks are run after all the questions have been answered. This can be used for example to do more complex\n# validations\npre_gen_hooks = [\n    { name = \"validate\", path = \"validate_vars.py\" },\n]\n\n# post-gen hooks are run after the generation is done. This can be used for additional cleanup or running other things\n# like `git init`, install git hooks, downloading dependencies etc\npost_gen_hooks = [\n    { name = \"finish setup\", path = \"finish_setup.sh\" },\n    { name = \"install frontend dependencies\", path = \"install_spa_deps.sh\", only_if = { name = \"spa\", value = true} },\n]\n\n# A list of variables, the schema is explained in detail below\n[[variables]]\nname = \"project_name\"\ndefault = \"my-project\"\nprompt = \"What is the name of this project?\"\nvalidation = \"^([a-zA-Z][a-zA-Z0-9_-]+)$\"\n\n[[variables]]\nname = \"database\"\ndefault = \"postgres\"\nprompt = \"Which database do you want to use?\"\nchoices = [\"postgres\", \"mysql\", \"sqlite\"]\n\n[[variables]]\nname = \"pg_version\"\ndefault = \"10.4\"\nprompt = \"Which version of Postgres?\"\nchoices =  [\n    \"10.4\",\n    \"10.3\",\n    \"10.2\",\n    \"10.1\",\n    \"9.6\",\n    \"9.5\",\n    \"9.4\",\n    \"9.3\",\n]\nonly_if = { name = \"database\", value = \"postgres\" }\n\n[[variables]]\nname = \"auth_method\"\ndefault = \"jwt\"\nprompt = \"How are users going to be authenticated?\"\nchoices = [\"jwt\", \"sessions\", \"none\"]\n\n[[variables]]\nname = \"sentry\"\ndefault = true\nprompt = \"Do you want to add Sentry integration?\"\n\n[[variables]]\nname = \"spa\"\ndefault = false\nprompt = \"Is the frontend a SPA?\"\n\n[[variables]]\nname = \"js_framework\"\ndefault = \"React\"\nprompt = \"Which JS framework do you want to setup?\"\nchoices =  [\n    \"React\",\n    \"Angular\",\n    \"Vue\",\n    \"None\",\n]\nonly_if = { name = \"spa\", value = true }\n\n[[variables]]\nname = \"typescript\"\ndefault = true\nprompt = \"Do you want to use TypeScript?\"\nonly_if = { name = \"spa\", value = true }\n\n```\n\nA variable has the following required fields:\n\n- `name`: the name of the variable in Tera context\n- `default`: the default value for that question, `kickstart` uses that to deduce the type of that value (only string, bool and integer are currently supported). \nYou can use previous variables in the default, eg `\"{{ project_name | lower }}\"` will replace `project_name` with the value of the variable.\n- `prompt`: the text to display to the user\n\nAnd three more optional fields:\n\n- `choices`: a list of potential values, `kickstart` will make the user pick one\n- `only_if`: this question will only be asked if the variable `name` has the value `value`\n- `validation`: a Regex pattern to check when getting a string value\n\n## List of templates\n\n- [Rust CLI application](https://github.com/Keats/rust-cli-template)\n\n## Case Conversion Filters\nCase conversion filters are provided (_via [heck](https://github.com/withoutboats/heck)_):\n- `upper_camel_case`: UpperCamelCase\n- `camel_case`: lowerCamelCase\n- `snake_case`: snake_case\n- `kebab_case`: kebab-case\n- `shouty_snake_case`: SHOUTY_SNAKE_CASE\n- `title_case`: Title Case\n- `shouty_kebab_case`: SHOUTY-KEBAB-CASE\n\nYou can use these like any other filter, e.g. `{{variable_name | camel_case}}`.\n\n## Changelog\n\n### 0.5.0 (2024-12-13)\n\n- The `sub-dir` parameter has been renamed to `directory` in the CLI\n- Templates with a `directory` field will now no longer include that directory name in the output\n- `copy_without_render` elements are now templated and refer to the template relative path if specified\n- Avoid path traversals in cleanup\n- Add pre-gen and post-gen hooks\n- Force `output-dir` to be selected in the CLI to avoid surprises\n- Add support for following symlinks\n\n### 0.4.0 (2023-08-02)\n\n- Add case conversion filter\n- Update dependencies\n\n### 0.3.0 (2021-07-10)\n\n- Update dependencies\n\n### 0.2.1 (2020-02-07)\n\n- Allow using `$$` for filters in filenames/directories\n\n### 0.2.0 (2020-01-09)\n\n- Update all dependencies\n- Add the `directory` field to change the template directory away from the current one\n- VCS files are not automatically ignored anymore\n\n### 0.1.8 (2018-09-30)\n\n- Allow loading templates from a subdirectory\n\n### 0.1.7 (2018-08-09)\n\n- Work with Git aliases\n- The crate now works as a library as well as a binary\n\n### 0.1.6 (2018-08-02)\n\n- Add a `--no-input` flag to the main command to generate a template from defaults\n- Validate that a template only uses allowed TOML types (String, integer and boolean) in `validate` command\n- Better question UI\n\n### 0.1.5 (2018-07-31)\n\n- Fix git clone command\n\n### 0.1.4 (2018-07-31)\n\n- Fix missing error display impl\n- Fix TOML error not showing up\n- Fix multi-layered questions being asked when they shouldn't\n\n### 0.1.3 (2018-07-31)\n\n- Add pattern to match in the question when there is on\n\n### 0.1.2 (2018-07-31)\n\n- Add optional `validation` field to validate a string against a regex\n- Add colours and boldness to CLI\n- Use `git` command rather than git2 crate to avoid some build issues\n- Add `cleanup` field to template definition for post-generation cleanup\n- Add `validate` command to diagnose errors in a `template.toml` file\n","funding_links":[],"categories":["Rust","others","Projects using Tera","\u003ca name=\"programming-boilerplate\"\u003e\u003c/a\u003eProgram templates and boilerplate","Other"],"sub_categories":["Editor Support"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeats%2Fkickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKeats%2Fkickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeats%2Fkickstart/lists"}