COBRA-INIT(1)
π COBRA-INIT π
okay so bestie, welcome to cobra-init</c> β it's a page from the Cobra Manual and it's literally about spinning up a whole new Cobra application from scratch. no cap. πβ¨
πΈ NAME πΈ
cobra-init β Initialize a Cobra Application π
β¨ SYNOPSIS β¨
cobra init [OPTIONS]
that's it. that's the whole vibe. π«Ά
π¦ DESCRIPTION π¦
so cobra init (cobra init, yes the same thing, they're twins) creates a brand new application for u β complete with a license and the whole appropriate structure for a Cobra-based CLI application. it's giving scaffolding. it's giving "i got u bestie". π
here's the tea on where ur new baby app ends up:
- π if a name is provided, it will be created in the current directory;
- π if no name is provided, the current directory will be assumed;
- π if a relative path is provided, it will be created inside
$GOPATH(e.g.github.com/spf13/hugo); - π if an absolute path is provided, it will be created;
- π if the directory already exists but is empty, it will be used.
π ok important one: Init will not use an existing directory with contents. like, at all. don't even try it. it said no. π
π OPTIONS INHERITED FROM PARENT COMMANDS π
these aren't even cobra-init's own flags, they're inherited from the parent commands, but they still ate and u still need them:
-a,--author="YOUR NAME"β author name for copyright attribution βοΈ (yes, put ur actual name in there, main character)--config=""β config file, and the default is$HOME/.cobra.yamlποΈ-l,--license=""β name of license for the project, and you can providelicensetextin config π-b,--projectbase=""β base project directory, e.g.github.com/spf13/ποΈ--viper[=true]β use Viper for configuration πβ¨
π SEE ALSO π
github.com/spf13/cobra Β· Dec 2015
okay that's the whole page bestie, go forth and cobra init something iconic. periodt. ππ¦β¨π
π¦ where this page comes from
- ubuntu jammy: cobra 1.3.0-1 Β· Apache-2.0
- ubuntu jammy: cobra 1.3.0-1ubuntu0.3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms