View on GitHub

batman-cli

batman-cli is an advance command runner tool. Easy to maintain command runner. Easy to config via external json or js

batman-cli

batman-cli is an advance command runner tool. Easy to maintain command runner. Easy to config via external json or js. Cross-platform cli tool, same command can be run on both window and unix based systems.

How to install

# As a global module
npm i -g batman-cli
####################
# As a local module
npm i batman-cli --save-dev

Prerequisite:

  1. As global module Install as global module, and simply use
    batman run e2e:cucumber
    # This will read your batman command config, parse batman commands
    # Once found e2e:cucumber, will execute.
    
  2. As local module, using npm Install as local module, and simply configure package.json
    //package.json
    {
     //...rest of the prop
      "scripts": {
     "batman": "batman",
     "e2e:cucumber": "batman run e2e:cucumber"
      },
      "batman" : { 
     //Super configuration here
      }
    }
    
    # Run using npm
    npm run e2e:cucumber
    # This will read your config, parse batman commands
    # Once found e2e:cucumber, will execute.
    

    Advance config

    All the options and env supports enviroment variables, So user can replace value using $Enviroment variable

    //Example
    "e2e:cucumber": { //command name that batman will refer
     "command": "ng e2e", //actual command that batman will execute
     "desc": "Run e2e with cucumber", //description
     "params": [], //extra params user want to pass with command, like. --prod
     "envs": ["TEST=ENV", "TEST2=$MOCK"], //enviroment variables, it can take enviroment variable to build envs
     "options": { //options requires by actual command ex. ng
         "--serve": false,
         "--config": "./e2e/config/protractor.cucumber.conf.js",
         "-wu": "false"
     }
     }
    

    Other commands

    • List Command
      batman list #List commands only batman configured
      batman list --npm #List all commands including local npm script
      

Release Note:

v1.1.2: