Package Exports
- yax-cli
- yax-cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yax-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
yax-cli
Yet another command line tool helper, multi-level, and generator using Javascript/Typescript. (By the way my last name is Yax)
Install
npm install yax-cliDocumentation
Getting started
Main structure
As a example, It uses src as source path.
repository
├── src
│   ├── phone ## relative path 
│   │   ├──on 
│   │   │  └── index.ts ## implements CommandInterface
│   ├── index.ts  ##  Command line Register filefiles
Command line register definition file
#!/usr/bin/env node
import { Register } from 'yax-cli'
new Register({
  description: 'Phone demo cli',
  commandsPath: `${__dirname}/phone`, //  Add here your full path to the directory
  process,  // Procees runtime variable
});phone on command definition
import { CommandInterface } from "yax-cli";
export default class Cmd implements CommandInterface {
  description = 'Phone turn on';
  examples = [];
  validations = [];
  handler() {
    console.log('Hello moto!');
    console.log('Phone turned on :D');
  }
};Executing
phone onOutput
Hello moto!
Phone turned on :DShow help
phone --helpoutput
USAGE: phone <COMMAND> [OPTIONS]
DESCRIPTION: Phone demo cli
COMMANDS:
  * on
OPTIONS:
--help, -h                             (optional) Display help