@alterior/command-line
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

@/command-line

Provides a framework for creating command line tools using Alterior. Naturally this is the command line handling library for the Alterior CLI, but it can be used for any sort of command line tool you might need to build.

Getting Started

// src/main.ts

import PKG = require('../package.json');
let line = new CommandLine()
    .info({
        executable: 'my-tool',
        description: 'An example CLI application',
        copyright: 'Copyright 2023 Me',
        version: PKG.version
    })
    .command('frobulate', cmd => {
        cmd .info({
                description: 'Frobulate the given value',
                argumentUsage: '<value>'
            })
            .run(([ value ]) => {
                console.log(`You have frobulated ${value}!`);
            })
        ;
    })
    .run(() => line.showHelp());
;

line.process();

Readme

Keywords

Package Sidebar

Install

npm i @alterior/command-line

Weekly Downloads

8

Version

3.2.0

License

MIT

Unpacked Size

135 kB

Total Files

91

Last publish

Collaborators

  • rezonant