Reference

On this page

Run gup <command> --help for the same information in your terminal. Recipes that use these live in the cookbook.

Commands #

CommandWhat it does
gup update [BINARY...]Reinstall binaries at their update channel, in parallel
gup check [BINARY...]Report what is out of date; installs nothing
gup listList every binary under $GOBIN with its import path and version
gup exportWrite the installed set to gup.json
gup importInstall the set recorded in gup.json
gup pin TOOL[@VERSION] [VERSION]Hold a tool at an exact version
gup unpin TOOLLet a pinned tool update again
gup migrate BEFORE_PATH AFTER_PATH [BINARY...]Reinstall binaries from one $GOBIN into another
gup remove BINARY...Delete binaries from $GOBIN
gup completion [SHELL]Print or install shell completion
gup manGenerate man pages (Linux, macOS)
gup versionPrint the version, same as gup --version
gup bug-reportOpen a pre-filled GitHub issue

gup rm is an alias for gup remove. --no-color works on every command, as does the NO_COLOR environment variable.

Flags #

FlagCommandsMeaning
-n, --dry-runupdate, import, migrateReport what would happen, change nothing
-e, --excludeupdateComma-separated binaries to skip
-f, --fileupdate, check, list, import, export, pin, unpinUse this gup.json instead of the auto-detected one
-o, --outputexportPrint the config to STDOUT instead of writing it
--jsonupdate, check, listMachine-readable output
-q, --quietupdate, checkDrop up-to-date lines; keep changes, failures, and a summary
-j, --jobsupdate, check, import, migrateParallel workers (default: CPU count)
--timeoutupdate, check, import, migratePer-package limit, e.g. 90s, 5m; 0 means none
--ignore-go-updateupdate, checkCompare versions only, ignore Go-toolchain rebuilds
-m, --mainupdateUpdate these by @main (falls back to @master only when no main branch exists)
--masterupdateUpdate these by @master
--latestupdateUpdate these by @latest
-N, --notifyupdate, import, migrateDesktop notification when the run finishes
--forceremove (-f), migrateSkip the confirmation / overwrite an existing binary
--installcompletionWrite completion files to the user shell config paths
--no-colorallDisable colorized output
-V, --versionrootPrint the version

--json wins over --quiet when both are given: you get the full array.

gup.json #

export writes it, import reads it, and update/check read the update channel from it. The path is $XDG_CONFIG_HOME/gup/gup.json, or ./gup.json, in that order; --file overrides both. If both exist and no --file is given, gup fails and asks you to choose rather than picking one.

{
  "schema_version": 2,
  "packages": [
    {
      "name": "gal",
      "import_path": "github.com/nao1215/gal/cmd/gal",
      "version": "v1.1.1",
      "channel": "latest"
    },
    {
      "name": "golangci-lint",
      "import_path": "github.com/golangci/golangci-lint/cmd/golangci-lint",
      "version": "v1.62.0",
      "channel": "pinned"
    }
  ]
}

schema_version is 1 while nothing is pinned and 2 once anything is, so an environment with no pins keeps writing files older gup releases can read. gup reads both. A malformed file, an unknown channel, an unsupported schema_version, or a pinned entry with no concrete version is an error, not something to ignore — a saved channel is never quietly downgraded to latest.

JSON output fields #

FieldNotes
nameBinary name in $GOBIN
import_pathWhat go install would be given
module_pathModule that provides it
channellatest, main, master, or pinned
current_versionVersion of the installed binary
latest_versionEmpty for list and for pinned packages
pinned_versionOnly for channel: "pinned"
current_go_versionGo toolchain the binary was built with
installed_go_versionGo toolchain on this machine
statusinstalled, up-to-date, update-available, updated, pinned, pin-mismatch, error
errorOmitted when absent
hintNext step for the error, when gup has one

The array is valid JSON even on partial failure, and errors are also written to STDERR so STDOUT stays parseable.

Exit codes #

CodeWhen
0The command did its job — including check finding updates, and any command on an empty $GOBIN
1A usage error, a config error, or at least one package failed

Naming a binary that is not installed, or excluding every binary, is a usage error.