Skip to content
arg and flag parser for oclif
Branch: master
Clone or download
Latest commit b420f0f Mar 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci chore: add node-10 CI target Dec 18, 2018
test fix: ignore defaulted flags for exclusivity Mar 15, 2019
.eslintrc fix: rename to oclif Feb 13, 2018
.gitignore v3.7.3 Mar 15, 2019
LICENSE docs: Add LICENSE Feb 15, 2018 fix: remove greenkeeper badge Oct 13, 2018
appveyor.yml fix: typescript 2.9 (#26) May 31, 2018
package.json v3.7.3 Mar 15, 2019
yarn.lock chore: remove semantic-release Dec 18, 2018


arg and flag parser for oclif

Version CircleCI Appveyor CI Codecov Known Vulnerabilities Downloads/week License

CLI flag parser.


const CLI = require('cli-flags')

const {flags, args} = CLI.parse({
  flags: {
    'output-file': CLI.flags.string({char: 'o'}),
    force: CLI.flags.boolean({char: 'f'})
  args: [
    {name: 'input', required: true}

if (flags.force) {
  console.log('--force was set')

if (flags['output-file']) {
  console.log(`output file is: ${flags['output-file']}`)

console.log(`input arg: ${args.input}`)

// $ node example.js -f myinput --output-file=myexample.txt
// --force was set
// output file is: myexample.txt
// input arg: myinput
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.