cmd-ts icon indicating copy to clipboard operation
cmd-ts copied to clipboard

allow `subcommands` to be built/executed lazily

Open Schniz opened this issue 2 years ago • 0 comments

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 😮

Schniz avatar Jun 16 '22 12:06 Schniz