Go-Arch (go-arch) ๐Ÿš€

August 14, 2026 ยท View on GitHub

Go-Arch Banner

Release License Go Version OS Support


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 Air for 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 page and generate component for 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 generate logic (YAML recipes) โ€” Angular-schematics-style extension.
  • ๐Ÿ”„ Lifecycle Hooks: pre-new / post-new / pre-generate / post-generate so generated projects run their own tooling (format, install deps, init git).
  • ๐Ÿ—‚๏ธ Multi-Project Workspaces: go-arch.workspace.yaml + workspace upgrade/check and --service to operate across a monorepo.
  • โฌ†๏ธ Project Evolution: go-arch upgrade propagates template changes via a fingerprint manifest without clobbering user edits.
  • ๐Ÿญ Production-Ready Scaffolding: typed internal/config, subcommand-aware main (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

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)

DistributionInstall Command
Arch Linuxsudo pacman -U go-arch_*.pkg.tar.zst
Debian/Ubuntusudo dpkg -i go-arch_*.deb
Fedora/RHELsudo rpm -i go-arch_*.rpm
Alpineapk add --allow-untrusted go-arch_*.apk

๐Ÿ macOS / ๐ŸชŸ Windows

  1. Download the latest version from Releases.
  2. macOS: Move the binary to /usr/local/bin/go-arch.
  3. Windows: Add the folder containing go-arch.exe to your system PATH.

๐Ÿ› ๏ธ 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 new
  • generate_component โ†’ go-arch generate (incl. page / component, plus pack generators with generatorArgs)
  • list_generators โ†’ go-arch generate --list
  • check_architecture โ†’ go-arch check
  • serve_project โ†’ go-arch serve (returns the exact run command)
  • setup_environment โ†’ go-arch setup (detects, and can install air with 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:

  1. Local: ./.go-arch/templates/<path>
  2. Global: ~/.go-arch/templates/<path>
  3. Installed Packs: ~/.go-arch/packs/<name>@<version>/templates/<path> (when new --template is used)
  4. 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.