Thanks to visit codestin.com
Credit goes to github.com

Skip to content

raythurman2386/go-tooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Tooling

A collection of useful Go CLI tools for developers and power users.

Features

  • File Management: Find duplicates, organize files, and find/replace text.
  • Network: Port scanner and simple HTTP server.
  • Development: JSON formatting, TODO scanning, and load testing.
  • Media: Image format conversion.
  • Docker Management: Comprehensive Docker environment management, cleanup, inspection, and automation.
  • Extensible: Built-in scaffolding for creating new tools.

Prerequisites

  • Go 1.25 or higher

Installation

From Source

git clone https://github.com/rthurman2386/go-tooling.git
cd go-tooling
go install .

This will install the go-tooling binary to your $GOPATH/bin directory.

Local Development Build

You can build the binary and move it to a directory in your $PATH (e.g., ~/.local/bin):

go build -o go-tooling ./cmd
mv go-tooling ~/.local/bin/

Usage

Run the tool followed by the subcommand:

go-tooling [command] [flags]

Available Commands

  • benchmark: A simple HTTP load testing tool to measure server performance.
    • Usage: go-tooling benchmark -u <url> [flags]
  • duplicate-finder: Finds duplicate files in a specified directory based on content hash.
    • Usage: go-tooling duplicate-finder [path]
  • find-replace: Find and replace text in files recursively.
    • Usage: go-tooling find-replace <pattern> <replacement> <path>
  • img-convert: Convert image formats (e.g., PNG to JPG).
    • Usage: go-tooling img-convert <input> <output> <format>
  • json-fmt: Format and validate JSON data from a file or stdin.
    • Usage: go-tooling json-fmt [file]
  • newtool: Scaffold a new tool in this project.
    • Usage: go-tooling newtool <name>
  • organize: Organizes files in a directory based on their extension.
    • Usage: go-tooling organize [path]
  • port-scanner: Scans for open ports on a host.
    • Usage: go-tooling port-scanner <host> [flags]
  • serve: Serves the current directory over HTTP.
    • Usage: go-tooling serve [port]
  • todo-scanner: Scan for TODO, FIXME, and NOTE comments in code files.
    • Usage: go-tooling todo-scanner [path] [flags]
  • docker-cleanup: Clean up Docker resources (containers, images, volumes, networks, cache).
    • Usage: go-tooling docker-cleanup [flags]
  • docker-inspect: Inspect Docker environment and resources with multiple output formats.
    • Usage: go-tooling docker-inspect [flags]
  • docker-prune-old: Prune old Docker resources based on age with pattern exclusion.
    • Usage: go-tooling docker-prune-old --days N [flags]
  • docker-logs-manager: Manage and analyze Docker container logs with export and search.
    • Usage: go-tooling docker-logs-manager --container NAME [flags]
  • docker-compose-manager: Discover and manage Docker Compose projects.
    • Usage: go-tooling docker-compose-manager [flags]

Development

Project Structure

  • cmd/: Contains the main application entry point and subcommand definitions. Each tool has its own file here (e.g., cmd/mytool.go).
  • pkg/: Contains the core logic for each tool, organized by package (e.g., pkg/mytool/).
  • go.mod: Manages project dependencies.

Adding a New Tool

Use the built-in newtool command to scaffold a new tool:

go-tooling newtool my-new-tool

This will create:

  1. cmd/my_new_tool.go: The CLI command definition.
  2. pkg/my_new_tool/my_new_tool.go: The package for the tool's logic.

Building

go build -o go-tooling ./cmd

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

MIT

About

A collection of useful Go CLI tools.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages