play-console-cli
AGENTS.md256 starsChanged 10 months agoMITView on GitHub
A fast, lightweight, AI-agent-friendly CLI for Google Play Console. Built in Go with ffcli. Use --help to discover commands and flags. The CLI is self-documenting: Do not memorize commands. Always check --help for the current interface. For Google Play Android Publisher API documentation: - API Overview: https://developers.google.com/android-publisher - REST Reference: https://developers.google.com/android-publisher/api-ref/rest Every command carries a test-coverage class in docs/testing/command-coverage.json: sandbox (hermetic fake-API black-box), live (weekly live smoke), offline (cmdtest/unit only), or manual. The CI gate internal/covgate fails when a command…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this Agents.md into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Explicit flags: Always --package not -p, --output not -o
- Very specific: line 9
No interactive prompts: Use --confirm flags for destructive operations
- Very specific: line 23
Do not memorize commands. Always check --help for the current interface.
- Distinctive: line 75
Use TDD for everything: bugs, refactors, and new features.
- Distinctive: line 76
Start with a failing test that captures the expected behavior and edge cases.
- Distinctive: line 78
Verify the test fails for the right reason before implementing.
- Very specific: line 82
Every command carries a test-coverage class in docs/testing/command-coverage.json: sandbox (hermetic fake-API black-box), live (weekly live …
- Very specific: line 91
Always set UsageFunc: shared.DefaultUsageFunc for command groups and subcommands.
- Distinctive: line 94
Use the existing patterns in other command files as reference.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
A fast, lightweight, AI-agent-friendly CLI for Google Play Console. Built in Go with ffcli.
Core Principles
- Explicit flags: Always
--packagenot-p,--outputnot-o - JSON-first: Minified JSON by default (saves tokens),
--output table/markdownfor humans - No interactive prompts: Use
--confirmflags for destructive operations - Pagination:
--paginatefetches all pages automatically - Dry run:
--dry-runintercepts write HTTP methods and logs to stderr
Discovering Commands
Use --help to discover commands and flags. The CLI is self-documenting:
gplay --help # List all commands
gplay tracks --help # List tracks subcommands
gplay tracks list --help # Show all flags for a commandDo not memorize commands. Always check --help for the current interface.
Command Reference
gplay apps list # List apps accessible by service account
gplay init # Initialize project configuration
gplay docs generate # Generate markdown command reference
gplay vitals crashes # Crash clusters and reports
gplay vitals performance # Performance metrics (startup, rendering, battery)
gplay vitals errors # Error issues and reports
gplay users # Manage developer account users (list, create, update, delete)
gplay grants # Manage per-app permission grants (create, update, delete)
gplay purchase-options # Manage OTP purchase options (batch-update-states, batch-delete)
gplay otp-offers # Manage OTP purchase option offers (list, activate, deactivate, cancel, batch ops)
gplay update # Self-update the CLI binary
gplay notify send # Send webhook notifications (Slack, Discord, generic)
gplay migrate fastlane # Migrate from Fastlane metadata
gplay reports financial # Financial reports (list/download from GCS)
gplay reports stats # Statistics reports (list/download from GCS)
gplay custom-apps create # Publish private apps via Managed Google Play
gplay preflight # Offline 9-scanner compliance scan of an AAB/APK
gplay listings locales # List available locales with validation
gplay release-notes generate # Generate release notes from git historyNotable Flags
--dry-run(global): Intercepts write HTTP methods, logs requests to stderr without executing--video: Attach video URL when updating listings--fix/--confirm: Auto-fix issues found byauth doctor--listings-dir,--screenshots-dir,--skip-metadata,--skip-screenshots: Control release metadata bundling- Plain text release notes (no JSON): Auto-assigned to
en-US
Documentation
For Google Play Android Publisher API documentation:
- API Overview: https://developers.google.com/android-publisher
- REST Reference: https://developers.google.com/android-publisher/api-ref/rest
Build & Test
make build # Build binary
make test # Run tests (always run before committing)
make lint # Lint code
make format # Format code
make dev # format + lint + test + buildTesting Discipline
- Use TDD for everything: bugs, refactors, and new features.
- Start with a failing test that captures the expected behavior and edge cases.
- For new features, begin with CLI-level tests (flags, output, errors) and add unit tests for core logic.
- Verify the test fails for the right reason before implementing; keep tests green incrementally.
Command coverage manifest
Every command carries a test-coverage class in docs/testing/command-coverage.json:
sandbox (hermetic fake-API black-box), live (weekly live smoke), offline
(cmdtest/unit only), or manual. The CI gate internal/covgate fails when a
command has no class. After you add or remove a command, run
go run ./tools/covmanifest to refresh the manifest.
CLI Implementation Checklist
- Register new commands in
internal/cli/registry/registry.go. - Always set
UsageFunc: shared.DefaultUsageFuncfor command groups and subcommands. - For outbound HTTP, use
shared.ContextWithTimeout(orshared.ContextWithUploadTimeout) soGPLAY_TIMEOUTapplies. - Validate required flags and assert stderr error messages in tests (not just
flag.ErrHelp). - Use the existing patterns in other command files as reference.
Authentication
Service accounts are required for the Google Play Android Developer API. Create one in Google Cloud Console and grant access in Play Console. Credentials are stored in config with file path reference. Never commit service account JSON files.
# Login with service account
gplay auth login --service-account /path/to/key.json
# Validate setup
gplay auth doctor
# Auto-fix issues (with confirmation)
gplay auth doctor --fix --confirmEnvironment Variables
| Variable | Purpose |
GPLAY_SERVICE_ACCOUNT_JSON | Path to the service account JSON key (canonical) |
GPLAY_SERVICE_ACCOUNT | Path to the service account JSON key (legacy alias, some commands) |
GPLAY_PACKAGE | Default package name |
GPLAY_PROFILE | Active profile name |
GPLAY_TIMEOUT | Request timeout (e.g., 90s, 2m) |
GPLAY_TIMEOUT_SECONDS | Timeout in seconds (alternative) |
GPLAY_UPLOAD_TIMEOUT | Upload timeout (e.g., 5m, 10m) |
GPLAY_DEBUG | Suppress progress spinners (1 or api; HTTP logging is not implemented) |
GPLAY_NO_UPDATE | Disable update checks |
GPLAY_MAX_RETRIES | Max retries for transient read-only requests (default: 3; 0 disables retries) |
GPLAY_RETRY_DELAY | Base exponential-backoff delay for read-only retries (default: 1s) |
GPLAY_DEFAULT_OUTPUT | Default output format (json, table, markdown) |
GPLAY_API_BASE_URL | Test only. Points the API client at a local sandbox server. Loopback hosts only; any other host is refused because the client attaches the OAuth token to the request. |
Config File
Global config: ~/.gplay/config.json
Local config: ./.gplay/config.json (takes precedence)
{
"package_name": "com.example.app",
"timeout": "120s",
"upload_timeout": "5m",
"max_retries": 3
}Project Structure
play-console-cli/
├── cmd/ # Main entry point
├── internal/
│ ├── cli/ # Command implementations
│ │ ├── apps/ # App listing commands
│ │ ├── docs/ # Documentation generation
│ │ ├── initcmd/ # Project initialization
│ │ ├── migrate/ # Fastlane migration
│ │ ├── notify/ # Webhook notifications
│ │ ├── registry/ # Command registration
│ │ ├── reports/ # Financial & stats reports
│ │ ├── shared/ # Shared utilities
│ │ ├── updatecmd/ # Self-update command
│ │ ├── users/ # User management
│ │ ├── vitals/ # Vitals command group
│ │ │ ├── errors/ # ANR and error reports
│ │ │ └── performance/ # Startup, rendering, battery
│ │ └── */ # Other command packages
│ ├── cmdtest/ # Black-box CLI testing
│ ├── config/ # Configuration management
│ ├── gcsclient/ # Google Cloud Storage client (reports)
│ ├── output/ # Output formatting (table, ANSI colors)
│ ├── playclient/ # Google Play API client
│ ├── reportingclient/ # Play Developer Reporting API client
│ ├── testutil/ # Shared test helpers
│ ├── update/ # Self-update functionality
│ └── version/ # Version information
├── .github/workflows/ # CI/CD workflows
├── Makefile # Build automation
└── install.sh # Installation scriptAgent Skills
For detailed workflow guidance, install the gplay skills:
npx skills add tamtom/gplay-cli-skillsAvailable skills:
gplay-cli-usage- Flags, output formats, pagination, edit sessionsgplay-release-flow- End-to-end release, tracks, and rollout workflowsgplay-rollout-management- Staged rollout orchestration and monitoringgplay-vitals-monitoring- Crashes, ANRs, performance, and error monitoringgplay-iap-setup- In-app products, subscriptions, base plans, offers, bulk localizationgplay-ppp-pricing- Region-specific purchasing-power pricinggplay-purchase-verification- Server-side purchase/subscription verificationgplay-review-management- Review monitoring, filtering, and repliesgplay-user-management- Developer account user and grant managementgplay-metadata-sync- Metadata and localization sync (incl. Fastlane format)gplay-migrate-fastlane- Fastlane metadata migrationgplay-preflight- Offline AAB/APK scanning: nine scanners, manifest decoding, CI gatinggplay-submission-checks- Pre-submission validationgplay-screenshot-automation- Upload and validate Play Store screenshotsgplay-testers-orchestration- Closed-testing tracks and tester managementgplay-gradle-build- Build and sign with Gradle before uploadgplay-reports-download- Financial and statistics report download from GCS
Skills repository: https://github.com/tamtom/gplay-cli-skills
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

