Skip to content

gmaps CLI: six subcommands, hermetic test suite, CI, agent skill - #1

Merged
gldc merged 5 commits into
mainfrom
feat/cli
Jul 24, 2026
Merged

gldc merged 5 commits into
mainfrom
feat/cli

Conversation

@gldc

@gldc gldc commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Implements the full CLI per the reviewed design: search, nearby, place, geocode, revgeocode, route — single stdlib-only file, fixed per-command field masks, JSON envelope + stable exit codes, key only via GMAPS_API_KEY env → X-Goog-Api-Key header, scrubbed from all output.

  • 78 hermetic tests (injected transport; exact URL/header/body assertions, verbatim field-mask table, exit-code map, key-redaction, Unicode)
  • CI: pytest on Python 3.11 + 3.13
  • README with agent contract + key setup; SKILL.md for agent harnesses
  • Adversarially code-reviewed pre-PR; both findings addressed (vacuous test dropped, revgeocode positional documented as a superset with --at= preferred)

🤖 Generated with Claude Code

gldc and others added 5 commits July 23, 2026 22:41
Single-file, stdlib-only Google Maps CLI wrapping Places API (New) Text
Search + Nearby + Details, Geocoding v4 forward/reverse, and Routes
computeRoutes. Compact JSON envelope on stdout, structured errors on
stderr, stable exit codes (0/2/3/4/5), and a `retryable` flag on every
error. The API key is read only from GMAPS_API_KEY, sent only via the
X-Goog-Api-Key header, and scrubbed from all output including error paths.

Field masks are fixed per subcommand in one table (the billing-SKU lever)
with a verbatim table-equality test guarding against cost regressions. The
HTTP layer is a single injectable transport, so the whole surface is tested
without network access: 79 hermetic tests covering the argparse surface,
per-command request URL/headers/body, output trimming, the exit-code map,
Unicode queries, --raw passthrough, and key redaction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub Actions workflow installing pytest via pip and running the hermetic
suite on both interpreter versions for every push to main and pull request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Real examples for all six subcommands; the agent contract (JSON envelope,
exit-code table, retryable semantics, key handling); GMAPS_API_KEY setup
via gcloud with --api-target restrictions; and the field-mask / billing-SKU
philosophy table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- delete test_search_trim_shape_default (vacuous — no assertions; coverage
  lives in test_search_trim_output)
- SKILL.md: portable agent-skill teaching the command surface, JSON/exit-code
  contract, and cost discipline
- README: SKILL.md pointer; prefer --at= form for revgeocode in wrappers

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gldc
gldc merged commit c750582 into main Jul 24, 2026
2 checks passed
@gldc
gldc deleted the feat/cli branch July 24, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant