3.0.4 • Published 6 years ago

commander-shepard v3.0.4

Weekly downloads
9
License
MIT
Repository
github
Last release
6 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

6 years ago

3.0.3

7 years ago

3.0.2

7 years ago

2.0.10

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago