Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

ESousa97/go-cli-toolkit

Go CLI Toolkit

Essential network and data utilities in a robust, concurrent, and extensible CLI.

Go CLI Toolkit Banner

CI Go Report Card CodeFactor Go Reference License Go Version Last Commit


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.

Repository Purpose

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.

Demonstration

Concurrent Ping

Check multiple hosts simultaneously with easy-to-read visual status:

tk ping google.com github.com localhost:8080

Output:

Starting ping for 3 hosts...

┌────────────┬────────┬────┬─────────┐
│HOST        │STATUS  │CODE│DETAILS  │
├────────────┼────────┼────┼─────────┤
│google.com  │ ONLINE │200 │OK       │
│github.com  │ ONLINE │200 │OK       │
│localhost   │ OFFLINE│--- │refused  │
└────────────┴────────┴────┴─────────┘

JSON Formatter

Transform messy JSON into readable structures (pretty-print):

echo '{"id":1,"status":"ok"}' | tk format json

Tech Stack

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

Prerequisites

  • Go >= 1.25
  • Make (optional, for build convenience)

Installation and Usage

As a binary

go install github.com/ESousa97/go-cli-toolkit/cmd/tk@latest

From source

git clone https://github.com/ESousa97/go-cli-toolkit.git
cd go-cli-toolkit
make build
make install

Makefile Targets

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

Architecture

The project follows the Standard Go Project Layout, separating responsibilities between cmd/ and internal/.

Concurrency Strategy

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]
Loading

API Reference

Detailed documentation for interfaces and types is available at pkg.go.dev/github.com/ESousa97/go-cli-toolkit.

Configuration

The system uses config.yaml to persist user preferences.

Key Description Type Default
hosts List of favorite URLs for the ping command []string []

Roadmap (Historical)

Milestones achieved during development:

  • Phase 1: Foundation — Cobra structure + initial ping command.
  • Phase 2: Data Manipulationformat json subcommand 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.

Contributing

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.

License

This project is licensed under the MIT License — see the LICENSE file for details.

Author

Enoque Sousa

LinkedIn GitHub Portfolio

⬆ Back to top

Made with ❤️ by Enoque Sousa

Project Status: Archived (Study Reference)

About

54 - Network & data CLI toolkit built in Go with concurrent ping and JSON formatting.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors