# cav

> [![npm version](https://badge.fury.io/js/cav.svg)](https://badge.fury.io/js/cav)

Latest version **0.1.0** (published 2017-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install cav
pnpm add cav
yarn add cav
bun add cav
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-05-05 |
| First published | 2017-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | about_hiroppy |
| Keywords | cli, node, command-line |

## Links

- npm: https://www.npmjs.com/package/cav
- Repository: https://github.com/abouthiroppy/cav
- Homepage: https://github.com/abouthiroppy/cav#readme
- Issues: https://github.com/abouthiroppy/cav/issues
- npm.io page: https://npm.io/package/cav

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [cli-table2](https://npm.io/package/cli-table2.md) ^0.2.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-05-05
- 0.0.2 — 2017-04-10
- 0.0.1 — 2017-04-10

## README

# cav
[![npm version](https://badge.fury.io/js/cav.svg)](https://badge.fury.io/js/cav)

A supporter for making your CLI.

## Install
```sh
$ npm i -S cav
```

## Examples
```js
#!/usr/bin/env node

// sample-cli

const Cav = require('cav');
const packageJson = require('./package.json');

const commands = {
  'deploy <to> <env>'            : 'Deploy to ec2.',
  'migrate <from> <to> <version>': 'Migrate data.',
  '-f'                           : '✊',
  '-c, --current-state'          : 'Show Current State.'
};

const cav = new Cav(commands, packageJson);

cav.start((args) => {
  console.log(args)
});
```

## Parse arguments
```sh
$ sample-cli deploy japan prod -f -c ok
```
```js
cav.start((args) => {
  console.log(JSON.stringify(args, null, 2));
  //  {
  //    "commands": {
  //      "deploy": {
  //        "to": "japan",
  //        "env": "prod"
  //      }
  //    },
  //    "options": {
  //      "f": true,
  //      "c": "ok"
  //    }
  //  }
});
```

## help
```
Version:    1.0.0

Usage:      sample-cli <commands> <options>

Commands:
            deploy <to> <env>                 Deploy to ec2.
            migrate <from> <to> <version>     Migrate data.
Options:
            -v, --version                     Display version.
            -h, --help                        Display help.
            -f                                ✊
            -c, --current-state               Show Current State.
```

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