gcloud artifacts go auth

NAME
gcloud artifacts go auth - print authentication commands for the GOAUTH environment variable
SYNOPSIS
gcloud artifacts go auth [URL …] --location=LOCATION [--json-key=JSON_KEY] [GCLOUD_WIDE_FLAG]
DESCRIPTION
This command implements the GOAUTH credential provider command introduced in Go 1.24. For more details about the GOAUTH environment variable, see https://pkg.go.dev/cmd/go#hdr-GOAUTH_environment_variable. When you configure the GOAUTH environment variable for repositories, Artifact Registry looks for credentials in the following order:
EXAMPLES
To configure the GOAUTH environment variable for repositories in us-central1 and use your credentials:
export GOAUTH="gcloud artifacts go auth --location=us-central1"

To configure the GOAUTH environment variable for repositories in us-central1 and use the credentials from a service account:

export GOAUTH="gcloud artifacts go auth --location=us-central1 --json-key=path/to/key.json"
POSITIONAL ARGUMENTS
[URL …]
A URL generated by Go to set up authentication.
REQUIRED FLAGS
--location=LOCATION
The location of the repository to print commands for.
OPTIONAL FLAGS
--json-key=JSON_KEY
The path to the JSON key file to use for authentication. If not specified, the authentication commands printed will use the token from the logged in user.
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account, --billing-project, --configuration, --flags-file, --flatten, --format, --help, --impersonate-service-account, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity.

Run $ gcloud help for details.