-
Notifications
You must be signed in to change notification settings - Fork 0
hyp new.md
maoxiaoyue edited this page Apr 14, 2026
·
1 revision
建立新的 HypGo 專案。支援三種專案類型。
hyp new <name> # 全棧 Web 專案(預設) hyp new web <name> # 同上(明確指定) hyp new cli <name> # CLI 工具專案(Cobra) hyp new desktop <name> # 桌面應用專案(Fyne GUI)
hyp new myapp
生成結構:
myapp/
├── app/
│ ├── controllers/home.go
│ ├── models/
│ └── services/
├── config/config.yaml
├── static/css/ js/ images/
├── templates/welcome.html
├── main.go
└── go.mod
v0.8.5+CLI、Desktop、gRPC 專案類型為 v0.8.5 新增功能,v0.8.1 僅支援 Web 專案。
hyp new cli mytool
生成結構:
mytool/
├── app/
│ ├── commands/root.go
│ ├── models/
│ ├── services/
│ └── config/config.yaml
├── main.go
└── go.mod
後續:hyp generate command process
v0.8.5+Desktop(Fyne GUI)專案為 v0.8.5 新增功能。
hyp new desktop myapp
生成結構:
myapp/
├── app/
│ ├── views/main_view.go
│ ├── models/
│ ├── services/
│ └── config/config.yaml
├── main.go
└── go.mod
後續:hyp generate view settings
注意:Fyne 需要 C 編譯器(gcc)。
cd myapp && go mod tidy hyp ai-rules # 必要:生成 AI 工具配置檔
- hyp api — API-only 專案
- hyp generate — 生成程式碼
- hyp ai-rules — 生成 AI 配置檔
設計文件
套件
- 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