UNPKG

829 BMarkdownView Raw
1# Menehra-CLI
2
3a cli plugin for menhera
4
5### Use For Module
6
7```bash
8yarn add menhera menhera-cli
9```
10
11```js
12// index.js
13const _ = new Menhera({
14 _mount: {
15 CLI
16 },
17 CLI: {
18 commands: {
19 _: {
20 options: {
21 test: {
22 alias: "t",
23 desc: "test"
24 }
25 },
26 exec({ _, $0, _key }) {
27 if (!$0) {
28 _.$use({ CLI: { help: _key } });
29 }
30 }
31 },
32 foo: {
33 desc: "Test foo",
34 args: ["foo", "foo1"],
35 exec({ foo }) {}
36 },
37 bar: {
38 desc: "Test bar",
39 args: ["bar"],
40 exec({ bar }) {}
41 }
42 }
43 }
44}).$use({
45 CLI: {
46 config: {
47 name: "example",
48 version: "0.0.2",
49 start: true
50 }
51 }
52});
53```
54
55```bash
56node index.js -h
57```
58
59![preview](./assets/cli.png)