recently, when I looked at the vue-cli 2.9.0 source code, I saw that some instructions were defined in the vue file under the bin file
-sharp!/usr/bin/env node
require("commander")
.version(require("../package").version)
.usage("<command> [options]")
.command("init", "generate a new project from a template")
.command("list", "list available official templates")
.command("build", "prototype a new project")
.parse(process.argv)
there are also vue-init, vue-list and other files in the bin folder.
I would like to ask why, after defining the init instruction in commander, you can type the vue init instruction on the command line to execute the code in vue-init. This is what kind of implementation principle, or npm did it for us.