A powerful CLI tool to quickly scaffold production-ready Go projects with various architectural patterns. Choose from Layered, Modular, or Hexagonal architecture templates and get started with your project in seconds.
-
Multiple Architecture Patterns
- Layered Architecture (Traditional 3-tier)
- Modular Architecture (DDD-based modular monolith)
- Hexagonal Architecture (Ports and Adapters)
-
Interactive CLI
- Beautiful terminal UI with
huhandlipgloss - Step-by-step project initialization
- Form-based configuration
- Beautiful terminal UI with
-
Template Management
- GitHub integration for template repositories
- Local caching with 24-hour TTL
- Easy template updates
-
Production-Ready Projects
- Clean code structure
- Best practices built-in
- Ready for deployment
- Automatic import path updates - All Go import paths are automatically updated to match your module path
git clone https://github.com/PickHD/pick-your-go.git
cd pick-your-go
make installgo install github.com/PickHD/pick-your-go/cmd/pick-your-go@latest- Go 1.25
- Git
- GitHub token (for accessing private template repositories)
To access private template repositories, set the PICK_YOUR_GO_GITHUB_TOKEN environment variable:
export PICK_YOUR_GO_GITHUB_TOKEN="your_github_token_here"Note: This token is required for all three architecture templates as they are hosted in private repositories.
The easiest way to create a new project:
pick-your-go initThis will launch an interactive form that guides you through:
- Choosing your architecture pattern
- Providing project details (name, module path, author, description)
- Reviewing and confirming your choices
You can also provide all options via flags:
pick-your-go init \
--architecture layered \
--name my-awesome-app \
--module github.com/username/my-awesome-app \
--author "Your Name" \
--description "A brief description of your project" \
--output ./projects# Interactive mode
pick-your-go init
# With flags
pick-your-go init --architecture layered --name myapp --module github.com/user/myapp
# Options:
# -a, --architecture string Architecture type: layered, modular, or hexagonal
# -n, --name string Project name
# -m, --module string Go module path (e.g., github.com/user/project)
# -o, --output string Output directory (default: current directory)
# -u, --author string Author name
# -d, --description string Project descriptionpick-your-go templates listShows all available architecture templates with their descriptions and cache status.
pick-your-go templates updateForce update the local template cache from remote repositories.
Traditional three-tier architecture with clear separation:
Best for:
- Traditional web applications
- Teams familiar with layered architecture
- Projects with clear separation of concerns
Domain-driven design approach with modular boundaries:
Best for:
- Large monolithic applications
- Teams using Domain-Driven Design
- Projects with clear domain boundaries
Ports and adapters pattern for maximum decoupling:
Best for:
- Complex business logic domains
- Projects requiring high testability
- Teams focused on clean architecture principles
# Clone the repository
git clone https://github.com/PickHD/pick-your-go.git
cd pick-your-go
# Install dependencies
make deps
# Run in development mode
make runmake help # Show all available commands
make build # Build the binary
make run # Run the application
make install # Install to $GOPATH/bin
make test # Run tests
make lint # Run linters
make fmt # Format code
make clean # Clean build artifacts
make templates-update # Update template cache
make templates-list # List available templatespick-your-go/
├── cmd/
│ └── pick-your-go/ # Application entry point
├── internal/
│ ├── cache/ # Template caching logic
│ ├── cli/ # CLI commands (cobra)
│ ├── cmd/ # Command implementations
│ ├── config/ # Configuration management
│ ├── generator/ # Architecture generators
│ └── template/ # Template management
├── pkg/
│ └── ui/ # Interactive UI components
├── templates/ # Local template cache
├── Makefile # Development commands
├── go.mod # Go module definition
└── README.md # This file
- Template Selection: Choose an architecture pattern (layered/modular/hexagonal)
- Configuration: Provide project details via interactive form or flags
- Template Retrieval: Tool fetches the template from GitHub repository
- Caching: Template is cached locally for 24 hours to speed up subsequent projects
- Generation: Template is copied to your destination and customized with your project details
- Import Path Updates: All Go import paths in
.gofiles are automatically updated from the template's module name to your project's module path - Ready to Use: Your new project is ready to develop with correct import paths!
Templates are cached in:
- Linux:
~/.cache/pick-your-go/ - macOS:
~/Library/Caches/pick-your-go/ - Windows:
%LocalAppData%\pick-your-go\cache\
Cache TTL is 24 hours. Force update with:
pick-your-go templates updateContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
For issues, questions, or suggestions, please open an issue on GitHub.
Made with by PickHD