All Projects → italorossi → ishell

italorossi / ishell

Licence: MIT License
Create shell environments with Python

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to ishell

WeConsole
功能全面、界面与体验对标 Chrome devtools 的可定制化的小程序开发调试面板
Stars: ✭ 137 (+95.71%)
Mutual labels:  console
circumflex
🌿 It's Hacker News in your terminal
Stars: ✭ 43 (-38.57%)
Mutual labels:  console
command-line
⌨ Command line options and arguments parser.
Stars: ✭ 35 (-50%)
Mutual labels:  console
pyeez
easy elegant representation on console
Stars: ✭ 14 (-80%)
Mutual labels:  console
asa cleanup
Cisco ASA Firewall Cleanup Script.
Stars: ✭ 40 (-42.86%)
Mutual labels:  cisco
genielibs
genie.libs contains libraries for configuring, retrieving and testing topologies
Stars: ✭ 80 (+14.29%)
Mutual labels:  cisco
contour
Modern C++ Terminal Emulator
Stars: ✭ 761 (+987.14%)
Mutual labels:  console
xrgrpc
gRPC library for Cisco IOS XR
Stars: ✭ 40 (-42.86%)
Mutual labels:  cisco
solutions examples
pyATS example solutions for NetDevOps use cases
Stars: ✭ 59 (-15.71%)
Mutual labels:  cisco
ctable
C library to print nicely formatted tables
Stars: ✭ 13 (-81.43%)
Mutual labels:  console
preact-component-console
A console emulator for preact.
Stars: ✭ 29 (-58.57%)
Mutual labels:  console
Cisco2Checkpoint
Tool that assists in migrating firewall rules from Cisco to Checkpoint. Will optimize rules for you (rationalization, reuse merging, etc.).
Stars: ✭ 19 (-72.86%)
Mutual labels:  cisco
slim-command
Useful commands for slim application
Stars: ✭ 13 (-81.43%)
Mutual labels:  console
fireREST
Python library for interacting with Cisco Firepower Management Center REST API
Stars: ✭ 47 (-32.86%)
Mutual labels:  cisco
ascii chart
Nice-looking lightweight console ASCII line charts ╭┈╯. Port of kroitor/asciichart.
Stars: ✭ 24 (-65.71%)
Mutual labels:  console
RecoverPy
🙈 Interactively find and recover deleted or 👉 overwritten 👈 files from your terminal
Stars: ✭ 189 (+170%)
Mutual labels:  console
merlin
Network Magic: Transforming the CLI and REST API using Infrastructure As Code automation
Stars: ✭ 50 (-28.57%)
Mutual labels:  cisco
cmdr
POSIX-compliant command-line UI (CLI) parser and Hierarchical-configuration operations
Stars: ✭ 94 (+34.29%)
Mutual labels:  console
yii-console
Yii console components
Stars: ✭ 48 (-31.43%)
Mutual labels:  console
ciscoaxl
Python SDK for Cisco CUCM AXL API
Stars: ✭ 51 (-27.14%)
Mutual labels:  cisco

ishell

PyPI version Travis Downloads

Create an interactive shell with Python.

ishell helps you to easily create an interactive shell for your application. It supports command completion, dynamic arguments, a command history, and chaining of commands.

Cisco like console

Installation

You can install ishell using pip:

pip install ishell

Basics

Console

When building your first application you can start with one console. You can specify the prompt and prompt delimiter:

from ishell.console import Console
console = Console(prompt="someone@someplace ", prompt_delim="#")
console.loop()

Then you have:

Console

Command

The next step is to create a new command and attach it to the console:

from ishell.console import Console
from ishell.command import Command
console = Console(prompt="someone@someplace ", prompt_delim="#")

class UsersCommand(Command):
    def run(self, line):
        print "Showing all users..."

users_command = UsersCommand("users", help="Show all users")

console.addChild(users_command)
console.loop()

With the users_command attached to the console you can just hit ENTER and a help message will be printed, if you press TAB the users command will be entered and you can hit ENTER again to execute the command:

Users Command

Command Arguments

You can complete commands with dynamic arguments:

from ishell.console import Console
from ishell.command import Command
console = Console(prompt="someone@someplace ", prompt_delim="#")

class UsersCommand(Command):
    def args(self):
        return ['online', 'offline']

    def run(self, line):
        last_arg = line.split()[-1]
        print "Showing all users %s..." % last_arg

users_command = UsersCommand("users", help="Show all users", dynamic_args=True)

console.addChild(users_command)
console.loop()

Users arguments

Connecting Commands

You can connect commands with each other to build a more verbose command line: (Press TAB to complete)

from ishell.console import Console
from ishell.command import Command
console = Console(prompt="someone@someplace ", prompt_delim="#")

class UsersCommand(Command):
    def args(self):
        return ['online', 'offline']

    def run(self, line):
        last_arg = line.split()[-1]
        print "Showing all users %s..." % last_arg

users_command = UsersCommand("users", help="Show all users", dynamic_args=True)

show = Command("show", help="Show command helper")
console.addChild(show).addChild(users_command)
console.loop()

Example: show users [online|offline]

Show Users

  • Check examples directory for cisco like terminal and a linux minimal shell.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].