Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Junos-like shell library for Python

Project description

Build Status Code Health Badge Documentation Status Version Badge License Badge

JSH is a Junos-inspired CLI library for your Python apps. If you’ve ever logged into a Junos device, you’ll know how good the CLI is. It offers:

  • tab-completion, including completion of names of items in the config
  • help by pressing “?” at any point
  • completion on pressing either space, tab or enter

JSH attempts to reproduce some of these features (and others) in a Python library based on Readline, to allow you to build better quality CLIs for your apps.


Full documentation can be found at RTD.


Install from PyPI using pip install jsh.

Basic Usage

The library takes a CLI “layout”, which is a dictionary-based tree structure describing your CLI commands. For example, a completely useless CLI with just an exit command, you would define it like this:

import jsh

layout = {
    'exit': jsh.exit,
} is a shortcut for the following:

cli = jsh.JSH(layout)

while True:
    except jsh.JSHError as err:
        print err
    except EOFError:

This creates a basic layout with a single available command (exit), passes it to an instance jsh.JSH, and starts an infinite loop, using the read_and_execute method of the JSH CLI object to interact with the user. For more control over this loop, you should write your own instead of using

This provides a CLI that looks like the following:

> ?
Possible completions:
> ex?
Possible completions:
> exit ?
Possible completions:
  <[Enter]>   Execute this command
> exit

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
jsh-0.3.6-py2-none-any.whl (8.1 kB) Copy SHA256 hash SHA256 Wheel py2 Aug 19, 2015
jsh-0.3.6-py3-none-any.whl (8.1 kB) Copy SHA256 hash SHA256 Wheel py3 Aug 19, 2015
jsh-0.3.6.tar.gz (10.0 kB) Copy SHA256 hash SHA256 Source None Aug 19, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page