From 9098e54ce859fee3d668c687a56e8618ba630a8c Mon Sep 17 00:00:00 2001 From: Chamindu Amarasinghe <41909955+cjprogamer@users.noreply.github.com> Date: Tue, 7 Jan 2020 21:37:11 +0530 Subject: [PATCH 1/4] Added github pages --- web/index.html | 118 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 web/index.html diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..353d1a1 --- /dev/null +++ b/web/index.html @@ -0,0 +1,118 @@ +

+nodecloud-cli

+
+nodecloud-cli is an unified command line interface for open cloud based on nodecloud. nodecloud-cli supports cloud providers like AWS, Azure, GCP and many more.
+

+🚀 Install

+
+Using npm
+
$ npm install -g nodecloud-cli
+
+
+Using yarn
+
$ yarn global add nodecloud-cli
+
+

+📣 Usage

+
+Initialize cli with selected cloud provider
+
$ nc --init
+
+
+Compute 💻
+
+Create virtual machine instance
+
$ nc --compute create --type aws --vm-name="aws-ec2"
+
+
+List all available virtual machine instance
+
$ nc --compute list --type aws
+
+
+Delete selected virtual machine instance
+
$ nc --compute delete --type aws --in-id="Instance_ID"
+
+
+Turn on virtual machine instance
+
$ nc --compute start --type aws --in-id="Instance_ID"
+
+
+Shut down virtual machine instance
+
$ nc --compute stop --type aws --in-id="Instance_ID"
+
+
+Reboot virtual machine instance
+
$ nc --compute reboot --type aws --in-id="Instance_ID"
+
+
+Network 📡
+
+Creating load balancer
+
$ nc --network create --type="aws" --service="lb" --name="myelb" --port="80"
+
+
+Deleting load balancer
+
$ nc --network delete --type="aws" --service="lb" --name="myelb"
+
+
+List load balancer
+
$ nc --network list --type="aws" --service="lb"
+
+
+Add tag to load balancer
+
$ nc --network tag --type="aws" --service="lb" --name="myelb" --key="Lv" --value="one"
+
+
+Remove tag from load balancer
+
$ nc --network detag --type="aws" --service="lb" --name="myelb" --key="Lv"
+
+
+Storage 💾
+
+Creating Storage bucket
+
$ nc --storage create --type aws  --st-name="aws-ec2"
+
+
+Deleting Storage bucket
+
$ nc --storage delete --type aws  --st-name="Instance_ID"
+
+
+List all Storage buckets
+
$ nc --storage list --type aws
+
+
+Upload to Storage bucket
+
$ nc --storage upload --type aws  --st-name="Instance_ID" --file="file_path"
+
+
+Identity Access Management 🔑
+
+Creating Group
+
$ nc --iam create --type aws  --gp-name="UserGroup01"
+
+
+Deleting Group
+
$ nc --iam delete --type aws  --gp-name="UserGroup01"
+
+
+Attach Resource
+
$ nc --iam attach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
+
+
+Detach Resource
+
$ nc --iam detach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
+
+

+💻 Development setup

+
$ git clone https://github.com/cloudlibz/nodecloud-cli
+$ cd nodecloud-cli
+$ yarn install
+
+

+✒️ Run unit tests

+
$ yarn test
+
+

+📜 License

+
+MIT
From 32e5cf111a2eff4d92bb48f3746dd761748272d6 Mon Sep 17 00:00:00 2001 From: Chamindu Amarasinghe <41909955+cjprogamer@users.noreply.github.com> Date: Wed, 8 Jan 2020 05:31:22 +0530 Subject: [PATCH 2/4] Delete index.html --- web/index.html | 118 ------------------------------------------------- 1 file changed, 118 deletions(-) delete mode 100644 web/index.html diff --git a/web/index.html b/web/index.html deleted file mode 100644 index 353d1a1..0000000 --- a/web/index.html +++ /dev/null @@ -1,118 +0,0 @@ -

-nodecloud-cli

-
-nodecloud-cli is an unified command line interface for open cloud based on nodecloud. nodecloud-cli supports cloud providers like AWS, Azure, GCP and many more.
-

-🚀 Install

