goeasy-cli

command module
v0.0.0-...-0902d68 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 1 Imported by: 0

README

goeasy-cli

GoEasy DDD Lite 官方脚手架(开发期工具,不参与运行时)。

开发教程docs/guide

安装

# 1. 安装 goeasy-cli(代码生成工具)
go install github.com/txbao/goeasy-cli@latest


创建项目

生成项目直接依赖 goeasy 运行时

goeasy-cli new demo --module github.com/demo/demo --download=false
cd demo
go mod tidy
go run ./cmd/service
go run ./cmd/service -f configs/config.example.yaml
goeasy-cli migrate up -f configs/config.yaml

CLI 会在项目目录执行 go mod init;依赖由 go mod tidy 根据源码 import 解析。

monorepo 内会自动 replace 本地 ../goeasy

别名:goeasy-cli init demo ...

模板变体
goeasy-cli new auth-svc --template auth --module github.com/demo/auth
goeasy-cli new pay-svc --template payment --module github.com/demo/pay
goeasy-cli new app --template monolith
goeasy-cli new sys-svc --template system

生成模块

在项目根目录执行:

goeasy-cli add module user
goeasy-cli add crud user --force
goeasy-cli add repository order
goeasy-cli add proto user
goeasy-cli add event user-created
goeasy-cli add aggregate order

升级

goeasy-cli upgrade template
goeasy-cli upgrade framework

Flags(new/init)

Flag 默认 说明
--module 项目名 Go module
--template default default / monolith / auth / system / payment
--download false 远端 zip(失败回退 embed)
--output . 输出父目录
--goeasy-module github.com/txbao/goeasy 运行时 module 路径(或环境变量 GOEASY_MODULE
--goeasy-replace 自动 本地 goeasy replace 路径

生成目录(DDD Lite)

cmd/service/
internal/domain|app|interface/http|infrastructure|bootstrap|observer
configs/  api/  deploy/

开发指引

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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