### Install and Verify GBC Source: https://context7.com/zjutjh/gbc/llms.txt Commands to install the latest version of the GBC tool and verify the current installation. ```bash go install github.com/zjutjh/gbc@latest gbc --version ``` -------------------------------- ### Install gbc CLI tool Source: https://github.com/zjutjh/gbc/blob/main/README.md This command installs the latest version of the gbc tool from the GitHub repository using the Go toolchain. It requires a functional Go environment to be installed on the host system. ```shell go install github.com/zjutjh/gbc@latest ``` -------------------------------- ### Initialize New Project with GBC Source: https://context7.com/zjutjh/gbc/llms.txt Commands to create a new project using the mygo framework template, including options for custom paths and debug mode. ```bash gbc new myapp gbc new myapp /path/to/workspace gbc new myapp -d ``` -------------------------------- ### Generate API Templates Source: https://context7.com/zjutjh/gbc/llms.txt Commands to generate API handler templates. Supports interactive mode or explicit parameter definitions (Body/Query/Header/Uri). ```bash gbc api user/GetInfo gbc api user/CreateUser --body --query gbc api order/Submit --body --query --header --uri ``` ```go package user import ( "reflect" "runtime" "github.com/gin-gonic/gin" "github.com/zjutjh/mygo/foundation/reply" "github.com/zjutjh/mygo/kit" "github.com/zjutjh/mygo/nlog" "github.com/zjutjh/mygo/swagger" "app/comm" ) func GetInfoHandler() gin.HandlerFunc { api := GetInfoApi{} swagger.CM[runtime.FuncForPC(reflect.ValueOf(hfGetInfo).Pointer()).Name()] = api return hfGetInfo } type GetInfoApi struct { Info struct{} `name:"API名称" desc:"API描述"` Request GetInfoApiRequest Response GetInfoApiResponse } type GetInfoApiRequest struct { Query struct {} } type GetInfoApiResponse struct {} func (g *GetInfoApi) Run(ctx *gin.Context) kit.Code { return comm.CodeOK } func (g *GetInfoApi) Init(ctx *gin.Context) (err error) { err = ctx.ShouldBindQuery(&g.Request.Query) return err } ``` -------------------------------- ### Update GBC and Framework Source: https://context7.com/zjutjh/gbc/llms.txt Commands to upgrade the GBC tool itself or update the mygo framework dependencies within a project. ```bash gbc upgrade cd myproject && gbc mygo ``` -------------------------------- ### Generate Command and Cron Templates Source: https://context7.com/zjutjh/gbc/llms.txt Commands to generate boilerplate code for CLI subcommands and scheduled tasks. ```bash gbc cmd sync/DataSync gbc cron task/CleanupJob ``` ```go // Command Template func DataSyncRun(cmd *cobra.Command, args []string) error { return nil } // Cron Template type CleanupJobJob struct{} func (CleanupJobJob) Run() { nlog.Pick().WithField("app", config.AppName()).Debug("定时任务运行") } ``` -------------------------------- ### Analyze Business Status Codes Source: https://context7.com/zjutjh/gbc/llms.txt Commands to perform static analysis on Gin handlers to extract and document business status codes using SSA analysis. ```bash gbc codegen gbc codegen -s ./docs/codes gbc codegen -a rta gbc codegen --store-dir ./register/generate --algorithm rta --debug ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.