-
-Using npm
-
$ npm install -g nodecloud-cli
-
-
-Using yarn
-
$ yarn global add nodecloud-cli
-
-

-📣 Usage

-
-Initialize cli with selected cloud provider
-
$ nc --init
-
-
-Compute 💻
-
-Create virtual machine instance
-
$ nc --compute create --type aws --vm-name="aws-ec2"
-
-
-List all available virtual machine instance
-
$ nc --compute list --type aws
-
-
-Delete selected virtual machine instance
-
$ nc --compute delete --type aws --in-id="Instance_ID"
-
-
-Turn on virtual machine instance
-
$ nc --compute start --type aws --in-id="Instance_ID"
-
-
-Shut down virtual machine instance
-
$ nc --compute stop --type aws --in-id="Instance_ID"
-
-
-Reboot virtual machine instance
-
$ nc --compute reboot --type aws --in-id="Instance_ID"
-
-
-Network 📡
-
-Creating load balancer
-
$ nc --network create --type="aws" --service="lb" --name="myelb" --port="80"
-
-
-Deleting load balancer
-
$ nc --network delete --type="aws" --service="lb" --name="myelb"
-
-
-List load balancer
-
$ nc --network list --type="aws" --service="lb"
-
-
-Add tag to load balancer
-
$ nc --network tag --type="aws" --service="lb" --name="myelb" --key="Lv" --value="one"
-
-
-Remove tag from load balancer
-
$ nc --network detag --type="aws" --service="lb" --name="myelb" --key="Lv"
-
-
-Storage 💾
-
-Creating Storage bucket
-
$ nc --storage create --type aws  --st-name="aws-ec2"
-
-
-Deleting Storage bucket
-
$ nc --storage delete --type aws  --st-name="Instance_ID"
-
-
-List all Storage buckets
-
$ nc --storage list --type aws
-
-
-Upload to Storage bucket
-
$ nc --storage upload --type aws  --st-name="Instance_ID" --file="file_path"
-
-
-Identity Access Management 🔑
-
-Creating Group
-
$ nc --iam create --type aws  --gp-name="UserGroup01"
-
-
-Deleting Group
-
$ nc --iam delete --type aws  --gp-name="UserGroup01"
-
-
-Attach Resource
-
$ nc --iam attach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
-
-
-Detach Resource
-
$ nc --iam detach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
-
-

-💻 Development setup

-
$ git clone https://github.com/cloudlibz/nodecloud-cli
-$ cd nodecloud-cli
-$ yarn install
-
-

-✒️ Run unit tests

-
$ yarn test
-
-

-📜 License

-
-MIT
From c9e739fc78a9a2d1081c286485e7f90f61b49d20 Mon Sep 17 00:00:00 2001 From: Chamindu Amarasinghe <41909955+cjprogamer@users.noreply.github.com> Date: Wed, 8 Jan 2020 05:32:35 +0530 Subject: [PATCH 3/4] Add github pages --- index.html | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..d0442d7 --- /dev/null +++ b/index.html @@ -0,0 +1,118 @@ +

+nodecloud-cli

+
+nodecloud-cli is an unified command line interface for open cloud based on nodecloud. nodecloud-cli supports cloud providers like AWS, Azure, GCP and many more.
+

+🚀 Install

+
+Using npm
+
$ npm install -g nodecloud-cli
+
+
+Using yarn
+
$ yarn global add nodecloud-cli
+
+

+📣 Usage

