Josh.Shell

It provides a simple console UI, using a panel for the console viewport and an auto-scrolling view inside the panel. It uses Underscore templates for generating the view html, although any template generator can be substituted as long as it can be expressed in the form of a function that takes a JSON object of arguments and returns an html string.

It also implements command handling so that new commands can be added by name with execution and completion handlers. Out of the box, shell.js provides the following commands:

Functions

new Josh.Shell(config)

Config keys:

bestMatch(partial, possible)

commands()

isActive()

activate()

deactivate()

render()

refresh()

scrollToBottom()

getCommandHandler(commandHandler)

setCommandHandler(cmdName,cmdHandler)

setPrompt(prompt)

onEOT(eventHandler)

onCancel(eventHandler)

onInitialize(eventHandler)

onActivate(eventHandler)

onDeactivate(eventHandler)

onNewPrompt(eventHandler)

Internal Dependencies

Josh.Readline

Josh.History

External Dependencies

jQuery

Underscore