For automation involving Workspace Admin, groups, org-units, or Keep, use a service-account key with domain-wide delegation. You must store the key for the Workspace admin identity you intend to impersonate.
Note: For Cloud Identity Groups commands, ensure https://www.googleapis.com/auth/cloud-identity.groups.readonly is included in your domain-wide delegation settings.
# Set the service account key for an admin identity
gog auth service-account set admin@example.com --key ~/Downloads/service-account.json
# Check the status of the service account
gog auth service-account status admin@example.com
# Use the service account for Cloud Identity Groups
gog --account admin@example.com groups list
gog --account admin@example.com groups members engineering@example.com
# Use the service account for Admin SDK commands
gog --account admin@example.com admin users create ada@example.com \
--first-name Ada \
--last-name Lovelace \
--change-password