Nonagons Please Me

    menhera-cli

    0.3.6 • Public • Published

    Menehra-CLI

    a cli plugin for menhera

    Use for CLI Tools

    $ yarn global add menhera-cli

    Install Template

    $ mhr e init:cli
    $ mhr e init:module

    Use For Module

    $ yarn add menhera menhera-cli

    example

    // index.js
    const mhr = require("menhera").default;
    const CLI = require("menhera-cli");
    
    const Foo = CLI({ name: "Foo", version: "0.0.1" });
    
    mhr.$use({
      _mount: {
        Foo
      },
      Foo: {
        commands: {
          _: {
            options: {
              test: { alias: "t", desc: "test", default: null }
            },
            exec({ _, _key, env }) {
              if (env.NONE_INPUTS) {
                _.$use({ Foo: { help: _key } });
              }
            }
          },
          foo: {
            desc: "Test foo",
            args: ["foo", "foo1"],
            examples: {
              foo: "foo 123"
            },
            exec({ foo }) {
              console.log(foo);
            }
          },
          bar: {
            desc: "Test bar",
            args: ["bar"],
            examples: {
              bar: "bar 456"
            },
            exec({ bar }) {
              console.log(bar);
            }
          }
        },
        config: {
          start: true
        }
      }
    });
    
    $ node index.js

    preview

    preview

    Keywords

    none

    Install

    npm i menhera-cli

    DownloadsWeekly Downloads

    12

    Version

    0.3.6

    License

    MIT

    Unpacked Size

    31.5 kB

    Total Files

    6

    Last publish

    Collaborators

    • vaiii