Skip to content

gplay auth

Manage Google Play authentication.

gplay auth <subcommand> [flags]

Create a template config.json for authentication.

gplay auth init [flags]
Flag Description Default
--force Overwrite existing config.json false
--local Write config.json to ./.gplay in the current repo false

Set up Google Play authentication end-to-end.

gplay auth setup --auto [--project <id>] [flags]

One-command setup for Google Play authentication.

With –auto, gplay drives the whole flow via gcloud:

  1. Install the gcloud CLI if it is missing (Homebrew on macOS, curl on Linux)
  2. Log you into Google Cloud (gcloud auth login) if needed
  3. Enable the androidpublisher API
  4. Create a service account (–sa-name) and download a JSON key
  5. Store the profile in ~/.gplay/config.json
  6. Open Play Console for the one manual step: granting the account access

Example: gplay setup –auto # full automated setup gplay setup –auto –project my-gcp-project gplay setup –auto –dry-run # preview commands gplay setup –auto –no-browser # CI/agent friendly (no browser) gplay setup # print manual instructions

Flag Description Default
--auto Automate GCP service-account creation using gcloud false
--dry-run Print the gcloud commands without executing them false
--key-out Path to write the service-account JSON (defaults to ~/.gplay/<sa>.json) ``
--no-browser Do not open a browser (for login or the Play Console grant step) false
--no-install Do not auto-install gcloud when it is missing false
--output Output format: text (default), json text
--pretty Pretty-print JSON output false
--profile gplay auth profile to create default
--project GCP project ID (defaults to gcloud default) ``
--sa-name Service account name play-console-cli
--set-default Set as default profile in config true

Authenticate with Google Play Console using a service account.

gplay auth login --service-account <path> [flags]

Authenticate with Google Play Console using a service account.

Service accounts are required for the Google Play Android Developer API. See README.md for setup instructions.

Examples: gplay auth login –service-account /path/to/key.json gplay auth login –service-account key.json –profile work gplay auth login –service-account key.json –local

Flag Description Default
--local Write to local repo config false
--profile Profile name default
--service-account Path to service account JSON (required) ``
--set-default Set as default profile true

Switch the default auth profile.

gplay auth switch --profile <name>
Flag Description Default
--profile Profile name ``

Remove a stored auth profile.

gplay auth logout --profile <name> --confirm
Flag Description Default
--confirm Confirm removal false
--profile Profile name ``

Show authentication status.

gplay auth status [flags]
Flag Description Default
--output Output format: json (default), table, markdown json
--pretty Pretty-print JSON output false

Diagnose authentication configuration issues.

gplay auth doctor [flags]
Flag Description Default
--confirm Required with –fix to apply changes (without it, –fix does a dry run) false
--fix Attempt to auto-fix detected issues false
--output Output format: text (default), json text
--pretty Pretty-print JSON output false