Create Go App CLI: Full-Stack Scaffolding That Knows Your Deployment Server
Hook
Most project generators stop at code scaffolding. Create Go App CLI ships with Ansible playbooks that know how to deploy your application to a production server, configure Traefik proxy with Let’s Encrypt SSL, and wire up PostgreSQL—all before you write a single line of business logic.
Context
Starting a new Go web application means making dozens of decisions before writing actual features: Which router? How to structure middleware? What frontend framework? How to containerize? Where to deploy? These decisions compound when you’re building full-stack applications that need modern frontend tooling, database connections, and production deployment pipelines.
The traditional approach involves manually wiring together disparate technologies—setting up a Go backend with your chosen framework, configuring a Vite.js frontend separately, writing Dockerfiles, crafting Ansible playbooks, and hoping everything integrates smoothly. Create Go App CLI compresses this multi-day setup into a single interactive command that generates not just code, but a complete deployment pipeline with opinionated defaults that actually work together. It’s scaffolding that understands the full lifecycle from go run to production SSL certificates.
Technical Insight
Create Go App CLI’s architecture centers on three interconnected template systems: backend frameworks (Fiber, Chi, or net/http), frontend tooling (Vite.js with React, Vue, Svelte, etc.), and Ansible deployment roles. When you run cgapp create, the CLI presents an interactive console UI that guides you through selecting these components, then generates a project structure that’s pre-wired for integration.
The backend templates deserve particular attention because they include production-ready patterns out of the box. Here’s what a generated Fiber application structure looks like:
// app/controllers/book_controller.go
package controllers
import (
"github.com/gofiber/fiber/v2"
"myapp/app/models"
"myapp/platform/database"
)
func GetBooks(c *fiber.Ctx) error {
db := database.GetDB()
var books []models.Book
if err := db.Find(&books).Error; err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
"error": true,
"msg": err.Error(),
})
}
return c.JSON(fiber.Map{
"error": false,
"msg": nil,
"count": len(books),
"books": books,
})
}
The generated code includes JWT authentication middleware, GORM database connections with migration helpers, and RESTful routing patterns. But the real architectural insight is how it separates concerns: app/ contains business logic (controllers, models), platform/ handles infrastructure (database, cache, middleware), and pkg/ holds shared utilities. This structure scales well because infrastructure concerns don’t bleed into business logic.
The frontend integration uses Vite.js templates that are always current because Create Go App CLI pulls from the official Vite starter templates. When you select React with TypeScript, you get the same setup you’d get from npm create vite@latest, but it’s pre-configured to proxy API requests to your Go backend during development. The generated vite.config.js includes:
export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true,
},
},
},
})
This eliminates CORS headaches during development and mirrors production routing where Traefik handles the proxying.
The deployment automation is where Create Go App CLI distinguishes itself from pure scaffolding tools. The generated .ansible/ directory contains complete playbooks with roles for deploying Docker containers, configuring Traefik as a reverse proxy with automatic Let’s Encrypt SSL, setting up PostgreSQL, and Redis. The inventory file structure supports multiple environments:
# .ansible/hosts.ini
[production]
api.example.com ansible_user=root
[production:vars]
server_name=api.example.com
server_contact_email=admin@example.com
postgresql_version=14
redis_version=7
Running cgapp deploy (outside Docker) executes these playbooks against your server, installing Docker if needed, pulling your application’s Docker image, configuring Traefik with automatic HTTPS, and starting all services. This is opinionated infrastructure-as-code that assumes you want a single-server deployment with Traefik handling SSL termination—a perfect fit for MVPs and small-to-medium applications.
The CLI itself is a well-structured Go application that demonstrates good CLI design patterns using the Cobra library. Command execution is clean, with separate packages for template generation, file operations, and user interaction through the survey library for the interactive prompts. The codebase is readable enough that if you need to customize template generation logic, you can fork and modify without archaeology.
Gotcha
The deploy command’s unavailability in the Docker image creates an awkward workflow constraint. You can run docker run --rm -v "${PWD}:/app" koddr/cgapp:latest create to generate a project without installing the CLI, but deploying requires Python 3.8+, Ansible 2.9+, and the CLI installed on your host system. This split means you can’t achieve true “one command from zero to production” in isolated environments like CI/CD pipelines without additional setup steps.
The Ansible deployment strategy assumes a traditional VM-based infrastructure model that’s increasingly at odds with cloud-native deployment patterns. If you’re deploying to Kubernetes, AWS ECS, Google Cloud Run, or any managed container platform, the included Ansible playbooks provide zero value—you’ll need to write your own deployment configuration anyway. The tool assumes you have SSH access to a server where you can install Docker, which doesn’t match the deployment reality for many modern applications. Teams using Pulumi, Terraform, or cloud-specific deployment tools will find the Ansible integration more burden than benefit.
The frontend dependency on npm v7+ adds friction for teams standardizing on different package managers. While the requirement exists for workspace and peer dependency handling that Vite needs, it means you can’t use Yarn or pnpm without manual configuration adjustments. Additionally, the generated templates are opinionated about structure—if you want a monorepo setup with shared packages, or prefer a different directory layout, you’re fighting against the generator’s assumptions from day one.
Verdict
Use Create Go App CLI if you’re building full-stack applications for deployment to traditional VMs or dedicated servers where Ansible makes sense, need standardized project structure across multiple team projects, or want to validate an MVP quickly with production-ready authentication and database patterns already wired up. It excels at eliminating decision fatigue for teams who don’t have strong opinions about tooling and trust the maintainers’ architectural choices. Skip it if you’re deploying to Kubernetes or managed cloud platforms where the Ansible playbooks are irrelevant, need fine-grained control over project structure and can’t work within the generated template constraints, already have established patterns for Go project layout that differ from the tool’s opinions, or prefer building up from minimal templates rather than carving away from feature-complete scaffolding. This tool shines brightest in consultancies or agencies that ship similar full-stack applications repeatedly and value consistency over customization.