elvanja / tenon-cli

Command Line Interface to Tenon API (https://tenon.io)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Code Climate

NPM

Tenon CLI

This CLI was made to interact with the Tenon.io API. It utilizes Node and Commander,js to create a UNIX-style CLI.

Installation

Tenon CLI requires Node.js v4+ to run.

Install the dependencies and devDependencies and start the server.

$ npm install tenon-cli -g
$ tenon --key=XXXXXXXX --config=config.json https://example.com

Development

To develop this CLI further, modify the following files:

tenon.js - This is where the Tenon API is called and where the options included in these calls and used to manage the return data exists.

index.js - This is where the actual CommanderJS parser and all of the CLI specific data exists.

NOTE: ANY CHANGES MADE TO OPTIONS IN index.js MUST BE REFLECTED IN testIndex.js BECAUSE THEIR ENVIRONMENTS ARE SLIGHTLY DIFFERENT BUT THE TEST FILE MUST ACCURATELY MOCK THE PRODUCTION INDEX FILE IN ORDER FOR TESTING TO BE EFFECTIVE.

Then run

$ npm run compile

Then when you are ready to run it as a full blown CLI, run this from the root directory of the project:

$ npm install -g

(optional) Third:

$ karma start

Testing

Tests automatically utilize babel and ES6 standards, to run tests just enter (from the project root directory):

$ npm run test

This will run the tests using mocha.

To write new tests, just put them in the test/ folder and they will automatically be tested with the above command. Each test that utilizes/mocks the CLI arguments and their conversion to options must import/require testIndex.js.

About

Command Line Interface to Tenon API (https://tenon.io)


Languages

Language:JavaScript 95.4%Language:Shell 4.6%