clish

Command Line Interactive Shell Framework.


Keywords
cli, command, line, shell, framework, readline, console
License
BSD-3-Clause
Install
pip install clish==0.1

Documentation

clish

Documentation Status

Command Line Shell Framework is application framework to create application with shell interactive interface.

#!/usr/bin/python

import os
import time

from clish import Command, Shell


class Application(object):
    def __init__(self):
        self.client = None

    def run(self):
        shell = Shell(banner="Welcome to CLI Shell v0.1", prompt="clish> ")
        shell.run()


def main():
    app = Application()
    app.run()


if __name__ == "__main__":
    main()

This application will return follow interactive console:

Welcome to CLI Shell v0.4

Type "help" at any time for a list of commands.

>>> hello
Unknown command: "hello". Type "help" for a list of commands.

>>> help
The following commands are available:

  exit     Exit the program.

>>> exit