glTF-Transform
glTF-Transform copied to clipboard
Support user-specified commands and extensions in CLI
For example, accept a folder path as a global option, or use ~/.gltf-transform
. Ideally it load scripts in that folder and let them add new commands to the CLI by accessing the program
variable, or register custom extensions to enable support in existing commands.
Examples:
# custom command
gltf-transform fooBar input.glb output.glb --plugins <plugin-path>
# custom extension
gltf-transform draco input.glb output.glb --plugins <plugin-path>
program.option('-p, --plugins <path>', 'Plugin directory path.', {
global: true,
default: '~/.gltf-transform',
});
Vue CLI uses naming conventions to resolve plugins: https://cli.vuejs.org/dev-guide/plugin-dev.html#naming-and-discoverability. The code looks a bit complicated, though.