kubb-labs / kubb

The ultimate toolkit for working with APIs.
https://kubb.dev
MIT License
670 stars 54 forks source link

Export the `generate` function from `@kubb/cli` for programmatic usage #1057

Closed KXLAA closed 3 months ago

KXLAA commented 3 months ago

What is the problem this feature would solve?

In some scenarios i need to generate SDK's with Kubb with information (which may change) i get from somewhere else, like an array of services and openapi files form an external api. In such cases its hard to defined the kubb.config.ts file before hand. It would be nice if the generate function from the @kubb/cli so it is possible to generate files as part of a larger node script programmatically.

External documents/projects?

Similar to RTK Query here.

What is the feature you are proposing to solve the problem?

No response

What alternatives have you considered?

Generating a fresh kubb.config.ts file for each run.

stijnvanhulle commented 3 months ago

V2.21.2 of @kubb/cli will export 'generate', can you have a look and see if that would fit your needs?