0.4.0 • Published 10 months ago

yax-cli v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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-cli

Documentation

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 file

files

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 on

Output

Hello moto!
Phone turned on :D

Show help

phone --help

output

USAGE: phone <COMMAND> [OPTIONS]
DESCRIPTION: Phone demo cli
COMMANDS:
  * on
OPTIONS:
--help, -h                             (optional) Display help

That's it, I hope this tool can help you :)

https://github.com/MiguelYax/yax-cli/blob/feature/monorepo/packages/yax-cli/README.md https://github.com/MiguelYax/yax-cli/blob/main/docs/MULTI-LEVEL.md

0.3.2

10 months ago

0.4.0

10 months ago

0.3.3

10 months ago

0.3.0

10 months ago

0.3.1

10 months ago

0.2.1

10 months ago

0.2.2

10 months ago

0.2.0

10 months ago

0.1.0

10 months ago