← 返回命令列表

Linux command

gup 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Update all binaries

gup update

List all installed

gup list

Update all binaries

gup update --exclude=[binary1,binary2]

Preview updates

gup update --dry-run

Check

gup check

Remove

gup remove [binary_name]

Export

gup export

Reinstall

gup import --input=[path/to/gup.json]

说明

gup updates binaries installed by go install to the latest version. It scans the directory pointed to by GOBIN (or $GOPATH/bin), inspects each binary's embedded module information, and rebuilds them in parallel using goroutines. This makes upgrading large collections of Go-based CLI tools significantly faster than running go install manually for each one. The tool reads version metadata embedded in Go binaries since Go 1.17 and feeds the original module path back into go install. Binaries built without module information cannot be updated and are skipped with a warning. In addition to updates, gup provides subcommands for listing, removing, checking, exporting, and re-importing binaries, making it useful for replicating a Go toolchain across machines.

参数

update
Update all binaries under $GOPATH/bin to the latest version using goroutines.
list
Display all installed binaries with their import paths and versions.
remove _binary_
Delete the specified binary from $GOPATH/bin or $GOBIN.
check
Verify whether each installed binary is at its latest version without updating.
export
Write the current set of binaries to a gup.json configuration file.
import
Install or restore binaries listed in a gup.json file.
man
Generate man pages (Linux/macOS).
completion
Generate shell completion scripts.
version
Print version information.
-e, --exclude _list_
Comma-separated list of binaries to skip during update.
--dry-run
Show what would be done without performing any updates.
--notify
Display a desktop notification when the operation finishes.
--main
Use the @main module channel when updating.
--master
Use the @master module channel when updating.
--latest
Use the @latest module channel when updating.
--force
Skip confirmation prompts (used with remove).

FAQ

What is the gup command used for?

gup updates binaries installed by go install to the latest version. It scans the directory pointed to by GOBIN (or $GOPATH/bin), inspects each binary's embedded module information, and rebuilds them in parallel using goroutines. This makes upgrading large collections of Go-based CLI tools significantly faster than running go install manually for each one. The tool reads version metadata embedded in Go binaries since Go 1.17 and feeds the original module path back into go install. Binaries built without module information cannot be updated and are skipped with a warning. In addition to updates, gup provides subcommands for listing, removing, checking, exporting, and re-importing binaries, making it useful for replicating a Go toolchain across machines.

How do I run a basic gup example?

Run `gup update` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does update do in gup?

Update all binaries under $GOPATH/bin to the latest version using goroutines.