Files
zeekayandHanzo Dev 48182d419c readme: the quickstart calls classes the client has
The quickstart used KeysApi and the untyped-response example ModelsApi, and the
auth notes named DefaultApi and CommandsApi. None exists in src/Api or in the
v8.5.156 tag Packagist serves, so `composer require hanzoai/hanzoai` followed by
the quickstart died with "Class Hanzo\Cloud\Api\KeysApi not found". They now
use AccountApi::getAccountKeys (GET /v1/account/keys, what examples/hello.php
calls) and AiApi::getModelsRequest, both present at v8.5.156 and here.

scripts/readme refuses any *Api class the README names that src/Api lacks; it
runs in the hanzo.yml gate. It exits 1 on the old README and 0 now.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-23 11:08:03 -07:00
..

#!/bin/sh
# Every API class README.md names is one the generator emitted into src/Api.
# The quickstart called KeysApi and ModelsApi, which neither this tree nor any
# Packagist tag has had, so the first program a reader pasted died with
# "Class Hanzo\Cloud\Api\KeysApi not found".
set -eu
cd "$(dirname "$0")/.."

missing=$(grep -oE '\b[A-Z][A-Za-z0-9]*Api\b' README.md | sort -u | while read -r class; do
  [ -f "src/Api/$class.php" ] || printf ' %s' "$class"
done)
[ -z "$missing" ] || { echo "README.md names$missing; src/Api has no such class" >&2; exit 1; }
echo "README.md names only generated API classes"