Go-Arch is a professional, agnostic, and multi-platform framework for scaffolding and evolving Go projects β a CLI, an ecosystem of installable template packs, executable generators, and multi-project workspaces. Inspired by the performance and modularity of the Angular CLI, it empowers developers to bootstrap production-ready applications with clean architecture patterns in seconds β and to extend the scaffolder itself.
- ποΈ Architecture Layouts: Native support for Minimalist, Standard, and Hexagonal (Ports & Adapters).
- π Agnostic & Decoupled: Data-driver independent (PostgreSQL, MySQL, MongoDB) and IDE-agnostic.
- β‘ Built-in Hot-Reload: Seamless integration with
Airfor a high-performance development loop. - π οΈ Component Generators: Scaffold Services, Repositories, Handlers, CRUD, and more mapped to your layout.
- π Server-Rendered Frontend: Optional templ + HTMX frontend living in the same binary β no SPA, no Node.
- π§© Frontend Generators:
generate pageandgenerate componentfor templ views with HTMX attributes. - π¦ Installable Packs:
template install github.com/you/go-arch-expressβ publishable, versioned template packs with a formal contract, fetched via the Go module proxy. - βοΈ Generator Recipes: Packs can ship executable
generatelogic (YAML recipes) β Angular-schematics-style extension. - π Lifecycle Hooks:
pre-new/post-new/pre-generate/post-generateso generated projects run their own tooling (format, install deps, init git). - ποΈ Multi-Project Workspaces:
go-arch.workspace.yaml+workspace upgrade/checkand--serviceto operate across a monorepo. - β¬οΈ Project Evolution:
go-arch upgradepropagates template changes via a fingerprint manifest without clobbering user edits. - π Production-Ready Scaffolding: typed
internal/config, subcommand-awaremain(server/migrate/version), and a zero-dep SQL migrations runner for PostgreSQL/MySQL. - π Infrastructure Ready: Optional Docker & Docker Compose generation for the app and DB (healthchecks, non-root, driver-correct URLs/volumes).
- π§ͺ QA & TDD Oriented: Automatic test file generation with manual mocking patterns.
- π¨ Deep Customization: High-level template system (Global/Local/Pack) to override any generated code.
- π§ Smart Pluralization: Linguistically aware generation (e.g.,
Category->Categories). - π‘οΈ Living Architecture: Built-in validation to ensure project integrity over time.
- π Multi-Backend Observability: Built-in OpenTelemetry support for Jaeger, Zipkin, Prometheus, and SigNoz.
- π°οΈ Microservices Ready: Native gRPC & Protocol Buffers integration with automated code generation.
- π€ MCP Server: Exposes every CLI command as an MCP tool for coding agents (OpenCode, Claude Desktop, etc.).
- π§ Multi-Platform: Native packages for Linux (Arch, Debian, Alpine, Fedora), macOS, and Windows.
Install the latest release binary with one command β no build tools required.
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/SalvucciFacundo/go-arch/main/install.sh | bashInstalls to /usr/local/bin (or ~/.local/bin when you don't have write permission, with PATH guidance). Verifies the SHA-256 checksum before installing.
Windows (PowerShell):
irm https://raw.githubusercontent.com/SalvucciFacundo/go-arch/main/install.ps1 | iexInstalls to ~\.go-arch\bin and adds it to your user PATH.
Download the latest pre-compiled binaries from the Releases page.
| Distribution | Install Command |
|---|---|
| Arch Linux | sudo pacman -U go-arch_*.pkg.tar.zst |
| Debian/Ubuntu | sudo dpkg -i go-arch_*.deb |
| Fedora/RHEL | sudo rpm -i go-arch_*.rpm |
| Alpine | apk add --allow-untrusted go-arch_*.apk |
- Download the latest version from Releases.
- macOS: Move the binary to
/usr/local/bin/go-arch. - Windows: Add the folder containing
go-arch.exeto your systemPATH.
go install github.com/SalvucciFacundo/go-arch/v2@latestLaunches an interactive wizard to configure Module Name, Layout, and Database Drivers.
go-arch new my-projectRuns the application. Automatically detects Air for hot-reload capabilities.
go-arch serveValidates that the project structure and imports follow the selected layout rules.
go-arch checkOperate across multiple services in a monorepo via a go-arch.workspace.yaml.
go-arch workspace upgrade
go-arch workspace check
go-arch generate crud User --service ordersSee Workspaces.
Generates patterns based on your project metadata (detects layout and namespace).
go-arch generate service Product
go-arch generate repository User
go-arch generate crud Category # Complete CRUD implementationList all available generators (pack, builtin, and component types):
go-arch generate --listIf your project uses a template pack with declarative generators (contract_version: 2), go-arch generate <name> runs the pack's recipe β with prompt collection, template rendering, and optional run steps:
go-arch generate docker myserviceIn projects scaffolded with the templ + HTMX frontend, you can also generate frontend parts:
go-arch generate page Dashboard # views/pages/dashboard.templ
go-arch generate component UserCard # views/components/usercard.templ (with HTMX attributes)Starts a native MCP server communicating over standard input/output (stdio), allowing coding agents (like OpenCode, Claude Desktop, or Gemini) to interact with the CLI tools. Every CLI command has a corresponding tool:
go-arch mcpnew_projectβgo-arch newgenerate_componentβgo-arch generate(incl.page/component, plus pack generators withgeneratorArgs)list_generatorsβgo-arch generate --listcheck_architectureβgo-arch checkserve_projectβgo-arch serve(returns the exact run command)setup_environmentβgo-arch setup(detects, and can installairwith consent)
Prints the build version. Local builds print dev; GoReleaser releases inject the tag automatically.
go-arch version- Minimalist: Thin structure for microservices or single-file scripts.
- Standard: Conventional Go layout for mid-sized projects and CLI tools.
- Hexagonal: Domain-Centric design for enterprise-grade applications requiring high decoupling.
You can override any built-in template with your own. The CLI follows this lookup order:
- Local:
./.go-arch/templates/<path> - Global:
~/.go-arch/templates/<path> - Installed Packs:
~/.go-arch/packs/<name>@<version>/templates/<path>(whennew --templateis used) - Embedded: Built-in defaults.
Check the Architecture Guide for detailed mapping and customization instructions.
If Docker Support is enabled, the CLI generates:
- Dockerfile: Optimized multi-stage build.
- docker-compose.yaml: Application + Database + Observability Backend (Jaeger, Zipkin, etc.) orchestration.
- Makefile: Automation for gRPC code generation (
make proto) and environment setup.
Built with β€οΈ for the Go Community by SalvucciFacundo.
