Cobra init can also be run from a subdirectory such as how the [cobra generator itself is organized](https://github.com/spf13/cobra).
This is useful if you want to keep your application code separate from your library code.
#### Optional flags:
You can provide it your author name with the `--author` flag.
e.g. `cobra init --author "Steve Francia spf@spf13.com"`
You can provide a license to use with `--license`
e.g. `cobra init --license apache`
Use the `--viper` flag to automatically setup [viper](https://github.com/spf13/viper)
Viper is a companion to Cobra intended to provide easy handling of environment variables and config files and seamlessly connecting them to the application flags.
### Add commands to a project
Once a cobra application is initialized you can continue to use cobra generator to
add additional commands to your application. The command to do this is `cobra add`.
`cobra add` supports all the same optional flags as `cobra init` does mentioned above.
You'll notice that this final command has a `-p` flag. This is used to assign a
parent command to the newly added command. In this case, we want to assign the
"create" command to the "config" command. All commands have a default parent of rootCmd if not specified.
By default `cobra` will append `Cmd` to the name provided and uses this to name for the internal variable name. When specifying a parent, be sure to match the variable name used in the code.
You now have a basic Cobra-based application up and running. Next step is to edit the files in cmd and customize them for your application.
For complete details on using the Cobra library, please read the [The Cobra User Guide](https://github.com/spf13/cobra/blob/master/user_guide.md#using-the-cobra-library).