Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/generate/generate

A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.
https://github.com/generate/generate

boilerplate cli create files generate generator gulp init initialize make project project-template rails scaffold slush task-runner template webpack yeoman yo

Last synced: 2 months ago
JSON representation

A new command line tool and developer framework for scaffolding out GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.

Awesome Lists containing this project

README

        




Command line tool and developer framework for scaffolding out new GitHub projects. Generate offers the robustness and configurability of Yeoman, the expressiveness and simplicity of Slush, and more powerful flow control and composability than either.

# generate

[![NPM version](https://img.shields.io/npm/v/generate.svg?style=flat)](https://www.npmjs.com/package/generate) [![NPM monthly downloads](https://img.shields.io/npm/dm/generate.svg?style=flat)](https://npmjs.org/package/generate) [![Build Status](https://img.shields.io/travis/generate/generate.svg?style=flat)](https://travis-ci.org/generate/generate)

You might also be interested in [update](https://github.com/update/update).

## Table of contents

- [Why use Generate?](#why-use-generate)
- [Features](#features)
- [Developer toolkit](#developer-toolkit)
- [Command line usage](#command-line-usage)
* [Install Generate](#install-generate)
* [Install a generator](#install-a-generator)
* [Next steps](#next-steps)
- [Command line arguments](#command-line-arguments)
* [generator.js](#generatorjs)
- [Generators](#generators)
* [Discovering generators](#discovering-generators)
* [Discovering plugins](#discovering-plugins)
* [Authoring generators](#authoring-generators)
- [More information](#more-information)
- [About](#about)
* [Related projects](#related-projects)
* [Community](#community)
* [Contributing](#contributing)
* [Running tests](#running-tests)
* [Author](#author)
* [License](#license)

_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_

Why use Generate?

## Why use Generate?

> There are other project scaffolders out there, why should you spend your time learning to use Generate?

Generate offers the robustness, power and configurability of Yeoman, with the expressiveness and simplicity of [slush](http://slushjs.github.io) and [gulp](http://gulpjs.com). See the following links if you're interested in a more detailed comparison:

* [Comparison to Yeoman and Slush](docs/why-use-generate.md)
* [Generator framework comparison](docs/generator-framework-comparison.md)

Features

## Features

* **advanced flow control**: through the use of [generators](docs/generators.md) (not es2015 generators), sub-generators, and [tasks](docs/tasks.md)
* **render templates**: use templates to create new files, or replace existing files
* **any engine**: use any template engine to render templates, including [handlebars](http://www.handlebarsjs.com/), [lodash](https://lodash.com/), [swig](https://github.com/paularmstrong/swig) and [pug](https://pugjs.org), and anything supported by [consolidate](https://github.com/visionmedia/consolidate.js). This is useful for generating _templates from templates_.
* **data**: automatically gather data from the user's environment for rendering templates, to populate "hints" in user prompts or for rendering templates, etc.
* **prompts**: It's easy to create custom prompts and use the answers for: context for rendering templates, settings options, determining file names, directory structure, and anything else that requires user feedback.
* **macros**: create a completely custom generator from the command line using [macros](#macros).
* **front-matter**: use yaml front matter in templates to define settings or defaults on a file-by-file basis
* **smart plugins**: Update is built on [base](https://github.com/node-base/base), so any "smart" plugin from the Base ecosystem can be used
* **config store**: persist configuration settings, global defaults, project-specific defaults, answers to prompts, and so on.
* **streams**: full support for [gulp](http://gulpjs.com) and [assemble](https://github.com/assemble/assemble) plugins
* **vinyl**: files and templates are [vinyl](https://github.com/gulpjs/vinyl) files.
* much more!

Developer toolkit

## Developer toolkit

Generate is part of a suite of developer tools that share a common foundation. Any of these tools may be used standalone or together:

* [generate](https://github.com/generate/generate): (you are here) scaffold out new projects
* [assemble](https://github.com/assemble/assemble): build system for web projects
* [verb](https://github.com/verbose/verb): documentation system for code projects
* [update](https://github.com/update/update): automate updates of any kind in code projects

All of these applications are built on top of [base](https://github.com/node-base/base) and [templates](https://github.com/jonschlinkert/templates), which provides a number of benefits, including:

* **similar API/CLI** - Learn one, and you will know them all
* **common plugins** - create a plugin for one, it will be usable by the others
* **cross-compatible** - they can run one another (for example, assemble can run verb to generate markdown documentation, then use that to create an HTML website)

## Command line usage

Generate may be installed locally or globally. However, if you wish to run any globally installed generators, Generate's CLI must be [installed globally](#installing-generate) as well.

### Install Generate

Install generate globally using [npm](https://www.npmjs.com/):

```sh
$ npm install --global generate
```

This adds the `gen` command to your system path, allowing it to be run from anywhere.

### Install a generator

If you'd like to see how generators work, install `generate-example`:

```sh
$ npm install --global generate-example
```

Then run the `example` generator with the following command:

```sh
$ gen example
```

Visit the [generate-example](https://github.com/generate/generate-example) project for additional steps and guidance.

### Next steps

* Browse the [documentation](docs)
* Learn about [generators](docs/generators.md)
* Learn about the [built-in generators](docs/cli/built-in-generators.md)
* Learn about [authoring generators](docs/generators.md#creating-generators)
* Learn about [setting options](docs/options.md#template-specific-options) in templates

## Command line arguments

The syntax for running generators is:

```sh
$ gen generator:task
```

* `generator` one or more space-separated generator names
* `task` - (optional) one or more comma-separated task names

**Examples**

```sh
# run generate-project's "default" task
$ gen project
# run generate-project's "license" task
$ gen project:license
# run generate-project's "package" task
$ gen project:package
```

### generator.js

If a `generator.js` is in the current working directory, Generate's CLI will attempt to load it and execute any tasks you've specified at the command line.

**Examples**

## Generators

[generators](docs/generators.md) are plugins that can be run by command line or using Generate's API.

### Discovering generators

* Find generators to install by [searching npm](https://www.npmjs.com/browse/keyword/generategenerator) for packages with the keyword `generategenerator`
* Visit [Generate's GitHub org](https://github.com/generate) to see the generators maintained by the core team

### Discovering plugins

Plugins from any applications built on [base](https://github.com/node-base/base) should work with Generate (and can be used in your generator):

* [base](https://www.npmjs.com/browse/keyword/baseplugin): find base plugins on npm using the `baseplugin` keyword
* [assemble](https://www.npmjs.com/browse/keyword/assembleplugin): find assemble plugins on npm using the `assembleplugin` keyword
* [generate](https://www.npmjs.com/browse/keyword/generateplugin): find generate plugins on npm using the `generateplugin` keyword
* [templates](https://www.npmjs.com/browse/keyword/templatesplugin): find templates plugins on npm using the `templatesplugin` keyword
* [update](https://www.npmjs.com/browse/keyword/updateplugin): find update plugins on npm using the `updateplugin` keyword
* [verb](https://www.npmjs.com/browse/keyword/verbplugin): find verb plugins on npm using the `verbplugin` keyword

### Authoring generators

Visit the [documentation for generators](docs/generators.md) to learn how to use, author and publish generators.

## More information

* [Discover generators](https://github.com/generate) authored and maintained by the Generate core team
* [FAQ](docs/faq.md)
* [Documentation](docs)
* [API documentation](docs/api)

## About

### Related projects

* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality node.js applications, using plugins like building blocks")
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")

### Community

Are you using [Generate](https://github.com/generate/generate) in your project? Have you published a [generator](https://github.com/generate/generate/blob/master/docs/generators.md) and want to share your project with the world?

Here are some suggestions!

* If you get like Generate and want to tweet about it, please feel free to mention `@generatejs` or use the `#generatejs` hashtag
* Show your love by starring [Generate](https://github.com/generate/generate) and `generate`
* Get implementation help on [StackOverflow](http://stackoverflow.com/questions/tagged/generate) (please use the `generatejs` tag in questions)
* **Gitter** Discuss Generate with us on [Gitter](https://gitter.im/generate/generate)
* If you publish an generator, thank you! To make your project as discoverable as possible, please add the keyword `generategenerator` to package.json.

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards.

### Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)

### License

Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 02, 2017._