2.1.10 • Published 8 months ago

@flatjs/cli v2.1.10

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@flatjs/cli

A tool the modern for rapidly building command line flatjs apps

Install globally

  • npm i -g @flatjs/cli

Module/Programmatic Usage

  • yarn add @flatjs/cli

Add this package to package dependencies linked to your app, just import them like regular packages:

import { bootstrap } from '@flatjs/cli';

bootstrap().then((cli) => {
  // Register customized plugins chain.
  cli.register(pluginA).register(pluginB);

  // Parse progress arguments.
  cli.parse(process.argv.slice(2));
});

Create a custom flatjs-based plugin chain e.g. flat test

  • flatjs-cli-plugin-test/package.json
    "type": "module",
    "exports": {
      ".": {
        "import": "./index.js"
      },
      "./package.json": "./package.json"
    },
  • flatjs-cli-plugin-test/src/index.ts
import type { CommandArgv } from '@armit/commander';
import { AbstractHandler, createCommand } from '@armit/commander';

type TestCmdArgs = CommandArgv<{
  test: number;
}>;

class CmdTestHandle extends AbstractHandler<TestCmdArgs> {
  handle(): void | Promise<void> {
    console.log('this is test command handle');
    this.logger.debug('this is debug message for test command');
  }
}

const cmdTest = createCommand(
  'test',
  {
    command: 'test',
    describe: 'Display flatjs project details.',
    builder: (yargs) => {
      return yargs.example(`$0 cmd test `, 'cli testing').option('test', {
        type: 'number',
        alias: 't',
        default: true,
        describe: `cli option test describe`,
      });
    },
  },
  CmdTestHandle
);
// As default export
export default cmdTest;

Contributing

Contributions are happily accepted. I respond to all PR's and can offer guidance on where to make changes. For contributing tips see CONTRIBUTING.md

2.1.10

8 months ago

2.1.9

9 months ago

2.1.8

9 months ago

2.1.6

10 months ago

2.1.7

10 months ago

2.1.5

10 months ago

2.1.1

11 months ago

2.1.4

11 months ago

2.1.3

11 months ago

2.1.0

11 months ago

2.1.0-next.13

1 year ago

2.1.0-next.17

1 year ago

2.1.0-next.16

1 year ago

2.1.0-next.15

1 year ago

2.1.0-next.14

1 year ago

2.1.0-next.19

1 year ago

2.1.0-next.18

1 year ago

2.1.0-next.20

1 year ago

2.1.0-next.24

1 year ago

2.1.0-next.23

1 year ago

2.1.0-next.22

1 year ago

2.1.0-next.21

1 year ago

2.1.0-next.28

12 months ago

2.1.0-next.27

12 months ago

2.1.0-next.26

12 months ago

2.1.0-next.25

1 year ago

2.1.0-next.29

12 months ago

2.1.0-next.31

12 months ago

2.1.0-next.30

12 months ago

2.1.0-next.34

12 months ago

2.1.0-next.33

12 months ago

2.1.0-next.12

1 year ago

2.1.0-next.11

1 year ago

2.1.0-next.10

1 year ago

2.1.0-next.9

1 year ago

2.1.0-next.8

1 year ago

2.1.0-next.7

1 year ago

2.1.0-next.6

1 year ago

2.1.0-next.4

1 year ago

2.1.0-next.5

1 year ago

2.1.0-next.2

1 year ago

2.1.0-next.1

1 year ago

2.1.0-next.3

1 year ago

2.1.0-next.0

1 year ago

2.0.20

1 year ago

2.0.19

1 year ago

2.0.17

1 year ago

2.0.18

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

2.0.10

1 year ago

2.0.7

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.3

1 year ago

2.0.4

1 year ago

2.0.2

2 years ago

2.0.0-next.6

2 years ago

1.8.1-next.101

2 years ago

2.0.0-next.7

2 years ago

1.8.1-next.102

2 years ago

2.0.0-next.4

2 years ago

2.0.0-next.5

2 years ago

1.8.1-next.100

2 years ago

1.8.1-next.105

2 years ago

1.8.1-next.106

2 years ago

1.8.1-next.103

2 years ago

1.8.1-next.104

2 years ago

1.8.1-next.109

2 years ago

1.8.1-next.107

2 years ago

1.8.1-next.108

2 years ago

2.0.0-next.2

2 years ago

2.0.0-next.3

2 years ago

2.0.0-next.1

2 years ago

1.8.1-next.120

2 years ago

1.8.1-next.123

2 years ago

1.8.1-next.124

2 years ago

1.8.1-next.121

2 years ago

1.8.1-next.122

2 years ago

1.8.1-next.127

2 years ago

1.8.1-next.128

2 years ago

1.8.1-next.125

2 years ago

1.8.1-next.126

2 years ago

1.8.1-next.129

2 years ago

1.8.1-next.112

2 years ago

1.8.1-next.113

2 years ago

1.8.1-next.110

2 years ago

1.8.1-next.111

2 years ago

1.8.1-next.116

2 years ago

1.8.1-next.117

2 years ago

1.8.1-next.114

2 years ago

1.8.1-next.118

2 years ago

1.8.1-next.119

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.8.1-next.130

2 years ago

1.8.1-next.131

2 years ago

1.8.1-next.134

2 years ago

1.8.1-next.132

2 years ago

1.8.1-next.133

2 years ago

