Create Commandline in node.js for your Sails.js

First: Make sure your App is running on Localhost port:80

Seconds: Clone Tilda : Tilda

Thrid: Create acli.js file and inpust the following Code below


// Make sure that no matter where we call the command from,
// we lift the app that lives in the same directory as this script
process.chdir(__dirname);
// Get an instance of Sails
var sails = require('sails');
// Lift the Sails app in the current working directory
       console.log("Start The GITLIST App");
        console.log("To see your app. visit:");
        console.log(clc.xterm(39).bgBlack.underline('http://127..0.0.1'));
        console.log("To Clone the Repository and Open Source:");
        console.log(clc.xterm(39).bgBlack.underline('see: http://www.github.com/spaceg/github.io'));
        console.log("Bash The Universe by Lucas Gatsas.");
        console.log("©.2016 by Gitlist OS");

        console.log("press c to stop the app");


sails.lift({log:{noShip: true}});

/*  sails.lift(rc('sails'));*/

Here is a Robost Code for the Commandline and lift your with your own commandline: here are the links:

package.json: package.json

cli.js : cli.js

app.js : app.js

.gitgnore .gitignore

.local.js .local.js

create a .gitgnore file for your Branch. Set it to the Root of your Directory. but the Following code Below in that file. Save it.

*.swp
*.swo
*~
*.log
node_modules




config/local.js

After Include in your package.json the following code from the Tilda for the bin

 "bin": {
    "gitlist": "./cli.js"
  },

The full package.json file:


{
  "name": "gitlist",
  "version": "1.0.5",
  "description": "Gitlist OS",
  "keywords": [],
  "bin": {
    "gitlist": "./cli.js"
  },
  "dependencies": {
    "bcrypt": "~0.8.0",
    "commander": "^2.9.0",
    "ejs": "~0.8.4",
    "grunt": "0.4.2",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-coffee": "~0.10.1",
    "grunt-contrib-concat": "~0.3.0",
    "grunt-contrib-copy": "~0.5.0",
    "grunt-contrib-cssmin": "~0.9.0",
    "grunt-contrib-jst": "~0.6.0",
    "grunt-contrib-less": "0.11.1",
    "grunt-contrib-uglify": "~0.4.0",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-sails-linker": "~0.9.5",
    "grunt-sync": "~0.0.4",
    "include-all": "~0.1.3",
    "nodemailer": "~1.4.0",
    "passport": "~0.2.1",
    "passport-github": "^0.1.5",
    "passport-local": "~1.0.0",
    "passport-twitter": "~1.0.2",
    "password-generator": "^0.2.3",
    "progress": "^1.1.8",
    "rc": "~0.5.0",
    "sails": "~0.11.0-rc10",
    "sails-disk": "~0.10.0",
    "sails-hook-autoreload": "^0.11.4",
    "sails-mongo": "^0.12.0",
    "shortid": "~2.1.3",
    "tilda": "^4.2.1"
  },
  "scripts": {
    "start": "node app.js",
    "debug": "node debug app.js"
  },
  "main": "app.js",
  "repository": {
    "type": "git",
    "url": "git://github.com/SpaceG/gitlist.io.git"
  },
  "author": "lucasgatsas",
  "license": "BSD-2-Clause",
  "bugs": {
    "url": "https://github.com/SpaceG/gitlist.io/issues"
  },
  "homepage": "https://github.com/SpaceG/gitlist.io#readme"
}



#!/usr/bin/env node
// Make sure that no matter where we call the command from,
// we lift the app that lives in the same directory as this script
process.chdir(__dirname);

        console.log("HELLOOOOOOOOO");
        console.log("©.2016 by Gitlist OS");

        console.log("press c to stop the app");

// Get an instance of Sails
var sails = require('sails');
// Lift the Sails app in the current working directory
sails.lift({log:{noShip: true}});

Thats it.

See the Issue Detail here on Github package.json

package.json: package.json

cli.js : cli.js

app.js : app.js

.gitgnore .gitignore

.local.js .local.js

Tools:

Seconds: Clone Tilda : Tilda

"Create Commandline in node.js for sails.js"

“If you are going to walk on thin ice, you might as well dance”