Important
This repository is archived. It represents my initial journey into the Go language and serves as a personal study reference for language fundamentals, concurrency patterns, and CLI architecture.
Go CLI Toolkit is a collection of command-line tools designed to demonstrate advanced concurrency and extreme modularization in Go. It is ideal for daily task automation and rapid distributed environment validation.
This project was built as part of my Go learning path, focusing on:
- Fundamentals: Strong typing, interfaces, and the Standard Go Project Layout.
- Concurrency: Practical use of Goroutines, Channels, and WaitGroups.
- CLI Tooling: Integration with industry-leading frameworks (Cobra and Viper).
- Code Quality: Implementation of unit tests, CI/CD pipelines, and professional documentation.
Check multiple hosts simultaneously with easy-to-read visual status:
tk ping google.com github.com localhost:8080Output:
Starting ping for 3 hosts...
┌────────────┬────────┬────┬─────────┐
│HOST │STATUS │CODE│DETAILS │
├────────────┼────────┼────┼─────────┤
│google.com │ ONLINE │200 │OK │
│github.com │ ONLINE │200 │OK │
│localhost │ OFFLINE│--- │refused │
└────────────┴────────┴────┴─────────┘
Transform messy JSON into readable structures (pretty-print):
echo '{"id":1,"status":"ok"}' | tk format json| Technology | Role |
|---|---|
| Go 1.25 | High-performance language with native concurrency |
| Cobra CLI | Industrial-grade command and subcommand framework |
| Viper | Flexible configuration management (YAML/Env) |
| Lipgloss | Terminal styling and table rendering |
| Testify | Unit testing suite and assertions |
- Go >= 1.25
- Make (optional, for build convenience)
go install github.com/ESousa97/go-cli-toolkit/cmd/tk@latestgit clone https://github.com/ESousa97/go-cli-toolkit.git
cd go-cli-toolkit
make build
make install| Target | Description |
|---|---|
make build |
Compiles the binary locally (tk) |
make test |
Runs the full unit test suite |
make install |
Installs the binary to your $GOPATH/bin |
make clean |
Removes build artifacts and temporary files |
make run |
Executes the CLI in fast-compile mode |
The project follows the Standard Go Project Layout, separating responsibilities between cmd/ and internal/.
The ping command utilizes the Fan-out model to dispatch HTTP requests in isolated Goroutines, synchronized by a sync.WaitGroup and collected via a thread-safe channel.
graph LR
User --> CLI[Cobra Command]
CLI --> Manager[Ping Manager]
Manager --> W1[Worker Goroutine]
Manager --> W2[Worker Goroutine]
Manager --> W3[Worker Goroutine]
W1 & W2 & W3 --> Results[Result Channel]
Results --> UI[Lipgloss Table]
Detailed documentation for interfaces and types is available at pkg.go.dev/github.com/ESousa97/go-cli-toolkit.
The system uses config.yaml to persist user preferences.
| Key | Description | Type | Default |
|---|---|---|---|
hosts |
List of favorite URLs for the ping command | []string |
[] |
Milestones achieved during development:
- Phase 1: Foundation — Cobra structure + initial
pingcommand. - Phase 2: Data Manipulation —
format jsonsubcommand with stdin support. - Phase 3: Performance — Refactoring for concurrency (Goroutines/Channels).
- Phase 5: Governance and Documentation (Complete)
- Professional doc suite (README, CONTRIBUTING, LICENSE).
- Godoc documentation (100% export coverage).
- GitHub Actions (CI) and Quality Badges.
Note
This project is archived. New Pull Requests are not being reviewed at this time, but feel free to Fork the code for your own studies.
This project is licensed under the MIT License — see the LICENSE file for details.
