-
Notifications
You must be signed in to change notification settings - Fork 0
hyp generate_en.md
maoxiaoyue edited this page May 14, 2026
·
1 revision
Generate boilerplate code that follows HypGo conventions.
hyp generate [type] [name] hyp generate [type] [name] -m <module-name>
| Type | Description | Output Location | For |
|---|---|---|---|
controller |
Controller + Schema Router + Middleware |
app/controllers/ + app/routers/
|
Web |
model |
Bun ORM Model + Req/Resp structs | app/models/ |
All |
service |
Business logic + Error Catalog | app/services/ |
All |
command |
Cobra subcommand | app/commands/ |
CLI |
view |
Fyne GUI view | app/views/ |
Desktop |
proto |
Protobuf service + gRPC server |
app/proto/ + app/rpc/
|
gRPC |
| Flag | Description | Default |
|---|---|---|
-m, --module |
Go module name | Auto-detected from go.mod
|
hyp generate controller user # Controller + Router (with Schema Input/Output) hyp generate model order # Model + CreateOrderReq + OrderResp + OrderListResp hyp generate service payment # Service + Error Catalog
v0.8.5+command(CLI) andview(Desktop) generation types are new in v0.8.5.
hyp generate command process # Cobra subcommand
hyp generate view settings # Fyne GUI viewhyp generate proto order # .proto + gRPC server implementation# Web hyp generate model user # 1. Define data structures hyp generate controller user # 2. Generate handler + router hyp generate service user # 3. Generate business logic # CLI hyp generate command process # Generate subcommand directly # Desktop hyp generate view settings # Generate view directly # gRPC hyp generate proto order # Generate .proto + server
- Name validation: only
[a-zA-Z][a-zA-Z0-9_]*allowed - Never overwrites existing files
- Module name auto-detected from
go.mod
- hyp new — Create project
- hyp context — Generated Schema routes appear in manifest
設計文件
套件
- config — 設定
- context — 請求上下文
- router — 路由器
- server — 伺服器
- middleware — 中介層
- websocket — WebSocket
- hidb — 資料庫 ORM
- hidb/cassandra — Cassandra
- logger — 日誌
- json — JSON 處理
- grpc — gRPC
AI 協作工具鏈
- schema — Schema-first 路由
- manifest — 專案 Manifest
- contract — Contract Testing
- errors — Typed Error Catalog
- migrate — Migration Diff
- scaffold — 智慧 Scaffold
- airules — AI Rules
CLI 命令
- hyp 總覽
- hyp new
- hyp api
- hyp run
- hyp restart
- hyp generate
- hyp migrate
- hyp context
- hyp ai-rules
- hyp chkcomment
- hyp impact
- hyp docker
- hyp health
- hyp version
- hyp difflog
Design Docs
Packages
- config — Configuration
- context — Request Context
- router — Router
- server — Server
- middleware — Middleware
- websocket — WebSocket
- hidb — Database ORM
- hidb/cassandra - Cassandra 5.0
- logger — Logger
- json — JSON
- grpc — gRPC
AI Collaboration Toolchain
- schema — Schema-first Routing
- manifest — Project Manifest
- contract — Contract Testing
- errors — Typed Error Catalog
- migrate — Migration Diff
- scaffold — Smart Scaffold
- airules — AI Rules
CLI Commands