Schniz / cmd-ts

💻 A type-driven command line argument parser
https://cmd-ts.now.sh
MIT License
232 stars 24 forks source link

allow `subcommands` to be built/executed lazily #173

Open Schniz opened 2 years ago

Schniz commented 2 years ago

Something like:

  1. dynamic command implementations will allow to lazily load the dependency tree instead of forcing cmd-ts apps to be imported sync

    subcommands({
     cmds: { hello: async () => (await import('./my-command')).cmd }
    })
  2. async functions for the different commands can allow to lazily bootstrap the CLI

    subcommands({
     cmds: () => Promise.resolve({ hello: ... })
    })
  3. mixing them both can allow extremely dynamic applications 😮