Using the Cobra Generator

Cobra provides its own program that will create your application and add any
commands you want. It’s the easiest way to incorporate Cobra into your application.

Here you can find more information about it.