# sacli

> Elegant type-safe CLI builder for Node.js

Latest version **4.0.4** (published 2022-02-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.4 |
| Published | 2022-02-28 |
| First published | 2018-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wilson Lin |
| Maintainers | wilsonzlin |
| Keywords | cli, arg, args, command, line, option, options, argument, arguments, parameter, parameters |

## Links

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

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

- 4.0.4 (latest) — 2022-02-28
- 4.0.3 — 2021-09-15
- 4.0.2 — 2021-09-14
- 4.0.1 — 2021-09-14
- 4.0.0 — 2021-09-14
- 3.0.0 — 2021-02-17
- 2.0.0 — 2020-03-04
- 1.0.0 — 2018-11-23
- 0.0.1 — 2018-07-31

## README

# sacli

Elegant and modern CLI builder for Node.js applications.

## Features

- Multiple commands at any depth.
- Automatic nicely formatted command help.
- Type safe across commands.

Get it now:

```bash
npm i sacli
```

## Example

```ts
const git = Command.new()
  .optional("dir", String)
  .required("id", Number)
  .repeated("flags", String);

git
  .subcommand("status")
  .boolean("verbose", {description: "Show full details"})
  .repeated("folders", String, {alias: "F"})
  .repeated("files", String, {default: true})
  .action((args) => {
    args.dir === undefined;
    args.id === 78;
    args.flags.length === 0;
    args.verbose === false;
    arrayEquals(args.folders, ["a/", "b/"]);
    arrayEquals(args.files, ["a", "b", "c"]);
  });

git.eval(["--id", "78", "status", "-F", "a/", "b/", "--", "a", "b", "c"]);
```

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