2.3.3 • Published 5 months ago

@saithodev/cli-base v2.3.3

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

@saithodev/cli-base

Build Status npm version Coverage semantic-release Commitizen friendly

This package provides a basic API for creating CLI-based packages.

Example

The following example will add two commands "help" and "version".

index.ts

import {Cli, HelpCommand, VersionCommand} from "@saithodev/cli-base";

new Cli('typo3-extension-release')
    .setOptions({
        'dry-run': {
            type: 'boolean',
            default: false,
            alias: 'd',
            description: 'Simulates changes without writing them'
        }
    })
    .addCommand(new HelpCommand()) // adds help command
    .addCommand(new VersionCommand()) // adds version command
    .run()
    .catch((error) => {
        console.error(error);
        process.exit(1);
    });

Compile sources and test it with dist/index.js help and dist/index.js version.

For details on how to implement custom commands, take a closer look at the example and the command classes used there.

2.3.0

5 months ago

2.1.2

5 months ago

2.2.0

5 months ago

2.1.1

5 months ago

2.3.2

5 months ago

2.1.4

5 months ago

2.3.1

5 months ago

2.1.3

5 months ago

2.3.3

5 months ago

2.1.0

5 months ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago