Skip to content

Instantly share code, notes, and snippets.

@NetCZ
Last active November 19, 2015 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetCZ/856e69d7fd38c1847217 to your computer and use it in GitHub Desktop.
Save NetCZ/856e69d7fd38c1847217 to your computer and use it in GitHub Desktop.
Custom definition of NodeJS Sails (http://sailsjs.org/) framework command line interface. For usage see https://confluence.jetbrains.com/display/PhpStorm/Command+Line+Tools
<?xml version="1.0" encoding="UTF-8"?>
<framework xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemas/frameworkDescriptionVersion1.1.3.xsd" name="Custom_sails" invoke="node_modules/.bin/sails.cmd" alias="sails" enabled="true" version="2">
<command>
<name>new</name>
<params>appName</params>
<help><![CDATA[
Alias for <span style="background-color: #B9B9B9; color: #000;">&nbsp;sails generate new &lt;appName&gt;&nbsp;</span>
]]></help>
</command>
<command>
<name>generate new</name>
<params>appName</params>
<help><![CDATA[
Create a new Sails project in a folder called <strong>appName</strong>.<br /><br />
<strong>Options:</strong>
<ul>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--no-linker&nbsp;</span> Disable automatic asset linking in your view and static HTML files (the relevant grunt tasks will not be created)</li>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--no-frontend&nbsp;</span> Disable the generation of the assets folder and files. Views will be created with hardcopied linked resources off of sailsjs.org.</li>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--template=[template language]&nbsp;</span> Use a different template language than the default (e.g. jade). Requires that a views generator for that language (e.g. sails-generate-views-jade) be installed in your global node path (e.g. ~/node_modules/ works)</li>
</ul>
]]></help>
</command>
<command>
<name>generate api</name>
<params>foo</params>
<help><![CDATA[
Generate <strong>api/models/Foo.js</strong> and <strong>api/controllers/FooController.js</strong>.
]]></help>
</command>
<command>
<name>generate model</name>
<params>foo [attribute1:type1, attribute2:type2 ... ]</params>
<help><![CDATA[
Generate <strong>api/models/Foo.js</strong>, optionally include attributes with the specified types.
]]></help>
</command>
<command>
<name>generate controller</name>
<params>foo [action1, action2, ...]</params>
<help><![CDATA[
Generate <strong>api/controllers/FooController.js</strong>, optionally include actions with the specified names.
]]></help>
</command>
<command>
<name>adapter</name>
<params>foo</params>
<help><![CDATA[
Generate a <strong>api/adapters/foo</strong> folder containing the files necessary for building a new adapter.
]]></help>
</command>
<command>
<name>generator</name>
<params>foo</params>
<help><![CDATA[
Generate a <strong>foo</strong> folder containing the files necessary for building a new generator.
]]></help>
</command>
<command>
<name>console</name>
<help><![CDATA[
Quietly lift your sails app (i.e. with logging silenced), and enter the <a href="http://nodejs.org/api/repl.html">node REPL</a>. This means you can access and use all of your models, services, configuration, and much more. Useful for trying out Waterline queries, quickly managing your data, and checking out your project's runtime configuration.<br /><br />
Note that <span style="background-color: #B9B9B9; color: #000;">&nbsp;sails console&nbsp;</span> still lifts the server, so your routes will be accessible via HTTP and sockets (e.g. in a browser.)<br /><br />
See Sails <a href="http://sailsjs.org/documentation/reference/command-line-interface/sails-console">Command line interface - sails console</a> for more information.
]]></help>
</command>
<command>
<name>debug</name>
<help><![CDATA[
Attach the node debugger and lift the sails app; similar to running <span style="background-color: #B9B9B9; color: #000;">&nbsp;node --debug app.js&nbsp;</span>. Takes the same options as <span style="background-color: #B9B9B9; color: #000;">&nbsp;sails lift&nbsp;</span>. You can then use node-inspector to debug your app as it runs.
]]></help>
</command>
<command>
<name>lift</name>
<help><![CDATA[
Run the Sails app in the current dir (if <span style="background-color: #B9B9B9; color: #000;">&nbsp;node_modules/sails&nbsp;</span> exists, it will be used instead of the globally installed Sails).<br /><br />
<strong>Options:</strong>
<ul>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--dev&nbsp;</span> - in development environment (the default). In the development environment Sails use <em>grunt-watch</em> to keep a eye on your files in <span style="background-color: #B9B9B9; color: #000;">&nbsp;/assets&nbsp;</span>. If you change something (for example in one of our css-files) and reload your browser Sails will automatically show your changes. Also you views won't be cached so you can change your view-files without restarting Sails like the assets.</li>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--prod&nbsp;</span> - in production environment</li>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--port &lt;portNum&gt;&nbsp;</span> - on the port specified by <span style="background-color: #B9B9B9; color: #000;">&nbsp;portNum&nbsp;</span> instead of the default (1337)</li>
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--verbose&nbsp;</span> - with verbose logging enabled
<li><span style="background-color: #B9B9B9; color: #000;">&nbsp;--silly&nbsp;</span> - with insane logging enabled</li>
</ul>
]]></help>
</command>
<command>
<name>version</name>
<help><![CDATA[
Get the current globally installed Sails version.
]]></help>
</command>
<help><![CDATA[
Use <strong>help</strong> command or see Sails <a href="http://sailsjs.org/documentation/reference/command-line-interface">Command line interface</a> for detailed information.
]]></help>
</framework>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment