I'm writing a CLI using Heroku's CLI framework oclif. It works great, but I would like to have Git-like subcommands, something like that:
$ mycli mycommand subcommand
$ mycli mycommand subcommand --flags="are awesome"
$ mycli mycommand another-subcommand --name="John Doe"
I've gone through the docs but I couldn't find any information related to command structure, layout, hierarchy, etc. I could write mycommand
as a normal command and have a switch on argv's first argument, but my subcommands accept different flags, so I lose oclif's ability to report some help when someone runs mycli help mycommand
.
So, my question is: what is the best way to create subcommands using oclif?