go-cli-template

module
v0.0.0-...-24d9170 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: EUPL-1.2

README

Go CLI Template

CI Release Go Version Go Report Card License

A ready-to-use template for Go CLI applications.

Stack

  • Go 1.24+
  • urfave/cli v3 for argument parsing and subcommands
  • just task runner
  • golangci-lint for code quality
  • goreleaser for releases

Quick Start

# Create new project from template
gohatch github.com/oliverandrich/go-cli-template github.com/you/your-app

# Build and run
cd your-app
just build
./build/your-app

Requirements

Template Variables

The template uses placeholders that gohatch replaces automatically:

Placeholder Replaced with
__ProjectName__ Binary name (last path segment)
__ProjectDescription__ Project description (from -d flag)

Development

just setup            # Setup project (download deps, install pre-commit hooks)
just build            # Build binary to build/<name>
just test             # Run tests
just cover            # Run tests with coverage
just cover-report     # Open coverage report in browser
just fmt              # Format code
just lint             # Run linter
just check            # Run fmt, lint, and test
just clean            # Remove build artifacts
just install          # Install to $GOPATH/bin
just release          # Create release with goreleaser

Project Structure

├── cmd/
│   └── __ProjectName__/    # CLI entry point
│       └── main.go
├── internal/               # Internal packages
│   └── example/            # Example package
├── go.mod
├── justfile                # Task runner
├── .golangci.yml           # Linter config
└── .goreleaser.yml         # Release config

License

EUPL-1.2 - see LICENSE

Directories

Path Synopsis
cmd
__ProjectName__ command
internal
example
Package example provides a simple example of an internal package.
Package example provides a simple example of an internal package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL