You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue proposes a new, Cobra-style CLI and a project layout that goes with it.
The Proposed Design
Right now, this is the recommended Nirvana project layout:
.
├── bin # binaries reside within project directories
│ └── nirvana-myproject #
├── build # Dockerfiles reside within project directories
│ └── nirvana-myproject #
│ └── Dockerfile #
├── cmd # main packages reside within project directories
│ └── nirvana-myproject #
│ └── main.go #
├── pkg # packages
│ ... # other stuff
This encourages the user to build multiple binaries and house them within multiple container images. The CLI of each binary would support different flags and args.
With Cobra, however, encourage the use of command in support of flags and args. Basically, instead of this:
.
├── cmd # cmd package keeps all the commands
│ └── init.go # sub command init
│ └── serve.go # sub command serve
│ └── operate.go # sub command operate
├── pkg # packages
├── Dockerfile # only one Dockerfile
├── main.go # only one main package located at the project root
├── project_bin # only one binary
│ ... # other stuff
Why Bother?
Fewer steps during CICD. Only one binary and one Dockerfile.
Easier delivery and version management. You could send someone an image, only to find out later that they need more, and have to send them more, and have to worry about if they have the compatible versions.
Easier to learn. Cobra-style project layout and CLI are already massively popular, being adopted by Docker, Kubernetes, and many popular open-source projects. Why should we do things differently?
Nirvana CLI is based on Cobra anyway, so why don't we focus on its core functionality and just use Cobra as it is?
/kind design
/area cli
This issue proposes a new, Cobra-style CLI and a project layout that goes with it.
The Proposed Design
Right now, this is the recommended Nirvana project layout:
This encourages the user to build multiple binaries and house them within multiple container images. The CLI of each binary would support different flags and args.
With Cobra, however, encourage the use of command in support of flags and args. Basically, instead of this:
Cobra would do this:
And the project layout would look like this:
Why Bother?
/cc @ddysher @iawia002 @supereagle
The text was updated successfully, but these errors were encountered: