3.0.4 • Published 8 years ago

commander-shepard v3.0.4

Weekly downloads
9
License
MIT
Repository
github
Last release
8 years ago

Commander Shepard

Framework for developing node CLI.

yarn add commander-shepard --save

Usage

import { Commander, Command } from 'commander-shepard'

const commander = new Commander({
  key: 'commander',
  package: require('../package.json'),
  handler: ({ commands }) => {
    // do something
  },
  flags: [
    {
      required: true,
      keys: ['f', 'foo-flag'],
      description: 'f flag description',
    },
  ],
  commands: [
    {
      required: true,
      key: 'foo argument',
      description: 'required first arg',
    },
  ],
})

const fooSubcommand = new Command({
  handler: async ({ commands }) => {
    // do something
  },
})
fooSubcommand.use('bar', new Command({
  handler: ({ commands }) => {
    // do something
  },
}))
commander.use('foo', fooSubcommand)

commander.start()
.catch((e) => {
  console.error('error', e.message)
})
3.0.4

8 years ago

3.0.3

9 years ago

3.0.2

9 years ago

2.0.10

9 years ago

2.0.9

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.3

9 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.13

10 years ago

1.1.12

10 years ago

1.1.11

10 years ago

1.1.10

10 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago