Skip to main content
Version: 1.16.x

GoFrame 框架提供了功能强大的 gf 命令行开发辅助工具,是框架发展的一个重要组成部分,工具开源项目地址: https://github.com/gogf/gf-cli

我们推荐通过下载安装预编译的二进制使用。工具安装成功后,可以通过 gf 或者 gf -h 查看所有支持的命令。复杂的命令可以通过 gf help COMMAND 或者 gf COMMAND -h 查看更详细的使用帮助信息,例如: gf help gengf gen -h

注意事项

1、工具运行初始化时将会自动打开 Go Modules 特性并设置反向代理地址为 https://goproxy.cn

2、部分命令需要您先安装好 Golang 基础的开发环境,环境安装具体请参考 环境安装 章节。

3、最新的 CLI 工具版本会随着最新的框架版本走。

命令总览

当前帮助文档以 gf cli v1.15.0 版本为例进行简单的介绍,详细的介绍信息请查看命令行帮助信息。本章内容信息可能会有滞后,最新的具体详细介绍请查看工具帮助信息。

$ gf
USAGE
gf COMMAND [ARGUMENT] [OPTION]

COMMAND
env show current Golang environment variables
get install or update GF to system in default...
gen automatically generate go files for ORM models...
mod extra features for go modules...
run running go codes with hot-compiled-like feature...
init create and initialize an empty GF project...
help show more information about a specified command
pack packing any file/directory to a resource file, or a go file...
build cross-building go project for lots of platforms...
docker create a docker image for current GF project...
swagger swagger feature for current project...
update update current gf binary to latest one (might need root/admin permission)
install install gf binary to system (might need root/admin permission)
version show current binary version info

OPTION
-y all yes for all command without prompt ask
-?,-h show this help or detail for specified command
-v,-i show version information

ADDITIONAL
Use 'gf help COMMAND' or 'gf COMMAND -h' for detail about a command, which has '...'
in the tail of their comments.