MCPcopy
hub / github.com/dthree/vorpal

github.com/dthree/vorpal @v1.4.0 sqlite

repository ↗ · DeepWiki ↗ · release v1.4.0 ↗
29 symbols 50 edges 18 files 7 documented · 24%
README

Vorpal

Build Status Gitter NPM Version Wat: Documented 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 wat and vantage.

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:

  • [x] Simple, powerful command creation
  • [x] Supports optional, required and variadic arguments and options
  • [x] Piped commands
  • [x] 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!

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

Made with :heart: by dthree.

Getting Started

Quick Start

Install vorpal into your project:

$ npm install vorpal --save

Create a .js file and add the following:

var 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 the app.
    foo               Outputs "bar".

myapp~$

That's the basic idea. Once you get the hang of it, read on to learn some of the fancier things Vorpal can do.

Community

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.

Roadmap

  • Suggest something!

License

MIT

Core symbols most depended-on inside this repo

stdout
called by 27
test/integration.js
exec
called by 24
test/integration.js
s4
called by 8
lib/session.js
callback
called by 7
lib/vorpal.js
onCompletion
called by 3
lib/session.js
viewed
called by 3
lib/logger.js
throwHelp
called by 3
lib/vorpal.js
parsePipes
called by 2
lib/util.js

Shape

Function 29

Languages

TypeScript100%

Modules by API surface

test/integration.js7 symbols
lib/session.js5 symbols
lib/vorpal.js4 symbols
lib/logger.js4 symbols
lib/util.js3 symbols
lib/command.js2 symbols
lib/command-instance.js2 symbols
lib/option.js1 symbols
lib/intercept.js1 symbols

Used by 3 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

chalk1.1.0 · 1×
eslint1.7.1 · 1×
eslint-config-xo0.6.0 · 1×
gulp3.9.0 · 1×
gulp-eslint0.15.0 · 1×
inquirer0.10.1 · 1×
lodash3.10.1 · 1×
log-update1.0.2 · 1×
minimist1.2.0 · 1×
mocha2.2.5 · 1×
moment2.10.3 · 1×
native-promise-only0.8.0-a · 1×

For agents

$ claude mcp add vorpal \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact