A comprehensive collection of CLI, TUI, and utility tools written in Go with modern development practices.
This project serves as a modern Go toolbox containing various utilities and applications built with Go 1.24+. It demonstrates enterprise-level CI/CD practices, comprehensive testing, security scanning, and cross-platform builds. The toolbox provides both individual tool binaries and a unified embedded binary for maximum flexibility.
# Clone the repository
git clone https://github.com/Velvet-Labs-LLC/go-toolbox.git
cd go-toolbox
# Install dependencies
go mod download
# Build all tools
make build
# Option 1: Use the unified embedded binary (recommended)
./bin/embedded --help # CLI mode (default)
./bin/embedded tui # TUI mode
./bin/embedded serve ./docs # Server mode
# Option 2: Use individual tool binaries
./bin/cli-main --help # Main CLI tool
./bin/tui-main # TUI application
./bin/cli-serve ./docs --port 8080 # File server| Metric | Status |
|---|---|
| Build | |
| Tests | |
| Security | |
| Performance | |
| Linting | |
| Go Version | |
| Platforms |
embedded- Unified binary combining all tools into one executable- CLI Mode: Default mode with all CLI functionality
- TUI Mode: Interactive terminal user interface (
embedded tui) - Server Mode: HTTP file server (
embedded serve [directory])
cli-main- Main CLI application with multiple utilities and sub-commandscli-serve- HTTP file server for local network sharing (docs)tui-main- Interactive terminal application with tool generation capabilitiescmd-unified- Alternative unified binary implementation
- File hash calculation (MD5, SHA256)
- File information and metadata
- File permission management
- Host ping functionality
- Port scanning
- HTTP file server with TLS support
- System details and specifications
- Process listing and monitoring
- Resource usage tracking
- Code template generation
- String manipulation utilities
- Random data generation
- Configuration management
go-toolbox/
βββ cmd/ # Applications (builds to bin/)
β βββ cli/ # Command-line tools
β β βββ main/ # β cli-main binary
β β βββ serve/ # β cli-serve binary
β βββ tui/ # Terminal UI applications
β β βββ main/ # β tui-main binary
β βββ unified/ # β cmd-unified binary (alternative)
β βββ embedded/ # β embedded binary (recommended)
βββ internal/ # Private application code
β βββ cli/ # CLI framework and utilities
β βββ config/ # Configuration management (Viper)
β βββ generator/ # Code/tool generation utilities
β βββ logger/ # Structured logging (slog)
βββ pkg/ # Public library code
β βββ utils/ # General utilities (crypto-secure)
βββ examples/ # Usage examples
βββ docs/ # Documentation
βββ scripts/ # Build and development scripts
-
π― Embedded Binary (
./bin/embedded): Single binary with all functionality- Automatic mode detection (CLI/TUI/Server)
- Symlink support for mode shortcuts
- Maximum code reuse and efficiency
-
π¦ Individual Binaries: Separate executables for each tool
cli-main: Full CLI functionalitytui-main: Terminal user interfacecli-serve: Dedicated file servercmd-unified: Alternative unified implementation
- Go 1.24+ (uses modern Go features)
- Make (for build automation)
- Git (for version control)
# Install development tools (linters, formatters, security scanners)
make dev-setup
# Install Git pre-commit hooks (recommended for contributors)
make install-hooks
# Verify installation
make lint # Run golangci-lint v2.4
make test # Run all tests with coverage
make security # Run gosec security scanmake build # Build all binaries (cross-platform)
make test # Run tests with coverage
make lint # Run golangci-lint
make security # Run gosec security scan
make sbom # Generate Software Bill of Materials
make vulnerability-check # Check for known vulnerabilities
make clean # Clean build artifacts
make deps # Download dependencies
make dev-setup # Install development tools
make install-hooks # Install Git pre-commit hooksThe project includes a pre-commit hook that automatically runs before every commit:
make fmt- Formats code using gofmtmake lint- Runs golangci-lint to catch issuesmake test- Runs all tests to ensure functionality
Install with make install-hooks. The hook will:
- β Format your code automatically
β οΈ Block commits if linting or tests fail- π‘ Skip hook:
git commit --no-verify(not recommended)
- β
Security: All crypto operations use
crypto/rand(notmath/rand) - β Linting: Passes golangci-lint v2.4 with strict configuration
- β Testing: Comprehensive test suite with race detection
- β Documentation: Godoc comments for all public APIs
- β Performance: Benchmark tracking with regression detection
Our CI pipeline ensures high code quality:
# Run the full test suite
go test -race -coverprofile=coverage.out ./...
# View coverage report
go tool cover -html=coverage.out
# Security scan
gosec ./...
# Lint check
golangci-lint runOur comprehensive performance monitoring system:
- Smart triggers: Benchmarks run after CI completes successfully
- Regression detection: Automatically compares against baseline performance
- PR comments: Detailed performance reports with statistical analysis
- Multi-architecture: Tests on AMD64 and ARM64 for comprehensive coverage
- Baseline management: Automatic baseline updates on main branch commits
Workflow separation:
CI: Fast feedback (build, test, lint, security) - ~10-15 minutesBenchmarks: Deep performance analysis - ~20-30 minutes (runs after CI)
- Crypto-secure randomness: Uses
crypto/randfor all random operations - Secure HTTP servers: TLS 1.2+, proper timeouts, secure headers
- File permissions: Restrictive permissions (0750) for generated directories
- Input validation: Comprehensive path validation to prevent traversal attacks
- Dependency scanning: Automated security vulnerability detection
- Dependabot: Automatically creates PRs for dependency updates
- Scheduled: Weekly scans on Mondays at 06:00 UTC
- Grouped updates: Related dependencies are grouped together
- Security-first: Critical vulnerabilities get immediate attention
# Check for known vulnerabilities
make vulnerability-check
# Run comprehensive security checks
make securityGenerate SBOM files for supply chain security:
# Generate SBOM in multiple formats
make sbom
# Or use the script directly
./scripts/generate-sbom.shGenerated SBOM formats:
- SPDX JSON (
*.spdx.json) - CycloneDX JSON (
*.cyclonedx.json) - Syft Native JSON (
*.syft.json) - SPDX Tag-Value (
*.spdx) - Human-readable table (
*.txt)
- Dependency graph: Automatically submitted to GitHub
- Vulnerability alerts: GitHub Security tab integration
- SARIF uploads: Security findings in GitHub Security dashboard
- License compliance: Automated license compatibility checks
The CI automatically builds for multiple platforms:
| OS | Architecture | Status |
|---|---|---|
| Linux | amd64, arm64 | β |
| Windows | amd64 | β |
| macOS | amd64, arm64 | β |
Download binaries from the Releases page.
// CLI Framework
github.com/spf13/cobra v1.10.1
github.com/spf13/viper v1.20.1
// TUI Framework
github.com/charmbracelet/bubbletea v1.3.7
github.com/charmbracelet/lipgloss v1.1.0
// Utilities
github.com/fatih/color v1.18.0
github.com/olekukonko/tablewriter v1.0.9
github.com/schollz/progressbar/v3 v3.18.0- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with tests
- Ensure quality:
make lint && make test && make security - Commit your changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
# Start development
git checkout -b feature/my-feature
# Make changes, then verify quality
make lint test security
# Add benchmarks if performance-critical
go test -bench=. ./...
# Commit and push
git add .
git commit -m "feat: add amazing feature"
git push origin feature/my-featurePerformance is tracked automatically in CI:
- Benchmark suite runs on every commit
- Regression detection prevents performance degradation
- Memory profiling included in test coverage
Example benchmark results:
BenchmarkRandomString-8 1000000 1234 ns/op 64 B/op 2 allocs/op
BenchmarkHashSHA256-8 500000 2456 ns/op 128 B/op 3 allocs/op
This project is licensed under the MIT License - see the LICENSE file for details.
See Releases for detailed changelog and version history.
Built with β€οΈ using Go 1.24 and modern development practices.