COBRA-INIT(1)

πŸ“¦ version 1.3.0, in ubuntu jammy

πŸ’– 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 provide licensetext in 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