Authentication & accounts
gplay authenticates with a Google Cloud service account: it reads the service-account JSON, signs a JWT, exchanges it for a short-lived OAuth2 access token, and uses that token for all Google Play Developer API calls.
Accounts
Section titled “Accounts”An Account is a named credential profile registered in gplay — the local registration of one service-account JSON, with a human-friendly name. Multiple Accounts can coexist (different apps, different orgs, dev vs CI), and exactly one is active at a time.
gplay auth login --service-account ./sa.json # register + set activegplay auth list # all Accounts, active markedgplay auth status # the active Accountgplay auth logout # remove an AccountThe credential itself lives in your OS keystore (Keychain on macOS,
Secret Service on Linux, Credential Manager on Windows), with a 0600
fallback file where no keystore is available. The config file only records
which Accounts exist and which is active — never the private key.
Credential resolution precedence
Section titled “Credential resolution precedence”When a command needs a credential, the first match wins:
--service-account <path-or-json>flag--account <name>flag (selects a stored Account)GPLAY_SERVICE_ACCOUNTenv var (path or inline JSON)GPLAY_ACCOUNTenv var (name of a stored Account)- The Account marked active in the gplay config
If nothing resolves, the command exits with code 10 and points at
gplay auth login.
Absent vs. invalid credentials
Section titled “Absent vs. invalid credentials”The two failure modes are deliberately kept apart:
- Absent — no source is configured. A benign state: commands that need a
credential exit
10with a pointer toauth login, butgplay auth statusreports "No active account" and exits0, andapps list(local registry) still works. - Invalid — a credential was provided but its bytes are unusable
(malformed JSON, missing required field, unreadable file). Always an
error: exit
10with the underlying cause, on every command — includingauth status, which never masks a corrupt credential as "no account".
gplay auth doctor
Section titled “gplay auth doctor”The diagnostic command runs four checks in order, stopping at the first hard
failure: JSON well-formed → token mints → androidpublisher scope present →
a real edits.insert/edits.delete round-trip against your package. It
exists because the most common failure is "service account created but
never invited on the app in Play Console" — and that only surfaces on a
real API call.