CLI to cache Datum OpenAPI specs and generate SDKs via kubernetes-client/gen.
datumctlauthenticated in your environment (fordatumctl auth get-token).- Docker (for the generator scripts).
- Go 1.22+.
direnv allow
Or:
nix develop
go build ./cmd/datum-sdk-gen
# Login once if needed
# datumctl auth login
# Cache OpenAPI v2 (required for generation)
./datum-sdk-gen sync --format v2
# Generate Go + TypeScript clients
./datum-sdk-gen generate \
--languages go,typescript
./datum-sdk-gen sync \
--cache-dir cache \
--format v3
Key flags:
--format v3|v2: v3 downloads per-group specs; v2 downloads the platform spec.--organization/--project/--platform-wide: control plane scope.--host: override the API host (otherwise derived from the token issuer).--tokenor--token-command: supply a bearer token (defaults todatumctl auth get-token --output token).
Cache layout:
cache/
<host>/<scope>/<timestamp>/
index.json
specs/ # v3 format
openapi_v2.json # v2 format
LATEST is stored at the scope root to point at the newest timestamp.
./datum-sdk-gen generate \
--languages go,typescript
Notes:
- The current generator integration expects OpenAPI v2. Run
sync --format v2first. - The generator uses
openapi-generator-clidirectly (no Docker required). - If
--hostis not provided, the generator will use the token (via--token-command) to derive the API host.
- Per-group SDK generation is only wired for OpenAPI v3 caching;
kubernetes-client/genexpects v2. - V3-to-V2 conversion is not yet implemented.