🏃 Transform NPM package scripts into simple CLIs
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.npmignore
CHANGELOG.md
CONTRIBUTING.md
README.md
circle.yml
index.js
package.json
test.js

README.md

lope-cli | Transform NPM package scripts into simple CLIs

version versioning branching styling paradigm build

Transform NPM package scripts into simple CLIs. Optionally, tap into NPM configs to pass options to said scripts. Check out lope-example for a basic package.json example.

Install

$ npm install --global lope-cli

Usage

$ lope --help
Transform NPM package scripts into simple CLIs

Usage:
  $ lope [package] <script> [--* <*>]

Options:
  --global, -g  Indicates package is installed globally

Examples:
  $ # Run the test script against current package
  $ lope test

  $ # Run the test script against local package
  $ lope lope-example test

  $ # Run the test script against global package
  $ lope lope-example test --global

  $ # Run the echo script, with options, against current package
  $ lope echo --echo hello

  $ # Run the echo script, with options, against local package
  $ lope lope-example echo --echo hello

  $ # Run the echo script, with options, against global package
  $ lope lope-example echo --echo hello --global

Against local package via the command line:

$ npm install lope-example
$ lope lope-example test
$ lope lope-example echo --echo hello
hello

Against local package, leveraging npm config, via the command line:

$ npm install lope-example
$ npm config set lope-example:echo hello
$ lope lope-example test
$ lope lope-example echo
hello

Against local package via NPM script:

{
  "devDependencies": {
    "lope-cli": "0.0.x",
    "lope-example": "0.0.x"
  },
  "scripts": {
    "echo": "lope lope-example echo --echo hello",
    "test": "lope lope-example test"
  }
}
$ npm run test
$ npm run echo
hello

Against global package via the command line:

$ npm install --global lope-example
$ lope lope-example test --global
$ lope lope-example echo --echo hello --global
hello

Against global package, leveraging npm config, via the command line:

$ npm install --global lope-example
$ npm config set lope-example:echo hello
$ lope lope-example test --global
$ lope lope-example echo --global
hello

Against current package via the command line:

{
  "scripts": {
    "echo": "echo ${npm_package_config_echo}",
    "test": "true"
  }
}
$ lope test
$ lope echo --echo hello
hello

Against current package via NPM script:

{
  "devDependencies": {
    "lope-cli": "0.0.x"
  },
  "scripts": {
    "echo": "echo ${npm_package_config_echo}",
    "echo2": "lope echo --echo hello"
  }
}
$ npm run echo2
hello

Maintainers