Inspired by degit
, cargo generate
, and yeoman fromgit
allows you to use git repositories as templates for new projects.
$ npm install -g fromgit
$ fromgit <git-url> <destination directory> [--silent] [--branch=...]
Use a .template
file in your project's root to define variables that fromgit
will prompt a user for. Files included in the templates
list will be processed as ejs templates with the user's input.
name: Boilerplate project
description: Description for this project
templates:
- my-template.md
variables:
- name: name
message: Enter the project name
initial: My Awesome Project!
- name: description
message: What's your project's description?
Example my-template.md
## <%- name %>
<%- description %>
fromgit
will look for environment variables that look like FROMGIT_[variable name]
to populate the initial values in the template. If you pass --silent
to fromgit
then you can automatically populate projects without interactive prompts.
MIT