Package: cmd2
cmd2 : immersive interactive command line applicationsDevelper's Toolbox•Philosophy•Installation•Documentation•Tutorials•Hello World•Projects using cmd2•cmd2 is a tool for building interactive command line applications in Python. Its goal is to make it
quick and easy for developers to build feature-rich and user-friendly interactive command line
applications.  It provides a simple API which is an extension of Python's built-incmdmodule.  cmd2 provides a wealth of features on top
of cmd to make your life easier and eliminates much of the boilerplate code which would be necessary
when using cmd.The developers toolboxWhen creating solutions developers have no shortage of tools to create rich and smart user interfaces.
System administrators have long been duct taping together brittle workflows based on a menagerie of simple command line tools created by strangers on github and the guy down the hall.
Unfortunately, when CLIs become significantly complex the ease of command discoverability tends to fade quickly.
On the other hand, Web and traditional desktop GUIs are first in class when it comes to easily discovering functionality.
The price we pay for beautifully colored displays is complexity required to aggregate disperate applications into larger systems.cmd2fills the niche between highease of command discoveryapplications and smart workflow automation systems.Thecmd2framework provides a great mixture of both worlds. Application designers can easily create complex applications and rely on the cmd2 library to offer effortless user facing help and extensive tab completion.
When users become comfortable with functionality, cmd2 turns into a feature rich library enabling a smooth transition to full automation. If designed with enough forethought, a well implemented cmd2 application can serve as a boutique workflow tool.cmd2pulls off this flexibility based on two pillars of philosophy:Tab CompletionAutomation TransitionPhilosophyDeep extensive tab completion and help text generation based on the argparse library create the first pillar of 'ease of command discovery'. The following is a list of features in this category.Great tab completion of commands, subcommands, file system paths, and shell commands.Custom tab completion for user designed commands via simple function overloading.Tab completion frompersistent_history_filesources added with very little friction.Automatic tab completion ofargparseflags and optional arguments.Path completion easily enabled.When all else fails, custom tab completion based onchoices_providercan fill any gaps.cmd2 creates the second pillar of 'ease of transition to automation' through alias/macro creation, command line argument parsing and execution of cmd2 scripting.Flexible alias and macro creation for quick abstraction of commands.Text file scripting of your application withrun_script(@) and_relative_run_script(@@)Powerful and flexible built-in Python scripting of your application using therun_pyscriptcommandTranscripts for use with built-in regression can be automatically generated fromhistory -torrun_script -tInstallationOn all operating systems, the latest stable version ofcmd2can be installed using pip:pipinstall-Ucmd2cmd2 works with Python 3.6+ on Windows, macOS, and Linux. It is pure Python code with few 3rd-party dependencies.For information on other installation options, seeInstallation Instructionsin the cmd2
documentation.DocumentationThe latest documentation for cmd2 can be read online here:https://cmd2.readthedocs.io/en/latest/It is available in HTML, PDF, and ePub formats.The best way to learn the cmd2 api is to delve into the example applications located in source under examples.TutorialsPyOhio 2019 presentation:videoslidesexample codeCookiecutterTemplates from communityBasic cookiecutter template for cmd2 application :https://github.com/jayrod/cookiecutter-python-cmd2Advanced cookiecutter template with external plugin support :https://github.com/jayrod/cookiecutter-python-cmd2-ext-plugExample ApplicationsHello World#!/usr/bin/env python"""A simple cmd2 application."""importcmd2classFirstApp(cmd2.Cmd):"""A simple cmd2 application."""defdo_hello_world(self,_:cmd2.Statement):self.poutput('Hello World')if__name__=='__main__':importsysc=FirstApp()sys.exit(c.cmdloop())Found a bug?If you think you've found a bug, please first read through the openIssues. If you're confident it's a new bug, go ahead and create a new GitHub issue. Be sure to include as much information as possible so we can reproduce the bug.  At a minimum, please state the following:cmd2versionPython versionOS name and versionWhat you did to cause the bug to occurInclude any traceback or error message associated with the bugProjects using cmd2Application NameDescriptionJok3rNetwork & Web Pentest Automation FrameworkCephFS ShellCephis a distributed object, block, and file storage platformpsiTurkAn open platform for science on Amazon Mechanical TurkPoseidonLeverages software-defined networks (SDNs) to acquire and then feed network traffic to a number of machine learning techniques.UnipackerAutomatic and platform-independent unpacker for Windows binaries based on emulationtomcatmanagerA command line tool and python library for managing a tomcat serverExpliotInternet of Things (IoT) exploitation frameworkmptcpanalyzerTool to help analyze mptcp pcapsclanvasCommand-line client for Canvas by InstructurePossibly defunct but still good examplesJSShellFLASHMINGO