agentleFS
tamtomtamtom/play-console-cli/Agents.md

play-console-cli

AGENTS.md279 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 code style.

    Of the AGENTS.md files we read, the 33,398 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.

  • In this repository2 other files it gives its agents.

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
  1. Very specific:

    Explicit flags: Always --package not -p, --output not -o

    line 7
  2. Very specific:

    No interactive prompts: Use --confirm flags for destructive operations

    line 9
  3. Very specific:

    Do not memorize commands. Always check --help for the current interface.

    line 23
  4. Distinctive:

    Use TDD for everything: bugs, refactors, and new features.

    line 75
  5. Distinctive:

    Start with a failing test that captures the expected behavior and edge cases.

    line 76
  6. Distinctive:

    Verify the test fails for the right reason before implementing.

    line 78
  7. Very specific:

    Every command carries a test-coverage class in docs/testing/command-coverage.json: sandbox (hermetic fake-API black-box), live (weekly live …

    line 82
  8. Very specific:

    Always set UsageFunc: shared.DefaultUsageFunc for command groups and subcommands.

    line 91
  9. Distinctive:

    Use the existing patterns in other command files as reference.

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
Agents.md

AGENTS.md

A fast, lightweight, AI-agent-friendly CLI for Google Play Console. Built in Go with ffcli.

Core Principles

  • Explicit flags: Always --package not -p, --output not -o
  • JSON-first: Minified JSON by default (saves tokens), --output table/markdown for humans
  • No interactive prompts: Use --confirm flags for destructive operations
  • Pagination: --paginate fetches all pages automatically
  • Dry run: --dry-run intercepts 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 command

Do 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 history

Notable 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 by auth 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:

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 + build

Testing 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.DefaultUsageFunc for command groups and subcommands.
  • For outbound HTTP, use shared.ContextWithTimeout (or shared.ContextWithUploadTimeout) so GPLAY_TIMEOUT applies.
  • 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 --confirm

Environment Variables

VariablePurpose
GPLAY_SERVICE_ACCOUNT_JSONPath to the service account JSON key (canonical)
GPLAY_SERVICE_ACCOUNTPath to the service account JSON key (legacy alias, some commands)
GPLAY_PACKAGEDefault package name
GPLAY_PROFILEActive profile name
GPLAY_TIMEOUTRequest timeout (e.g., 90s, 2m)
GPLAY_TIMEOUT_SECONDSTimeout in seconds (alternative)
GPLAY_UPLOAD_TIMEOUTUpload timeout (e.g., 5m, 10m)
GPLAY_DEBUGSuppress progress spinners (1 or api; HTTP logging is not implemented)
GPLAY_NO_UPDATEDisable update checks
GPLAY_MAX_RETRIESMax retries for transient read-only requests (default: 3; 0 disables retries)
GPLAY_RETRY_DELAYBase exponential-backoff delay for read-only retries (default: 1s)
GPLAY_DEFAULT_OUTPUTDefault output format (json, table, markdown)
GPLAY_API_BASE_URLTest 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 script

Agent Skills

For detailed workflow guidance, install the gplay skills:

npx skills add tamtom/gplay-cli-skills

Available skills:

  • gplay-cli-usage - Flags, output formats, pagination, edit sessions
  • gplay-release-flow - End-to-end release, tracks, and rollout workflows
  • gplay-rollout-management - Staged rollout orchestration and monitoring
  • gplay-vitals-monitoring - Crashes, ANRs, performance, and error monitoring
  • gplay-iap-setup - In-app products, subscriptions, base plans, offers, bulk localization
  • gplay-ppp-pricing - Region-specific purchasing-power pricing
  • gplay-purchase-verification - Server-side purchase/subscription verification
  • gplay-review-management - Review monitoring, filtering, and replies
  • gplay-user-management - Developer account user and grant management
  • gplay-metadata-sync - Metadata and localization sync (incl. Fastlane format)
  • gplay-migrate-fastlane - Fastlane metadata migration
  • gplay-preflight - Offline AAB/APK scanning: nine scanners, manifest decoding, CI gating
  • gplay-submission-checks - Pre-submission validation
  • gplay-screenshot-automation - Upload and validate Play Store screenshots
  • gplay-testers-orchestration - Closed-testing tracks and tester management
  • gplay-gradle-build - Build and sign with Gradle before upload
  • gplay-reports-download - Financial and statistics report download from GCS

Skills repository: https://github.com/tamtom/gplay-cli-skills

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.