File: //snap/google-cloud-cli/current/help/man/man1/gcloud_artifacts_go_auth.1
.TH "GCLOUD_ARTIFACTS_GO_AUTH" 1
.SH "NAME"
.HP
gcloud artifacts go auth \- print authentication commands for the GOAUTH environment variable
.SH "SYNOPSIS"
.HP
\f5gcloud artifacts go auth\fR [\fIURL\fR\ ...] \fB\-\-location\fR=\fILOCATION\fR [\fB\-\-json\-key\fR=\fIJSON_KEY\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "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:
.RS 2m
.IP "\(bu" 2m
Application Default Credentials (ADC)
.IP "\(bu" 2m
Credentials provided by the Google Cloud CLI, including user credentials from
the command \f5gcloud auth application\-default login\fR.
.RE
.sp
.SH "EXAMPLES"
To configure the GOAUTH environment variable for repositories in
\f5us\-central1\fR and use your credentials:
.RS 2m
$ export GOAUTH="gcloud artifacts go auth \-\-location=us\-central1"
.RE
To configure the GOAUTH environment variable for repositories in
\f5us\-central1\fR and use the credentials from a service account:
.RS 2m
$ export \e
GOAUTH="gcloud artifacts go auth \-\-location=us\-central1 \e
\-\-json\-key=path/to/key.json"
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
[\fIURL\fR ...]
A URL generated by Go to set up authentication.
.RE
.sp
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
The location of the repository to print commands for.
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-json\-key\fR=\fIJSON_KEY\fR
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.
.RE
.sp
.SH "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 \fB$ gcloud help\fR for details.