@kayako/kit
v1.0.11
Published
Kayako command line tool for creating custom apps
Downloads
43
Readme
KIT CLI
The KIT Cli
is the command line tool to create, manage and publish custom apps with Kayako.
Requirements
This project makes use of adonis ace and requires atleast Node.js version 8.0 or greater since this project makes use of async/await
.
Setup
Follow below defined steps to setup this project.
- Clone the repo from Github.
- Run
npm install
to install all required dependencies. - Run
node index.js
to make sure all existing commands runs fine.
Creating new command
All commands lives inside src/Commands
directory and automatically get's registered with ace
.
Also there is an example command saved inside example/Command.js
file as a reference.
Ace reference
All ace
commands are ES6 classes with couple of mandatory static properties and handle
method.
'use strict'
const { Command } = require('@adonisjs/ace')
class MyCommand extends Command {
static get signature () {
return 'command:name'
}
static get description () {
return 'Command description'
}
async handle (args, options) {
}
}
module.exports = MyCommand
Signature
Signature defines the command name and it's requirements. All required/optional arguments and flags are defined within the signature.
For example:
Required argument
static get signature () {
return 'new { projectPath }'
}
Optional argument
static get signature () {
return 'new { projectPath? }'
}
Argument Description
static get signature () {
return 'new { projectPath : Path to directory where to create the project }'
}
Flags
Flags starts with --
.
static get signature () {
return `
new
{ projectPath }
{ --skip-install : Do not install dependencies }
`
}
Description
The command description shown within help output.
Handle method
The handle method is called when the command is executed. It will receive all the arguments and flags as parameters.
await handle (args, options) {
console.log(args.projectName)
console.log(options.skipInstall)
}