# nos-cli

> nos

Latest version **0.2.1** (published 2021-06-21) · MIT license · 0 weekly downloads

## Install

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

Provides the command `nos`.

## 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.2.1 |
| Published | 2021-06-21 |
| First published | 2018-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 28.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | liyi |
| Maintainers | yliiii |

## Links

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

## Dependencies (9)

- [q](https://npm.io/package/q.md) ^1.5.1
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [dayjs](https://npm.io/package/dayjs.md) ^1.7.7
- [table](https://npm.io/package/table.md) ^5.1.0
- [crypto](https://npm.io/package/crypto.md) ^1.0.1
- [through2](https://npm.io/package/through2.md) ^3.0.0
- [commander](https://npm.io/package/commander.md) ^7.2.0
- [gulp4-run-sequence](https://npm.io/package/gulp4-run-sequence.md) ^1.0.1
- [@xgheaven/nos-node-sdk](https://npm.io/package/@xgheaven/nos-node-sdk.md) 0.2.5

## Recent versions

- 0.2.1 (latest) — 2021-06-21
- 0.2.0 — 2021-06-21
- 0.0.15 — 2019-01-04
- 0.0.14 — 2018-11-26
- 0.0.13 — 2018-11-26
- 0.0.12 — 2018-11-26
- 0.0.11 — 2018-11-22
- 0.0.10 — 2018-11-22
- 0.0.9 — 2018-11-22
- 0.0.8 — 2018-11-22
- 0.0.7 — 2018-11-22
- 0.0.6 — 2018-11-22
- 0.0.5 — 2018-11-22
- 0.0.4 — 2018-11-22
- 0.0.3 — 2018-11-22
- … 2 more at https://npm.io/package/nos-cli/versions

## README

# nos CLI

## About
nos CLI 实现了 NOS 查看和上传功能。 能方便快速的查看指定桶的文件列表。能够单上传文件和批量上传整个目录文件，并且不会破坏文件路径。可以通过配置文件配置环境变量路径前缀，实现文件的环境划分。

## Install
```sh
npm i nos-cli -g
```

## Usage
```sh
nos -h

Usage: nos [options]

-c and -b is required everytime

Options:
  -V, --version               output the version number
  -c, --config <config_path>  nos config path
  -b, --bucket <bucket_name>  nos bucket name
  -l, --list [path_pattern]>  show directory
  -u, --upload <file_path>    upload file
  -e, --env <env>             key `prefixPath` from config file
  -n, --normal                disable md5
  -h, --help                  output usage information
```

## Config File
```js
{
  "accessKey": "your accessKey",
  "accessSecret": "your accessSecret",
  "endpoint": "your endpoint",
  "pathPrefix" : {
    "qa": "myqa/test",
    "dev": "mydev/test"
  }
}
```

## Example
show root directory
```sh
nos -c [myConfiPath] -b [bucketName] -l
```

show directory by prefix
```sh
nos -c [myConfiPath] -b [bucketName] -l [prefix]
```

upload file
```sh
nos -c [myConfiPath] -b [bucketName] -u [filePath]
```

batch upload (and set env)
```sh
nos -c [myConfiPath] -b [bucketName] -u [dir] -e [prefixPathKey: qa|dev|...]
```

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