meow-with-subcommands
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

meow-with-subcommands

Helper for handling subcommands with meow

npm version npm downloads js-semistandard-style Module type: ESM Types in JS Follow @voxpelli@mastodon.social

Usage

Basic

import { meowWithSubcommands } from 'meow-with-subcommands';

await meowWithSubcommands(
  {
    foo: {
      description: 'Do something very foo-like',
      async run (argv, importMeta, { parentName }) {
        // Do whatever you like, eg. initiate a new meow or meow-with-subcommands
      }
    }
  },
  {
    aliases: {
      fs: {
        description: 'Alias for "foo --strict"',
        argv: ['foo', '--strict']
      },
    },
    argv: process.argv.slice(2),
    name: 'name-of-cli',
    importMeta: import.meta
  }
)

Complete

See example-folder

API

meowWithSubcommands(commands, { [aliases], argv, name, ...meowOptions }) => Promise<void>

prepareFlags

printFlagList

printHelpList

Extracted from

  • SocketDev/socket-cli-js – I found the pattern I created for this open source CLI to be quite helpful and wanted to reuse it

See also

Readme

Keywords

none

Package Sidebar

Install

npm i meow-with-subcommands

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

23.5 kB

Total Files

20

Last publish

Collaborators

  • voxpelli