gcloud-authlisted
Install: claude install-skill f5-sales-demo/marketplace
**Canonical skill URI**: `skill://gcloud:gcloud-auth`
# Google Cloud CLI Authentication (Container-Adapted)
This skill guides authentication for headless container environments
where browser-based login may not be available.
## Authentication Methods
### Method 1: Service Account Key via Environment Variable (Recommended for Automation)
Best for CI/CD and automated environments. Uses the
`GOOGLE_APPLICATION_CREDENTIALS` environment variable pointing to
a service account key file.
**Prerequisites:**
- Service account created with appropriate IAM roles
- JSON key file downloaded and accessible in the container
- `GOOGLE_APPLICATION_CREDENTIALS` set to the key file path
**Command:**
```bash
gcloud auth activate-service-account \
--key-file "$GOOGLE_APPLICATION_CREDENTIALS"
```
### Method 2: Explicit Service Account Key File
Use when the key file path is known but not set as an environment
variable.
**Command:**
```bash
gcloud auth activate-service-account \
--key-file <path-to-key-file.json>
```
### Method 3: Headless Browser Login (No Launch Browser)
Use in container environments where a browser cannot open directly.
Prints a URL for the user to visit in an external browser.
**Command:**
```bash
gcloud auth login --no-launch-browser
```
### Method 4: Browser Login
Works when a browser is available (VNC enabled or desktop
environment).
**Command:**
```bash
gcloud auth login
```
### Application Default Credentials
For applications that use Google Cloud