Forrest logo
back to the sails tool

sails:tldr:503e0

sails: Generate Sails Model.
$ sails generate model ${name}
try on your machine

The command "sails generate model ${name}" is a terminal command used in the Sails framework to generate a new model file.

Here's an explanation of each part of the command:

  • "sails" is the command-line tool used to manage Sails applications.
  • "generate" is a sub-command of the "sails" tool used to generate various components of a Sails application, including models.
  • "model" is the component type we want to generate. In this case, it's used to generate a model file.
  • "${name}" is a placeholder that represents the name of the model you want to generate. You would replace this placeholder with the desired name of your model.

For example, if you want to generate a new model file with the name "User", you would run the command "sails generate model User". This command creates a new model file named "User.js" in the "api/models" directory of your Sails project, containing the boilerplate code for a Sails model.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the sails tool