+
+Initialize cli with selected cloud provider
+
$ nc --init
+
+
+Compute 💻
+
+Create virtual machine instance
+
$ nc --compute create --type aws --vm-name="aws-ec2"
+
+
+List all available virtual machine instance
+
$ nc --compute list --type aws
+
+
+Delete selected virtual machine instance
+
$ nc --compute delete --type aws --in-id="Instance_ID"
+
+
+Turn on virtual machine instance
+
$ nc --compute start --type aws --in-id="Instance_ID"
+
+
+Shut down virtual machine instance
+
$ nc --compute stop --type aws --in-id="Instance_ID"
+
+
+Reboot virtual machine instance
+
$ nc --compute reboot --type aws --in-id="Instance_ID"
+
+
+Network 📡
+
+Creating load balancer
+
$ nc --network create --type="aws" --service="lb" --name="myelb" --port="80"
+
+
+Deleting load balancer
+
$ nc --network delete --type="aws" --service="lb" --name="myelb"
+
+
+List load balancer
+
$ nc --network list --type="aws" --service="lb"
+
+
+Add tag to load balancer
+
$ nc --network tag --type="aws" --service="lb" --name="myelb" --key="Lv" --value="one"
+
+
+Remove tag from load balancer
+
$ nc --network detag --type="aws" --service="lb" --name="myelb" --key="Lv"
+
+
+Storage 💾
+
+Creating Storage bucket
+
$ nc --storage create --type aws  --st-name="aws-ec2"
+
+
+Deleting Storage bucket
+
$ nc --storage delete --type aws  --st-name="Instance_ID"
+
+
+List all Storage buckets
+
$ nc --storage list --type aws
+
+
+Upload to Storage bucket
+
$ nc --storage upload --type aws  --st-name="Instance_ID" --file="file_path"
+
+
+Identity Access Management 🔑
+
+Creating Group
+
$ nc --iam create --type aws  --gp-name="UserGroup01"
+
+
+Deleting Group
+
$ nc --iam delete --type aws  --gp-name="UserGroup01"
+
+
+Attach Resource
+
$ nc --iam attach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
+
+
+Detach Resource
+
$ nc --iam detach --type aws  --gp-name`="UserGroup01"` --ar-name="resource01"
+
+

+💻 Development setup

+
$ git clone https://github.com/cloudlibz/nodecloud-cli
+$ cd nodecloud-cli
+$ yarn install
+
+

+✒️ Run unit tests

+
$ yarn test
+
+

+📜 License

+
+MIT
From 028ca89ee8fe38dfc1314cf3e94a27dc560bfcfe Mon Sep 17 00:00:00 2001 From: cjprogamer Date: Sun, 12 Jan 2020 21:36:33 -0800 Subject: [PATCH 4/4] Added emojis to outputs --- lib/config.js | 3 ++- lib/helper.js | 5 +++-- lib/init.js | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/config.js b/lib/config.js index 4fb1fcf..54d62af 100644 --- a/lib/config.js +++ b/lib/config.js @@ -2,11 +2,12 @@ const fs = require("fs"); const emoji = require("node-emoji"); const detectInstalled = require("detect-installed"); const { exec } = require("child_process"); +const emoji = require('node-emoji') function installDependencies(path, cb) { exec(`cd ${path} && npm install`, (error, stdout, stderr) => { if (error) { - console.log("error", error); + console.log("error ${emoji.get('interrobang')}", error); cb(error, null); } cb(null, true); diff --git a/lib/helper.js b/lib/helper.js index 4269c36..c643a37 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -3,6 +3,7 @@ const fs = require("fs"); const figlet = require("figlet"); const chalk = require("chalk"); const path = "./.nc.config.js"; +const emoji = require('node-emoji') /** * Display text as CLI logo @@ -37,9 +38,9 @@ let logofied = text => { */ let logger = (data, error) => { if (error) { - console.log(chalk.red(`${JSON.stringify(data, null, 2)}`)); + console.log(chalk.red(`${emoji.get('interrobang')} \n ${JSON.stringify(data, null, 2)}`)); } else { - console.log(chalk.green(`${JSON.stringify(data, null, 2)}`)); + console.log(chalk.green(`${emoji.get('white_check_mark')} ${JSON.stringify(data, null, 2)}`)); } }; diff --git a/lib/init.js b/lib/init.js index 39efc5a..d0789e3 100644 --- a/lib/init.js +++ b/lib/init.js @@ -3,7 +3,7 @@ const npm = require("npm-programmatic"); const inquirer = require("inquirer"); const { getRegion } = require("./regions"); const { checkPlugin, logofied } = require("./helper"); - +const emoji = require('node-emoji') const questions = []; class Init { @@ -191,9 +191,9 @@ class Init { } ]) .then(answers => { - console.log("provider", this._provider); + console.log("provider ${emoji.get('white_check_mark')}", this._provider); - console.log("regions", answers.regions); + console.log("regions ${emoji.get('white_check_mark')}", answers.regions); }) .catch(err => { this._spinner.fail(err);