# @ueqt/cli

> Node's framework for building immersive CLI apps.

Latest version **1.0.4** (published 2019-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ueqt/cli
pnpm add @ueqt/cli
yarn add @ueqt/cli
bun add @ueqt/cli
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-07-15 |
| First published | 2019-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 7 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ueqt |
| Maintainers | ueqt |
| Keywords | api, cli, repl, shell, immersive, framework, app, application, command, commander, automated, prompt, inquirer, vorpal, ucli, ueqt |

## Links

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

## Dependencies (7)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [inquirer](https://npm.io/package/inquirer.md) 6.5.0
- [wrap-ansi](https://npm.io/package/wrap-ansi.md) ^6.0.0
- [log-update](https://npm.io/package/log-update.md) ^3.2.0
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^5.2.0
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^13.1.1
- [node-localstorage](https://npm.io/package/node-localstorage.md) ^1.3.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

- 1.0.4 (latest) — 2019-07-15
- 1.0.3 — 2019-07-12
- 1.0.2 — 2019-07-12

## README

# Ucli

[![NPM Version](https://img.shields.io/npm/v/@ueqt/cli.svg)](https://www.npmjs.com/package/@ueqt/cli)
[![Build Status](https://travis-ci.com/ueqt/ucli.svg)](https://travis-ci.com/ueqt/ucli/)
[![NPM Downloads](https://img.shields.io/npm/dt/@ueqt/cli.svg)](https://www.npmjs.com/package/@ueqt/cli)
[![Package Quality](http://npm.packagequality.com/shield/%40ueqt%2Fcli.svg)](http://packagequality.com/#?package=@ueqt/cli)
[![Build Status](https://travis-ci.com/ueqt/ucli.svg)](https://travis-ci.com/ueqt/ucli)
[![codecov](https://codecov.io/gh/ueqt/ucli/branch/master/graph/badge.svg)](https://codecov.io/gh/ueqt/ucli/branch/master)

Ucli is Node's first framework for building interactive CLI applications. With a simple and powerful API, Ucli opens the door to a new breed of rich, immersive CLI environments like [cash](https://github.com/dthree/cash) and [wat](https://github.com/dthree/wat).

## Contents

- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [API](#api)
- [Extensions](#extensions)
- [FAQ](#faq)
- [License](#license)

## Introduction

Inspired by and based on [vorpal](https://github.com/dthree/vorpal) and [vorplajs-reforged](https://github.com/vorpaljs-reforged/vorpal), Ucli is a framework for building immersive CLI applications built on an interactive prompt provided by [inquirer.js](https://www.npmjs.com/package/inquirer). Ucli launches Node into an isolated CLI environment and provides a suite of API commands and functionality including:

- [x] Simple, powerful command creation
- [x] Supports optional, required and variadic arguments and options
- [x] Piped commands
- [x] Persistent command history
- [x] Built-in help
- [x] Built-in tabbed auto-completion
- [x] Command-specific auto-completion
- [x] Customizable prompts
- [x] Extensive terminal control
- [x] Custom event listeners
- [x] And more

Ucli supports [community extensions](https://github.com/vorpaljs/awesome-vorpaljs), which empower it to do awesome things such as [piping commands to less](https://github.com/vorpaljs/vorpal-less), [importing commands live](https://github.com/vorpaljs/vorpal-use) or supporting a [built-in REPL](https://github.com/vorpaljs/vorpal-repl).

Made with :heart: by [ueqt](https://github.com/ueqt).

## Getting Started

##### Quick Start

Install `ucli` into your project:

```bash
$ npm install @ueqt/ucli --save
```

Create a `.js` file and add the following:

```js
const Ucli = require('@ueqt/cli').Ucli;
const ucli = new Ucli();
const chalk = require('@ueqt/cli').chalk;

ucli.command('foo', 'Outputs "bar".').action(function(args, callback) {
  this.log('bar');
  callback();
});

ucli.delimiter('myapp$').show();
```

This creates an instance of Ucli, adds a command which logs "bar", sets the prompt delimiter to say "myapp\$", and shows the prompt.

Run your project file. Your Node app has become a CLI:

```bash
$ node server.js
myapp~$
```

Try out your "foo" command.

```bash
myapp~$ foo
bar
myapp~$
```

Now type "help" to see Ucli's built in commands in addition to "foo":

```bash
myapp~$ help

  Commands

    help [command]    Provides help for a given command.
    exit [options]    Exits instance of Ucli.
    foo               Outputs "bar".

myapp~$
```

There's the basics. Once you get the hang of it, [follow this tutorial](http://developer.telerik.com/featured/creating-node-js-command-line-utilities-improve-workflow/) or read on to learn what else Ucli can do.

##### Community

Questions? Use the `ucli.js` StackOverflow tag for fast answers that help others, or jump into chat on Gitter.

- [Stack Overflow](http://stackoverflow.com/questions/tagged/ucli.js)
- [Ucli extensions](https://github.com/vorpaljs/awesome-vorpaljs#vorpal-extensions)
<!-- - [Projects made with Ucli](https://github.com/vorpaljs/awesome-vorpaljs) -->

## [API](https://github.com/ueqt/ucli/wiki)

##### [Command](https://github.com/ueqt/ucli/wiki/api-|-ucli.command)

- [`ucli.command`](https://github.com/ueqt/ucli/wiki/api-%7C-ucli.command#uclicommandcommand-description)
- [`command.description`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commanddescriptionstring)
- [`command.alias`](https://github.com/ueqt/ucli/wiki/api-%7C-ucli.command#commandaliasname-names)
- [`command.parse`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandparseparsefunction)
- [`command.option`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandoptionstring-description)
- [`command.hidden`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandhidden)
- [`command.remove`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandremove)
- [`command.help`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandhelp)
- [`command.autocomplete`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandautocompletearray-or-object-or-function)
- [`command.action`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandactionfunction)
- [`command.cancel`](https://github.com/ueqt/ucli/wiki/api-|-ucli.command#commandcancelfunction)

##### [Mode](https://github.com/ueqt/ucli/wiki/API-|-ucli.mode)

- [`ucli.mode`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli.mode#uclimodecommand-description)
- [`mode.delimiter`](https://github.com/ueqt/ucli/wiki/API-|-ucli.mode#modedelimiterstring)
- [`mode.init`](https://github.com/ueqt/ucli/wiki/API-|-ucli.mode#modeinitfunction)
- [`mode.action`](https://github.com/ueqt/ucli/wiki/API-|-ucli.mode#modeactionfunction)

##### [Catch](https://github.com/ueqt/ucli/wiki/API-|-ucli.catch)

- [`ucli.catch`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli.catch#catchcommand-description)

##### [CommandInstance](https://github.com/ueqt/ucli/wiki/API-|-CommandInstance)

- [`commandInstance.log`](https://github.com/ueqt/ucli/wiki/API-%7C-CommandInstance#commandinstancelogstring-strings)
- [`commandInstance.prompt`](https://github.com/ueqt/ucli/wiki/API-%7C-CommandInstance#commandinstancepromptobject-callback)
- [`commandInstance.delimiter`](https://github.com/ueqt/ucli/wiki/API-%7C-CommandInstance#commandinstancedelimiterstring)

##### [UI](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui)

- [`ui.delimiter`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uidelimitertext)
- [`ui.input`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiinputtext)
- [`ui.imprint`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiimprint)
- [`ui.submit`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uisubmittext)
- [`ui.cancel`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uicancel)
- [`ui.imprint`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiimprint)
- [`ui.redraw`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiredrawtext-text)
- [`ui.redraw.clear`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiredrawclear)
- [`ui.redraw.done`](https://github.com/ueqt/ucli/wiki/api-|-ucli.ui#uiredrawdone)

##### [Vorpal](https://github.com/ueqt/ucli/wiki/API-|-ucli)

- [`.parse`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#ucliparseargv-options)
- [`.delimiter`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclidelimiterstring)
- [`.show`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclishow)
- [`.find`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclifindstring)
- [`.exec`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#ucliexeccommand-callback)
- [`.execSync`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#ucliexecsynccommand-options)
- [`.log`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclilogstring-strings)
- [`.history`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclihistoryid)
- [`.localStorage`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclilocalstorageid)
- [`.help`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclihelpfunction)
- [`.pipe`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#uclipipefunction)
- [`.use`](https://github.com/ueqt/ucli/wiki/API-%7C-ucli#ucliuseextension)

##### [Events](https://github.com/ueqt/ucli/wiki/Docs-%7C-Events)

## Extensions

You can build your own Vorpal commands and extensions.

- [List of awesome extensions](https://github.com/vorpaljs/awesome-vorpaljs#vorpal-extensions)
- [Building your own extension](https://github.com/ueqt/ucli/wiki/Docs-%7C-Creating-Extensions)

## [FAQ](https://github.com/ueqt/ucli/wiki/FAQ)

- [What is an "immersive CLI app?"](https://github.com/ueqt/ucli/wiki/FAQ#what-is-an-immersive-cli-app)
- [Wasn't this called Vantage?](https://github.com/ueqt/ucli/wiki/FAQ#uh-wasnt-this-called-vantage)

## License

MIT © [Ueqt](https://github.com/ueqt)

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