A powerful command-line tool for scaffolding new Go projects with multiple templates based on popular Go project setups.
- Multiple Templates: Choose from full-stack, CLI, API, or library templates
- Clean Architecture: Templates follow Go best practices
- Go Best Practices: Standard Go project layout conventions
- Web-Ready: Full-stack template includes basic HTTP server setup
- Dependency Management: Automatically initializes Go modules
- Cross-Platform: Works on Windows, macOS, and Linux
Complete web application with API, services, repositories, and templates.
your-project-name/
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── api/ # API handlers and controllers
│ ├── service/ # Business logic layer
│ ├── repository/ # Data access layer
│ └── domain/ # Core business models
├── pkg/ # Public libraries and utilities
├── configs/
│ └── config.yaml # Configuration files
├── web/
│ └── templates/ # HTML templates
├── scripts/ # Build and deployment scripts
├── .gitignore # Git ignore rules
├── README.md # Project documentation
└── go.mod # Go module file
Simple command-line interface tool.
your-project-name/
├── cmd/
│ └── main.go # CLI entry point
├── pkg/ # Utilities
├── .gitignore
├── README.md
└── go.mod
REST API server with clean architecture.
your-project-name/
├── cmd/
│ └── main.go # Server entry point
├── internal/
│ ├── api/ # API handlers
│ ├── service/ # Business logic
│ ├── repository/ # Data access
│ └── domain/ # Models
├── pkg/
├── configs/
│ └── config.yaml
├── .gitignore
├── README.md
└── go.mod
Go library/package.
your-project-name/
├── pkg/
│ └── example.go # Library code
├── .gitignore
├── README.md
└── go.mod
go_scaffold/
├── cmd/
│ └── main.go # Cobra CLI application entry point
├── internal/
│ └── templates/ # Template implementations
│ ├── templates.go # Base template interface and utilities
│ ├── registry.go # Template registry
│ ├── full.go # Full-stack template
│ ├── cli.go # CLI template
│ ├── api.go # API template
│ └── lib.go # Library template
├── bin/ # Built executables
├── configs/ # Configuration files
├── scripts/ # Build scripts
├── .gitignore
├── README.md
├── go.mod
└── go.sum
- Go 1.19 or later
- Git
- Clone or download this project
- Navigate to the project directory
- Build the executable:
go build -o bin/go_scaffold ./cmd
# Create a full-stack project
go_scaffold full my-web-app
# Create a CLI tool
go_scaffold cli my-cli-tool
# Create an API server
go_scaffold api my-api
# Create a library
go_scaffold lib my-library
# List available templates
go_scaffold list# General help
go_scaffold --help
# Help for specific template
go_scaffold full --helpWe welcome contributions! Please see our Contributing Guide for details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.