# class-cli

> Class-based CLI

Latest version **0.3.2** (published 2020-01-26) · 0 weekly downloads

## Install

```sh
npm install class-cli
pnpm add class-cli
yarn add class-cli
bun add class-cli
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2020-01-26 |
| First published | 2020-01-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | laggingreflex |

## Links

- npm: https://www.npmjs.com/package/class-cli
- Repository: https://github.com/laggingreflex/class-cli
- Homepage: https://github.com/laggingreflex/class-cli#readme
- Issues: https://github.com/laggingreflex/class-cli/issues
- npm.io page: https://npm.io/package/class-cli

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^15.0.2
- [configucius](https://npm.io/package/configucius.md) ^5.1.0

## Recent versions

- 0.3.2 (latest) — 2020-01-26
- 0.3.1 — 2020-01-20
- 0.3.0 — 2020-01-20
- 0.2.0 — 2020-01-20
- 0.1.0 — 2020-01-15

## README

# class-cli

A class-based approach to creating a CLI app

## Install

```
npm i class-cli
```

## Usage

```
const CLI = require('class-cli')

class App extends CLI {

  /* Use `CLI.option` to Define the args/flags using yargs-like options object */
  arg = CLI.option({ type: 'string', default: 'value' })

  /* Use `CLI.command` to Define commands the same way */
  command = CLI.command({
    command: '$0 [arg]',
    description: 'do stuff',
    ...
  })
}

const app = new App()
/* Initialize */
CLI.init(app);
/* Run */
CLI.run(app);
```

---
_Source: https://npm.io/package/class-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
