LinuxCommandLibrary

sails

Generate command-line interfaces from a specification

TLDR

Start Sails

$ sails lift
copy

Create new Sails project
$ sails new [projectName]
copy

Generate Sails API
$ sails generate [name]
copy

Generate Sails Controller
$ sails generate controller [name]
copy

Generate Sails Model
$ sails generate model [name]
copy

SYNOPSIS

sails command [options]

PARAMETERS

new
    Creates a new Sails application.

lift
    Starts the Sails server.

lower
    Stops the Sails server.

generate
    Generates code for models, controllers, policies, and other components.

console
    Opens a Sails console for interacting with the application.

www
    Publishes the application's public assets (used during deployment).

version
    Displays the installed Sails version.

help
    Displays help information for a specific command.

--prod
    Runs the Sails application in production mode.

--port port
    Specifies the port number to use for the server.

--verbose
    Enables verbose logging.

DESCRIPTION

Sails is a popular Node.js framework built on top of Express.js. The `sails` command provides a command-line interface (CLI) for creating, managing, and deploying Sails applications. It offers a variety of commands to streamline development, including generating new projects, scaffolding models and controllers, lifting the Sails server, and performing other common tasks. The `sails` CLI is designed to simplify the development workflow and promote best practices for building scalable and maintainable web applications and APIs with Node.js. Using the CLI allows developers to quickly bootstrap new projects, manage dependencies, and deploy applications to various environments. It abstracts away much of the underlying complexity, letting developers focus on building application logic. The `sails` command is an essential tool for any developer working with the Sails framework.

CAVEATS

Requires Node.js and npm to be installed. Sails must be installed globally or locally within the project for the `sails` command to work.

EXAMPLE USAGE

Create a new Sails app: sails new my-app
Lift the Sails server: sails lift
Generate a new controller: sails generate controller user

CONFIGURATION

Sails configuration files are located in the `config/` directory of your Sails project. These files control various aspects of your application, such as database connections, middleware, and routes.

HISTORY

The `sails` command is part of the Sails.js framework, which was first released in 2012. It was created to provide a structured approach to building Node.js applications, inspired by frameworks like Ruby on Rails and Django. The `sails` CLI has evolved significantly over time, with new commands and features added to simplify development and deployment.

SEE ALSO

node(1), npm(1)

Copied to clipboard