Go-Arch (go-arch) ๐
August 14, 2026 ยท View on GitHub
Go-Arch (go-arch) ๐
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.
โจ Key Features
- ๐๏ธ 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.
๐ Installation
โก Single Command (Recommended)
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 | bash
Installs 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 | iex
Installs to ~\.go-arch\bin and adds it to your user PATH.
๐ฆ Binary Downloads
Download the latest pre-compiled binaries from the Releases page.
๐ง Linux (Native Packages)
| 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 |
๐ macOS / ๐ช Windows
- 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.
๐ ๏ธ Manual Build (Any OS)
go install github.com/SalvucciFacundo/go-arch/v2@latest
๐ Usage Guide
1. Project Initialization
Launches an interactive wizard to configure Module Name, Layout, and Database Drivers.
go-arch new my-project
2. Development Server
Runs the application. Automatically detects Air for hot-reload capabilities.
go-arch serve
3. Architecture Health Check
Validates that the project structure and imports follow the selected layout rules.
go-arch check
3b. Multi-Project Workspaces
Operate 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 orders
See Workspaces.
4. Smart Generators
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 implementation
List all available generators (pack, builtin, and component types):
go-arch generate --list
If 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 myservice
In 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)
5. Model Context Protocol (MCP) Server
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 mcp
new_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)
6. Version
Prints the build version. Local builds print dev; GoReleaser releases inject the tag automatically.
go-arch version
๐๏ธ Supported Architectures
- 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.
๐จ Customization (External Templates)
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.
๐ Infrastructure & Docker
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.
๐ Resources
Built with โค๏ธ for the Go Community by SalvucciFacundo.