Edit Page

Available generators

The Sails framework's built-in generators can be customized using command-line options and overridden by mounting custom generators in the .sailsrc file. Other generators that add completely new sub-commands to sails generate can be mounted in the same way.

Core generators

Certain generators are built in to Sails by default.

Commands that generate a new Sails app
sails new name
sails new name --fast
sails new name --caviar
sails new name --without=grunt
sails new name --without=lodash,async,grunt,blueprints,i18n
sails new name --no-frontend --without=sockets,lodash
sails new name --minimal
Generators for spitting out new files in an existing Sails app
sails generate model identity
sails generate action name
sails generate action view-name
sails generate action _some/path/_view-name
sails generate page name
sails generate helper name
sails generate helper view-name
sails generate script name
sails generate script get-name
sails generate controller name
sails generate api name
sails generate hook name
sails generate response name
Commands for generating plugins
sails generate generator name
sails generate adapter name
Commands for (re)generating client-side dependencies
sails generate sails.io.js
sails generate parasails
Utils for building your own 3rd party packages
sails generate etc

Since Sails v1.0, built-in generators are now bundled in Sails core, rather than in separate NPM packages. All generators can still be overridden the same way. For advice setting up overrides for core generators in your environment, click here.

Community generators

There are over 100 community-supported generators available on NPM:

  • sails-inverse-model
  • sails-generate-new-gulp
  • sails-generate-archive
  • sails-generate-scaffold
  • sails-generate-directive
  • sails-generate-bower
  • sails-generate-angular-gulp
  • sails-generate-ember-blueprints
  • And many more...

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 repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.

Sails logo
  • Home
  • Get started
  • Support
  • Documentation
  • Documentation

For a better experience on sailsjs.com, update your browser.

Sailsconf 2022 June 22 - 24: Learn more at the Sailsconf website

Tweet Follow @sailsjs

Documentation

Reference Concepts App structure | Upgrading Contribution guide | Tutorials More

Concepts

  • Actions and controllers
    • Generating actions and controllers
    • Routing to actions
  • Assets
    • Default tasks
    • Disabling Grunt
    • Task automation
  • Blueprints
    • Blueprint actions
    • Blueprint routes
  • Configuration
    • The local.js file
    • Using `.sailsrc` files
  • Deployment
    • FAQ
    • Hosting
    • Scaling
  • E-commerce
  • Extending Sails
    • Adapters
      • Available adapters
      • Custom adapters
    • Custom responses
      • Adding a custom response
    • Generators
      • Available generators
      • Custom generators
    • Hooks
      • Available hooks
      • Events
      • Hook specification
        • .configure
        • .defaults
        • .initialize()
        • .registerActions()
        • .routes
      • Installable hooks
      • Project hooks
      • Using hooks
  • File uploads
    • Uploading to GridFS
    • Uploading to S3
  • Globals
    • Disabling globals
  • Helpers
    • Example helper
  • Internationalization
    • Locales
    • Translating dynamic content
  • Logging
    • Custom log messages
  • Middleware
    • Conventional defaults
  • Models and ORM
    • Associations
      • Many-to-many
      • One way association
      • One-to-many
      • One-to-one
      • Reflexive associations
      • Through associations
    • Attributes
    • Errors
    • Lifecycle callbacks
    • Model settings
    • Models
    • Query language
    • Records
    • Standalone Waterline usage
    • Validations
  • Policies
    • Access Control and Permissions
  • Programmatic usage
    • Tips and tricks
  • Realtime
    • Multi-server environments
    • On the client
    • On the server
  • Routes
    • Custom routes
    • URL slugs
  • Security
    • Clickjacking
    • Content security policy
    • CORS
    • CSRF
    • DDOS
    • P3P
    • Socket hijacking
    • Strict Transport Security
    • XSS
  • Services
  • Sessions
  • Shell scripts
  • Testing
  • Views
    • Layouts
    • Locals
    • Partials
    • View engines

Built with Love

The Sails framework is built by a web & mobile shop in Austin, TX, with the help of our contributors. We created Sails in 2012 to assist us on Node.js projects. Naturally we open-sourced it. We hope it makes your life a little bit easier!

Sails:
  • What is Sails?
  • Community
  • News
  • For business
About:
  • Our company
  • Security
  • Legal
  • Logos/artwork
Help:
  • Get started
  • Documentation
  • Docs
  • Contribute
  • Take a class

© 2012-2021 The Sails Company. 
The Sails framework is free and open-source under the MIT License. 
Illustrations by Edamame.