Skip to content

go-cli-simple

A simple Go CLI application package built with Go and Cobra. It has a single root command that prints "Hello there!".

  • Cobra CLI Integration: Built using the industry-standard Cobra CLI library.
  • Justfile Integration: Out-of-the-box support for building, running, and testing commands using Just.
  • Fully Tested: Includes unit tests for the root command.

To compile and run the CLI application:

Terminal window
just build-run

To run the unit tests:

Terminal window
just test

Running the built binary executes the root command:

Terminal window
$ ./bin/go-cli-simple
Hello there!
.
├── cmd/
│ └── go-cli-simple/
│ ├── main.go # Entry point for the application
│ ├── main_test.go # Tests verifying CLI runs
│ ├── root.go # CLI command definitions
│ └── root_test.go # Tests verifying CLI command outputs
├── go.mod # Go module definition
├── go.sum # Go module dependency checksums
└── justfile # Automation tasks (build, test, run)
## Installation
See [INSTALL.md](file:///home/devy/Projects/clis/go-cli-simple/INSTALL.md) for installation options.