View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page


Sails' generators allow you to completely customize what happens when you run sails new and sails generate from the command-line. Custom generators make it possible to standardize the way your team or organization creates new Sails apps, as well as new modules within existing apps. Custom generators can be used to do all sorts of cool things:

  • to standardize conventions and boilerplate logic for all new apps across your organization
  • to override the default Gruntfile with a set of custom tasks
  • to completely replace Grunt with Gulp or webpack
  • to use another view engine like Jade, Dust or Nunjucks by default (instead of EJS)
  • to automate custom deployments (e.g. white label apps with one server per-customer)
  • to generate files as Coffeescript or Typescript
  • to include ASCII pictures of cats at the top of every code file (or license headers, whatever)
  • to start off with all documentation and comments in a language other than English

If you are interested in making custom generators, the best place to start is by checking out the introduction to custom generators. You also might check out open-source generators from the community, in case something already out there will save you some time.

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.