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

Add CLI interface #183

Open
henhal opened this issue Jan 19, 2022 · 3 comments · May be fixed by #184
Open

Add CLI interface #183

henhal opened this issue Jan 19, 2022 · 3 comments · May be fixed by #184
Labels
enhancement New feature or request

Comments

@henhal
Copy link

henhal commented Jan 19, 2022

It would be nice if this tool had a simple CLI interface such as

$ npx joi-to-typescript --schema-dir ./schemas --output-dir ./types --sort-by-name

I use this great tool in many projects, and I usually end up wrapping it in a simple file which simply calls convertFromDirectory() with my directories as parameters, and adding that wrapper file seems a bit redundant really.

Would a PR for this be of interest? If so, any preference on CLI helpers - meow? Any thoughts on syntax? To me, the most relevant usage is to convert a directory of schema files and store the generated files in another directory, as per the example above. And options should be fairly straight-forward. Would this be sufficient or is there a need for e.g. converting a single schema file etc?

@mrjono1
Copy link
Owner

mrjono1 commented Jan 20, 2022

A cli for this tool would be great, I've thought about it a few times, but never spent the time to finish figuring it out.

If you have a go at it that would be great, I am open to Pull Requests

@henhal henhal linked a pull request Jan 20, 2022 that will close this issue
@henhal
Copy link
Author

henhal commented Jan 20, 2022

Thanks @mrjono1. I whipped up a PR.

@mrjono1 mrjono1 added the enhancement New feature or request label May 1, 2022
@throrin19
Copy link

Any news about that MR ?

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

Successfully merging a pull request may close this issue.

3 participants