This command is only for downloading and installing precompiled binaries. If the tools are installed via the go install command, there is no need to manually use the install command to install the gf tool.

Download and Install

Download the Latest Version

Mac&Linux Quick Download Command

  1. wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(go env GOOS)_$(go env GOARCH) && chmod +x gf && ./gf install -y && rm ./gf

Windows Requires Manual Download

Determine the current project’s goframe dependency version, check your system information:

  1. go env GOOS
  2. go env GOARCH

Download link: releases

Install via go install

  1. go install github.com/gogf/gf/cmd/gf/v2@latest # Latest version
  2. go install github.com/gogf/gf/cmd/gf/v2@v2.5.5 # Specify version (version needs to be >= v2.5.5)

Download Other Versions

v2 Version

Precompiled binary download: releases

Source code: gf/cmd/gf

v1 Version

Precompiled binary download: releases

Source code: gogf/gf-cli

Usage

Project address: https://github.com/gogf/gf/tree/master/cmd/gf

Usage: ./gf install

This command is usually executed after the gf command line tool is downloaded locally (note execution permissions), to install the gf command into directories supported by the default system environment variables, so that the gf tool can be used anywhere in the system.

Installation - 图1note

Some systems require administrator permissions.

If users under MacOS using zsh encounter alias conflicts, it can be resolved by alias gf=gf. After running once, the gf tool will automatically modify the alias settings in the profile, and users can just re-login (or reopen the terminal).

Usage Example

  1. $ ./gf_darwin_amd64 install
  2. I found some installable paths for you(from $PATH):
  3. Id | Writable | Installed | Path
  4. 0 | true | true | /usr/local/bin
  5. 1 | true | false | /Users/john/Workspace/Go/GOPATH/bin
  6. 2 | true | false | /Users/john/.gvm/bin
  7. 4 | true | false | /Users/john/.ft
  8. please choose one installation destination [default 0]:
  9. gf binary is successfully installed to: /usr/local/bin