auth
Manage authentication, credentials, and named profiles.
Commands
| Command | Description |
|---|---|
auth login | Authenticate with Google Play Developer API |
auth logout | Clear stored credentials and token cache |
auth status | Show current authentication status |
auth whoami | Show current authenticated identity |
auth profiles | List configured profiles |
auth switch | Switch to a named profile |
auth login
Authenticate with the Google Play Developer API using a service account key file or Application Default Credentials.
Synopsis
gpc auth login [options]Options
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--service-account | string | Path to service account JSON key file | ||
--adc | boolean | false | Use Application Default Credentials | |
--profile | string | Store credentials under a named profile |
Example
Authenticate with a service account:
gpc auth login --service-account ./service-account-key.jsonAuthenticated as play-api@my-project.iam.gserviceaccount.com
Project: my-projectStore under a named profile:
gpc auth login \
--service-account ./production-key.json \
--profile productionProfile "production" configured with play-api@my-project.iam.gserviceaccount.com
Project: my-projectUse Application Default Credentials:
gpc auth login --adcCI environment (no interactive prompts):
export GPC_SERVICE_ACCOUNT="$(cat service-account-key.json)"
gpc auth statusauth logout
Clear stored credentials and the local token cache.
Synopsis
gpc auth logoutOptions
No command-specific options.
Example
gpc auth logoutCredentials and token cache cleared.auth status
Show the current authentication status including the authenticated account and project.
Synopsis
gpc auth statusOptions
No command-specific options.
Example
When authenticated:
gpc auth status{
"authenticated": true,
"account": "play-api@my-project.iam.gserviceaccount.com",
"project": "my-project",
"profile": "production"
}When not authenticated:
gpc auth status{
"authenticated": false,
"error": "No service account configured",
"suggestion": "Run 'gpc auth login --service-account <path>' to authenticate"
}Exits with code 3 if not authenticated.
auth whoami
Print the email address of the currently authenticated service account.
Synopsis
gpc auth whoamiOptions
No command-specific options.
Example
gpc auth whoamiplay-api@my-project.iam.gserviceaccount.comIf not authenticated, exits with code 3:
Not authenticated. Run: gpc auth loginauth profiles
List all configured authentication profiles.
Synopsis
gpc auth profilesOptions
No command-specific options.
Example
gpc auth profiles[
{ "name": "default", "active": false },
{ "name": "production", "active": true },
{ "name": "staging", "active": false }
]When no profiles exist:
No profiles configured. Use: gpc auth login --service-account <path> --profile <name>auth switch
Switch the active authentication profile.
Synopsis
gpc auth switch <profile>Options
No command-specific options.
Example
gpc auth switch productionSwitched to profile "production"
Service account: ./production-key.jsonSwitch to staging:
gpc auth switch stagingIf the profile does not exist, exits with code 2.
Related
- config -- CLI configuration
- Authentication Guide -- Detailed authentication setup