1.8.1-next.81

2 years ago

1.8.1-next.83

2 years ago

1.8.1-next.82

2 years ago

1.8.1-next.85

2 years ago

1.8.1-next.84

2 years ago

1.8.1-next.87

2 years ago

1.8.1-next.86

2 years ago

1.8.1-next.89

2 years ago

1.8.1-next.88

2 years ago

1.8.1-next.90

2 years ago

1.8.1-next.92

2 years ago

1.8.1-next.91

2 years ago

1.8.1-next.94

2 years ago

1.8.1-next.95

2 years ago

1.8.1-next.98

2 years ago

1.8.1-next.97

2 years ago

1.8.1-next.99

2 years ago

1.8.1-next.67

2 years ago

1.8.1-next.66

2 years ago

1.8.1-next.69

2 years ago

1.8.1-next.68

2 years ago

1.8.1-next.70

2 years ago

1.8.1-next.72

2 years ago

1.8.1-next.71

2 years ago

1.8.1-next.74

2 years ago

1.8.1-next.73

2 years ago

1.8.1-next.76

2 years ago

1.8.1-next.75

2 years ago

1.8.1-next.78

2 years ago

1.8.1-next.77

2 years ago

1.8.1-next.79

2 years ago

1.8.1-next.80

2 years ago

1.8.1-next.65

2 years ago

1.8.1-next.64

2 years ago

1.8.1-next.21

2 years ago

1.8.1-next.20

2 years ago

1.8.1-next.25

2 years ago

1.8.1-next.24

2 years ago

1.8.1-next.27

2 years ago

1.8.1-next.26

2 years ago

1.8.1-next.29

2 years ago

1.8.1-next.28

2 years ago

1.8.1-next.30

2 years ago

1.8.1-next.32

2 years ago

1.8.1-next.31

2 years ago

1.8.1-next.34

2 years ago

1.8.1-next.33

2 years ago

1.8.1-next.36

2 years ago

1.8.1-next.35

2 years ago

1.8.1-next.38

2 years ago

1.8.1-next.37

2 years ago

1.8.1-next.39

2 years ago

1.8.1-next.41

2 years ago

1.8.1-next.40

2 years ago

1.8.1-next.43

2 years ago

1.8.1-next.42

2 years ago

1.8.1-next.45

2 years ago

1.8.1-next.44

2 years ago

1.8.1-next.47

2 years ago

1.8.1-next.46

2 years ago

1.8.1-next.49

2 years ago

1.8.1-next.48

2 years ago

1.8.1-next.50

2 years ago

1.8.1-next.52

2 years ago

1.8.1-next.51

2 years ago

1.8.1-next.54

2 years ago

1.8.1-next.56

2 years ago

1.8.1-next.55

2 years ago

1.8.1-next.58

2 years ago

1.8.1-next.57

2 years ago

1.8.1-next.59

2 years ago

1.8.1-next.61

2 years ago

1.8.1-next.60

2 years ago

1.8.1-next.63

2 years ago

1.8.1-next.62

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.5.26-alpha.1

2 years ago

1.5.26-alpha.0

2 years ago

1.8.1-next.18

2 years ago

1.8.1-next.19

2 years ago

1.5.23

2 years ago

1.5.25

2 years ago

1.5.24

2 years ago

1.5.27

2 years ago

1.5.29

2 years ago

1.5.28

2 years ago

1.5.16

2 years ago

1.5.15

2 years ago

1.5.19

2 years ago

1.5.12

2 years ago

1.5.14

2 years ago

1.5.13

2 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.4

3 years ago

1.5.11

2 years ago

1.4.21

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.20

3 years ago

1.4.15

3 years ago

1.4.16

3 years ago

1.4.14

3 years ago

1.4.13

3 years ago

1.4.12

3 years ago

1.4.11

3 years ago

1.4.10

3 years ago

1.4.9

3 years ago

1.4.8

3 years ago

1.4.5

3 years ago

1.4.3

3 years ago

1.4.7

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.2.96

3 years ago

1.2.97

3 years ago

1.3.7

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.92

4 years ago

1.2.93

4 years ago

1.2.94

4 years ago

1.2.95

4 years ago

1.2.81

4 years ago

1.2.82

4 years ago

1.2.85

4 years ago

1.2.86

4 years ago

1.2.83

4 years ago

1.2.88

4 years ago

1.2.90

4 years ago

1.2.91

4 years ago

1.2.78

4 years ago

1.2.77

4 years ago

1.2.75

4 years ago

1.2.76

4 years ago

1.2.72

4 years ago

1.2.71

4 years ago

1.2.67

4 years ago

1.2.60

4 years ago

1.2.62

4 years ago

1.2.57

4 years ago

1.2.55

4 years ago

1.2.53

4 years ago

1.2.52

4 years ago

1.2.50

4 years ago

1.2.51

4 years ago

1.2.48

4 years ago

1.2.41

4 years ago

1.2.42

4 years ago

1.2.40

4 years ago

1.2.39

4 years ago

1.2.35

4 years ago

1.2.32

4 years ago

1.2.33

4 years ago

1.2.36

4 years ago

1.2.30

4 years ago

1.2.28

4 years ago

1.2.27

4 years ago

1.2.24

4 years ago

1.2.23

4 years ago

1.2.21

4 years ago

1.2.19

4 years ago

1.2.17

4 years ago

1.2.16

4 years ago