I'm in the process of building some tools but find myself thinking I'm reinventing the wheel. I'm looking for a cli, preferably written in javascript, that has a config file and template engine. The config file would let you specify projects and features and have a path option that would point to the template(s) and create the files/folders at the path specified by the config, or current working directory. Ideally it would not overwrite folders or files that were pre-existing and would handle such cases gracefully.
I started building something like this using oclif for the cli framework. So the responses I get here will determine if I continue that work or save some time by using something that may be more polished. The example below is react, but I would want to use such a tool for Laravel, Vue, Vulcan, etc...
In the end it doesn't matter how it works but here is an example of a possible solution.
config.js
const commands = {
react: {
functionalComponent: {
argName: 'fc',
template: '/templates/react/fc.hbs'
}
}
}
// console
$ cd ./my-project/src/components
$ gen react -fc