dthree/vorpal


Node's framework for interactive CLIs

http://vorpal.js.org

License: MIT

Language: JavaScript

Keywords: cli, interactive, node, shell


Vorpal

Build Status NPM Downloads Package Quality NPM Version XO code style

Conquer the command-line.

              (O)
              <M
   o          <M
  /| ......  /:M\------------------------------------------------,,,,,,
(O)[ vorpal ]::@+}==========================================------------>
  \| ^^^^^^  \:W/------------------------------------------------''''''
   o          <W
              <W
              (O)

Vorpal is Node's first framework for building interactive CLI applications. With a simple and powerful API, Vorpal opens the door to a new breed of rich, immersive CLI environments like cash and wat.

Notice

This is now an OPEN Open Source project. I am not able to invest a significant amount of time into maintaining Vorpal and so am looking for volunteers who would like to be active maintainers of the project. If you are interested, shoot me a note.

Contents

Introduction

Inspired by and based on commander.js, Vorpal is a framework for building immersive CLI applications built on an interactive prompt provided by inquirer.js. Vorpal launches Node into an isolated CLI environment and provides a suite of API commands and functionality including:

  • Simple, powerful command creation
  • Supports optional, required and variadic arguments and options
  • Piped commands
  • Persistent command history
  • Built-in help
  • Built-in tabbed auto-completion
  • Command-specific auto-completion
  • Customizable prompts
  • Extensive terminal control
  • Custom event listeners
  • And more

Vorpal supports community extensions, which empower it to do awesome things such as piping commands to less, importing commands live or supporting a built-in REPL.

Made with ❤️ by dthree.

Getting Started

Quick Start

Install vorpal into your project:

$ npm install vorpal --save

Create a .js file and add the following:

const vorpal = require('vorpal')();

vorpal
  .command('foo', 'Outputs "bar".')
  .action(function(args, callback) {
    this.log('bar');
    callback();
  });

vorpal
  .delimiter('myapp$')
  .show();

This creates an instance of Vorpal, 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:

$ node server.js
myapp~$

Try out your "foo" command.

myapp~$ foo
bar
myapp~$

Now type "help" to see Vorpal's built in commands in addition to "foo":

myapp~$ help

  Commands

    help [command]    Provides help for a given command.
    exit [options]    Exits instance of Vorpal.
    foo               Outputs "bar".

myapp~$

There's the basics. Once you get the hang of it, follow this tutorial or read on to learn what else Vorpal can do.

Community

Questions? Use the vorpal.js StackOverflow tag for fast answers that help others, or jump into chat on Gitter.

API

Command
Mode
Catch
CommandInstance
UI
Vorpal
Events

Extensions

You can build your own Vorpal commands and extensions.

FAQ

Why Vorpal?

One, two! One, two! and through and through
The vorpal blade went snicker-snack!
He left it dead, and with its head
He went galumphing back.

Lewis Carroll, Jabberwocky
Life Goals:
  • Build a popular framework based on the Jabberwocky poem.

License

MIT © David Caccavella

Project Statistics

Sourcerank 18
Repository Size 960 KB
Stars 5,219
Forks 271
Watchers 82
Open issues 132
Dependencies 27
Contributors 32
Tags 61
Created
Last updated
Last pushed

Top Contributors See all

dc scotthovestadt Jacky Liu Miles Johnson Drew Brokke Chet Corcos Jeff Harris Matti Jokitulppo Mark Vayngrib da70 Alan Souza Philipp Frédéric GRATI Artem Kostiuk Adrien Becchis Matthew O'Connor Daniel Ruf Michel.Ypma dashlanebot Eli Perelman

Packages Referencing this Repo

@seneca/vorpal
Node's first framework for building immersive CLI apps.
Latest release 2.1.1 - Updated - 5.22K stars
serviser-vorpal
Node's first framework for building immersive CLI apps.
Latest release 1.11.5 - Published - 5.22K stars
vorpal2
Node's first framework for building immersive CLI apps.
Latest release 1.0.0 - Published - 5.22K stars
bi-vorpal
Node's first framework for building immersive CLI apps.
Latest release 1.11.5 - Published - 5.22K stars
@jigsaw/vorpal
Node's first framework for building immersive CLI apps.
Latest release 1.0.8 - Published - 5.22K stars
vorpal
Node's first framework for building immersive CLI apps.
Latest release 1.12.0 - Updated - 5.22K stars

Recent Tags See all

v1.4.0 December 01, 2015
v1.3.34 October 31, 2015
v1.3.33 October 31, 2015
v1.3.32 October 31, 2015
v1.3.31 October 31, 2015
v1.3.30 October 31, 2015
v1.3.29 October 31, 2015
v1.3.28 October 28, 2015
v1.3.27 October 28, 2015
v1.3.26 October 22, 2015
v1.3.25 October 20, 2015
v1.3.24 October 19, 2015
v1.3.23 October 18, 2015
v1.3.22 October 18, 2015
v1.3.21 October 14, 2015

Interesting Forks See all

vorpaljs-reforged/vorpal
Node's framework for interactive CLIs
TypeScript - MIT - Last pushed - 8 stars
sindresorhus/vorpal
Node's framework for interactive CLI apps.
JavaScript - MIT - Last pushed - 2 stars
everflowing/vorpal
Node's framework for interactive CLIs
JavaScript - Updated - 1 stars
milesj/vorpal
Node's framework for interactive CLIs.
JavaScript - Updated - 1 stars
mcanthony/vorpal
Node's framework for interactive CLI apps.
JavaScript - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2020-01-08 01:48:38 UTC

Login to resync this repository