Package: easy-menu
Super Simple Terminal Command Launcher GeneratorFeaturesSimplify your daily terminal operations!Do you have any routine tasks such as login to your servers, deploying, troubleshooting or something like that?This small tool would help to speed up your operations and prevent human errors.
It should be helpful not only for salted engineers but unskilled operators.DependenciesPython: 2.6 / 2.7 / 3.2 / 3.3 / 3.4 / 3.5pyyamlsixjinja2 == 2.6mog-commonsQuickstartYou can try Easy Menu by just two command lines.pip install easy-menu
easy-menu http://git.io/vGWlaNote:http://git.io/vGWlawill redirect tohttps://raw.githubusercontent.com/mogproject/easy-menu/master/easy-menu.example.ymlInstallationpipcommand may needsudoOperationCommandInstallpip installeasy-menuUpgradepip install--upgradeeasy-menuUninstallpip uninstalleasy-menuCheck installed versioneasy-menu--versionHelpeasy-menu-hThen, write your configuration to the fileeasy-menu.yml.See an example below.Configuration Exampleeasy-menu.example.yml:Main Menu:
  - Service health check: "echo Condition all green!"
  - Check hardware resources: "echo Hardware resources OK."
  - Server Login Menu:
    - Login to server-1: "echo logging into server-1"
    - Login to server-2: "echo logging into server-2"
    - Login to server-3: "echo logging into server-3"
  - Web Service Management Menu:
    - Check the status of web service: "echo Check web service status"
    - Start web service: "echo Start web service"
    - Stop web service: "echo Stop web service"
  - Reboot this server: "echo Reboot OS"Each menu (i.e. root menu and sub menu) and each item is represented asMappingwhich contains just one key-value pair.
In case its value is aSequence, the sub menu will be generated.The general syntax is like this.meta:                            # Some meta variables are available
  META_KEY: META_VALUE

ROOT_MENU_TITLE:
  - ITEM_DESCRIPTION: COMMAND
  - ITEM_DESCRIPTION: COMMAND
  - SUB_MENU_TITLE:              # You can create sub menu if you need.
    - ITEM_DESCRIPTION: COMMAND
    - ITEM_DESCRIPTION: COMMAND
    - SUB_MENU_TITLE:            # More nested menu
      - ITEM_DESCRIPTION: COMMAND
      - ITEM_DESCRIPTION: COMMAND
  - ITEM_DESCRIPTION:            # You can write a list of command lines for one item.
      - COMMAND1
      - COMMAND2
      - COMMAND3
  - include: INCLUDE_FILE_PATH   # "include" keyword enables to load
                                 #   another configuration file.
  - eval: COMMAND                # "eval" keyword will execute command line
                                 #   and use its output as configuration YAML string.Remember these commands are executed after changing the current directory to the directory which holds the configuration file by default.You can find more examples inthis directory.Lookup PathSimilar toVagrant, when you run anyeasy-menucommand, Easy Menu climbs up the directory tree looking for the firsteasy-menu.ymlit can find, starting first in the current directory.
So if you runeasy-menuin/home/mogproject/projects/foo, it will search the following paths in order for aeasy-menu.yml, until it finds one:/home/mogproject/projects/foo/easy-menu.yml
/home/mogproject/projects/easy-menu.yml
/home/mogproject/easy-menu.yml
/home/easy-menu.yml
/easy-menu.ymlThis feature lets you runeasy-menufrom any directory in your project.You can change default name of the configuration file by setting theEASY_MENU_CONFIGenvironmental variable to some other name.Audit LoggingAnytime you execute the command, the result (return code) will be recorded to the syslog facility in your operating system.
This feature is not available on Windows OS.Example:Aug 31 00:09:59 ullr.local easy-menu[28802]: [INFO] Command started: echo Condition all green!
Aug 31 00:09:59 ullr.local easy-menu[28802]: [INFO] Command ended with return code: 0Go furtherNeed more help?Advanced ConfigurationTroubleshootingAdd issueLooking for legacy version? Please refer tov0.0.