Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion content/automation/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ chmod +x ./deploys && sudo mv ./deploys /usr/local/bin/

The CLI accepts authentication three ways, in this order of precedence:

1. **`DEPLOYS_TOKEN`** — a Bearer token. Useful for short-lived personal use.
1. **`DEPLOYS_TOKEN`** — a Bearer token. Useful for short-lived personal use, and
for a [Google Cloud service-account](/api/overview/#authentication) access
token (see below).
2. **`DEPLOYS_AUTH_USER` + `DEPLOYS_AUTH_PASS`** — a [service account](/access/service-accounts/)
email and key, sent as HTTP Basic. The right choice for CI.
3. **Google default credentials**. If neither of the above is set, the CLI
Expand All @@ -39,6 +41,17 @@ export DEPLOYS_AUTH_PASS=…the key…
deploys me get
```

To use a **Google Cloud service account**, put a SA access token in
`DEPLOYS_TOKEN`. The token must carry the `userinfo.email` scope, and the SA's
email must be granted the permissions you need — see
[Google Cloud service-account auth](/api/overview/#authentication).

```bash
export DEPLOYS_TOKEN=$(gcloud auth print-access-token \
--scopes=https://www.googleapis.com/auth/userinfo.email)
deploys me get
```

## Command shape

```text
Expand Down