代码拉取完成,页面将自动刷新
English | 简体中文
gf-cli
是一款强大的GoFrame开发工具链,使得我们开发基于GoFrame
框架的项目更加便捷。
我们推荐大家安装指定平台预编译的二进制文件:
Linux (amd64)
: https://goframe.org/cli/linux_amd64/gf
Mac (amd64)
: https://goframe.org/cli/darwin_amd64/gf
Windows (amd64)
: https://goframe.org/cli/windows_amd64/gf.exe
下载完成后,通过gf install
命令安装。
Mac
wget https://goframe.org/cli/darwin_amd64/gf && chmod +x gf && ./gf install
如果您的终端使用的是
zsh
, 您需要执行alias gf=gf
命令以便解决gf
工具名称和git fetch
简化指令冲突的问题。
Linux
wget https://goframe.org/cli/linux_amd64/gf && chmod +x gf && ./gf install
Windows
下载后执行,随后根据提示执行安装。
git clone https://github.com/gogf/gf-cli
cd gf-cli && go build main.go && ./main install
git clone --branch v0.7.3 https://github.com/gogf/gf-cli
cd gf-cli && go build main.go && ./main install
注意:在
gf gen
命令中,由于sqlite
和oracle
数据库需要cgo
和gcc
支持,因此预编译的二进制中不提供对这两个数据库的支持,您需要手动修改源码,去掉对应源码文件中指定数据库类型的import
注释后手动编译支持。
$ 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 initialize an empty GF project at current working directory...
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.
完善详尽的中文文档请参考GoFrame
官网板块:开发工具
gf run
命令报错 pipe: too many open files
请执行ulimit -n 65535
命令扩展您当前终端会话支持的最大文件打开数,随后再执行gf run
。需要注意的是该命令仅对当前终端会话有效。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。