Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow subcommands to be built/executed lazily #173

Open
Schniz opened this issue Jun 16, 2022 · 0 comments
Open

allow subcommands to be built/executed lazily #173

Schniz opened this issue Jun 16, 2022 · 0 comments

Comments

@Schniz
Copy link
Owner

Schniz commented Jun 16, 2022

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 😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant