CLI Wrapper is command line wrapper you can install to use in your terminal. You can even use it in your apps.
In this instructure you will learn about how to use this package in your apps.
How to install CLI Wrapper? To install this package, use NPM.
$ npm i -g @blackiq/cli-wrapper
We use
-g
to install the package globally.
Ok, to run the wrapper, just enter this command in your terminal:
$ cli-wrapper
You are now running it in port 3000. If you want to use your own port, use --port
.
$ cli-wrapper --port 8000
All done!
If you want to develop the package, it is so simple. just follow steps below.
- Clone the project
- Install dependencies by running
$ npm install
- Start changing!
- Link package
- Test
Before you start: Remember the base or code are stored in
lib/wrapper.js
. You need to edit there.
To clone the project, you need to have git installed. Ok, now clone it same as command below.
$ git clone https://gitlab.com/BlackIQ/cli-wrapper
Next, install what package uses with npm i
or npm install
.
$ npm i
To change package or anything, your need a testing environment to use linked package. Just follow steps.
We asoume you are in lib
directory. Right. You can open a tmux or in another terminal to cd in test
directory.
In lib
directory enter link command:
$ npm link
So, in other terminal, or other tmux part, link your development package to your test
directory. If you are in the test
directory ok, if not, just say cd test
and enter the linking command:
$ npm link cli-wrapper
Linking step is done.
Your test app is linked. Change anything in package and test it in test
directory.