# snack-cli

> command-line interfaces for node.js

Latest version **2.0.0** (published 2019-03-12) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-03-12 |
| First published | 2015-05-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.0.0 |
| Dependencies | 6 |
| Unpacked size | 25.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Guoqiang Chen |
| Maintainers | subchen |
| Keywords | snack, cli, getopt, command, option, parser |

## Links

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

## Dependencies (6)

- [lodash.find](https://npm.io/package/lodash.find.md) ^4.6.0
- [lodash.maxby](https://npm.io/package/lodash.maxby.md) ^4.6.0
- [lodash.padend](https://npm.io/package/lodash.padend.md) ^4.6.1
- [lodash.endswith](https://npm.io/package/lodash.endswith.md) ^4.2.1
- [lodash.camelcase](https://npm.io/package/lodash.camelcase.md) ^4.3.0
- [lodash.startswith](https://npm.io/package/lodash.startswith.md) ^4.2.1

## 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

- 2.0.0 (latest) — 2019-03-12
- 1.1.0 — 2015-05-07
- 1.0.0 — 2015-05-06

## README

[![Build Status](https://travis-ci.org/subchen/snack-cli.svg?branch=master)](https://travis-ci.org/subchen/snack-cli)
[![Code Coverage](https://img.shields.io/coveralls/subchen/snack-cli/master.svg)](https://coveralls.io/r/subchen/snack-cli)
[![NPM Repo](https://img.shields.io/npm/v/snack-cli.svg)](https://www.npmjs.com/package/snack-cli)
[![License](http://img.shields.io/badge/License-Apache_2-red.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)

**SNACK-CLI** is command-line interfaces for node.js

# Install by npm

```shell
npm install snack-cli
```

# Example

```js
var cli = require('snack-cli');

var argv = cli
    .name('sftp')
    .version('1.0.0-beta')
    .usage('[options] local remote')
    .description('An sftp application written by node.js')
    .option('    --host <host>', 'remote ssh hostname/ip')
    .option('    --port <port>', 'remote ssh port', '22', cli.transformers.asInt)
    .option('-u, --username <user>', 'username for authentication', 'root')
    .option('-p, --password <pass>', 'password for authentication')
    .option('    --auto-mkdirs', 'mkdirs when dir not found')
    .allowArgumentCount(2)
     //.allowUnknownOption()
     //.allowMissingRequiredOption()
    .parse();

console.log(argv);
```

When you execute following cli:

```shell
sftp --host 192.168.0.254 -p 111111 --auto-mkdirs ./1.txt /tmp/1.txt
```

You will get:

```
{
    'host': '192.168.0.254',
    'port': 22,
    'username': 'root',
    'password': '111111',
    'autoMkdirs': true,
    'args': [
        './1.txt',
        '/tmp/1.txt'
    ]
}
```

# Output help


When you execute following cli:

```shell
sftp --help
```

You will get:

```
Usage: sftp [options] local remote

An sftp application written by node.js

Options:
      --host <host>       remote ssh hostname/ip
      --port <port>       remote ssh port (default: 22)
  -u, --username <user>   username for authentication (default: root)
  -p, --password <pass>   password for authentication
      --auto-mkdirs       mkdirs when dir not found
      --version           display version information and exit
      --help              display this help and exit
```

# License

Released under the [Apache 2 License](http://www.apache.org/licenses/LICENSE-2.0).

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