Project

nirvana

0.02
No commit activity in last 3 years
No release in over 3 years
A ruby web shell that has autocompletion and readline behavior. It uses websockets, repl.js, readline.js and ripl for the shell engine.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.4
>= 0.1.8
>= 1.4.3
>= 0.3.0
 Project Readme

Description¶ ↑

A ruby web shell that has autocompletion and readline behavior. It uses websockets, repl.js, readline.js and ripl for the shell engine.

Install¶ ↑

Install the gem with:

sudo gem install nirvana

Usage¶ ↑

Your browser must have html5 websockets support.

To use, start a websocket server and open nirvana in a tab

# On a mac
$ nirvana

# Everywhere else
$ nirvana | command_to_browser_path

If you close the tab, the path to nirvana’s html page is (for reopening)

$ echo $(dirname $(gem which nirvana))/nirvana/public/index.html

To see what options nirvana takes (mostly options like ripl):

$ nirvana -h

Once you’re in the nirvana web shell, autocompletion should work better than irb’s (argument autocompletion):

>> Bo[TAB]
>> Bond
>> Bond.const[TAB]
   Bond.const_defined?
   Bond.const_get
   Bond.const_missing
   Bond.const_set
   Bond.constants
>> Bond.const_g[TAB]
>> Bond.const_get :Ag[TAB]
>> Bond.const_get :Agent

Also notice that a subset of readline’s functionality is available. Try C-l, C-r or C-p and they should do what readline normally does. For more keybindings, see readline.js.

Customize¶ ↑

Since nirvana uses ripl under the hood, most shell behavior is customizable with ripl plugins which get loaded from ~/.riplrc. See ripl for more.

Bugs/Issues¶ ↑

Please report them on github. For javascript issues, report them on readline.js or repl.js as appropriate.

Credits¶ ↑

License¶ ↑

nirvana is MIT licensed. nirvana comes bundled with other libraries which have the following licenses: jquery (GPL2 and MIT), jquery.hotkeys plugin (no license), repl.js jquery plugin (MIT) and readline.js jquery plugin (MIT).

Todo¶ ↑

  • Tests

  • Easier way to reopen an existing session

  • Load ~/.irb_history into readline.js

  • Customizable html and js

  • Use text area for multi-line input

  • See readline.js and repl.js todos for javascript todos

  • Possible plugins for sinatra and em-websocket-server