GoForge

command module
v0.0.0-...-f154dc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README ΒΆ

GoForge Logo

[!NOTE] A comprehensive, production-ready Go application framework and CLI for rapid database, gRPC, and service scaffolding.

The GoForge CLI is a powerful command-line tool designed to accompany the GoForge application framework template. It provides a universal utility for rapidly scaffolding new services, generating database migrations, compiling protocol buffers, and managing application-specific console commands effortlessly out-of-the-box.

✨ Features

  • πŸš€ Zero-Configuration Awareness: The CLI dynamically analyzes your project's .env and go.mod files for context; it executes tasks directly against your application state without complicated tooling setup.
  • πŸ—οΈ Service Scaffolding: Automatically generate complete service skeletons, including database models, service contracts, gRPC stubs, API handlers, and routes.
  • πŸ—„οΈ Database Tooling: Effortlessly integrate with atlas and sqlc for clean database migrations and typed SQL query generation!
  • πŸ”Œ Extensibility: Bootstrap custom local CLI tools to provide application specific console actions (e.g. running daily cronjobs, admin backfills, cache clearers, etc).

πŸ—οΈ Project Structure

A typical GoForge project follows a clean, modular architecture:

.
β”œβ”€β”€ cmd/                # Application entry points (main.go)
β”œβ”€β”€ internal/           # Private application code
β”‚   β”œβ”€β”€ cache/          # Caching drivers (Redis, Ristretto, Multi-tier)
β”‚   β”œβ”€β”€ client/         # internal gRPC and HTTP clients
β”‚   β”œβ”€β”€ config/         # Configuration loaders and types
β”‚   β”œβ”€β”€ console/        # Application-specific CLI commands
β”‚   β”œβ”€β”€ database/       # Database core, migrations, and SQLC queries
β”‚   β”œβ”€β”€ server/         # HTTP and gRPC server setups & middleware
β”‚   └── services/       # Domain-specific business logic & services
β”œβ”€β”€ proto/              # Protocol Buffer definitions
β”œβ”€β”€ tests/              # Unit, integration, and client tests
β”œβ”€β”€ air.toml            # Air configuration for live reloading
β”œβ”€β”€ atlas.hcl           # Atlas migration configuration
β”œβ”€β”€ goforge.sh          # Helper shell script for CLI proxying
└── sqlc.yaml           # SQLC configuration

🏁 Getting Started

Prerequisites

Ensure you have the following installed:

Installation

Install the GoForge CLI globally:

go install github.com/mmycin/GoForge@latest

Ensure your $GOPATH/bin is in your $PATH.

Initializing a Project

goforge new my-awesome-project
cd my-awesome-project

πŸ› οΈ Usage & Commands

πŸ”‘ Core Utilities

Command Description
goforge new Create a new GoForge project from the template.
goforge gen:key Generates and sets a secure APP_KEY in .env.
goforge rem:key Removes the active APP_KEY from .env.
goforge readme Displays the recommended GoForge workflow.
goforge version Displays the CLI version.

πŸ› οΈ Service Generation

Scaffold domain logic rapidly:

  • goforge gen:service [name]: Scaffolds a complete service in internal/services/<name>.
  • goforge rem:service [name]: Safely removes a service and un-registers it.

πŸ“‘ Protocol Buffers

  • goforge gen:proto [name]: Compiles specific or all .proto files using protoc.
  • goforge rem:proto: Scrubs all generated .pb.go files.

πŸ’» Custom Application Commands

Bridge the gap between global tools and project-specific execution:

  • goforge gen:command [name]: Creates a Cobra CLI command in internal/console.
  • goforge app serve [args]: Proxies the local compiler. Running goforge app serve invokes go run cmd/main.go serve, loading the full environment.

πŸ—„οΈ Database Operations

Native support for gorm, atlas, and sqlc:

  • goforge migrate: Applies SQL migrations using Atlas.
  • goforge gen:migration [name]: Generates schema differences using Atlas and GORM.
  • goforge rem:migration: Reverts the most recent migration.
  • goforge gen:sqlc: Compiles internal/database/queries/*.sql into type-safe Go.

πŸ“„ License

The goforge CLI is licensed under the Apache License 2.0. See the LICENSE file for more details.

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
env

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL