This document summarizes what climate already supports when generating CLIs,
what is partially supported, and what should be designed/implemented next.
- OpenAPI version: 3.x (3.0 / 3.1 input accepted by parser/validator)
- Main commands affected:
generate,compose,mock,skill generate
| OpenAPI feature | Status | Current behavior | Next step |
|---|---|---|---|
info, paths, HTTP methods |
✅ Implemented | Used as core input for command tree generation | Keep stable |
| Path/query/header parameters | ✅ Implemented | Converted to CLI flags | Add richer validations from schema constraints |
Request body (application/json) |
✅ Implemented | Supported via generated payload flags | Add optional strict schema validation before send |
| Response handling | ✅ Implemented | Structured output + generated error envelope | Add per-status typed formatting hooks |
| Auth: API key / bearer / basic / OAuth2 | ✅ Implemented | Mapped to generated auth flags/env vars | Add multi-scheme policy docs |
| Tags → command groups | ✅ Implemented | Tag-based group hierarchy | Add optional custom grouping strategies |
components.schemas + $ref |
✅ Implemented | Used in generator and mock response synthesis | Improve support for schema combiners |
Multi-spec composition (compose) |
✅ Implemented | Path prefixing + component namespacing + merge | Add callbacks/webhooks merge policy |
Local mock simulator (mock) |
✅ Implemented | Auto responses from spec schema + latency | Add optional examples-first mode |
enum |
✅ Implemented (mock) / |
Mock prefers first enum value | Add flag-level enum validation/help text |
allOf, oneOf, anyOf, not |
Core flow works for simple schemas; advanced combiners not fully synthesized | Add schema normalizer for combiners | |
servers and server variables |
✅ Implemented | Generated CLIs use the primary server URL and support server-template interpolation via --server-var-<name> and <CLI>_SERVER_VAR_<NAME> env vars |
Keep stable |
callbacks |
✅ Implemented / |
Generated CLIs expose callback-derived named event commands via events list, events listen <name>, and events emit <name> |
Improve callback expression/path inference and richer config-driven defaults |
webhooks (3.1) |
✅ Implemented / |
Top-level webhooks become named generated event commands with local listener + emit flow |
Add richer schema-aware event metadata and replay tooling |
| Links | ❌ Planned | Ignored | Add optional “follow-up command hint” output |
Examples (example / examples) |
Not consistently preferred in generation | Use examples as first-class sample payload/response source |
Some APIs are event-driven and include webhooks/callbacks instead of (or in addition to) plain request/response endpoints.
Current baseline for generated CLIs:
- Named event surface
myapi events listmyapi events listen <event-name>myapi events emit <event-name> --target-url ...
- Local config store
myapi config listmyapi config setmyapi config set --secret events.signing_secret ...
- Optional tunnel exposure
--tunnel auto|cloudflared
- Generic HMAC signatures
- configurable header, algorithm, and optional timestamp signing
- Structured event stream
- startup, tunnel, and received-event records are streamed as JSON
Proposed next direction for generated CLIs:
- Add richer event metadata to OpenAPI extensions
- signature defaults, path overrides, and replay hints
- Support production replay/import
myapi events import --file payload.json --event <name>myapi events replay --source prod-export.ndjson
- Compose awareness
- In
compose, namespace event names with prefix (same as path/components)
- In
- Mock integration
climate mockcan emit synthetic webhook payloads at intervals or on demand for integration tests
Pagination should be generated as a first-class UX pattern, regardless of API style:
- Page/pageSize style (
page,size,limit,offset) - Cursor style (
cursor,next,before,after) - Token style (
nextPageToken) - Link-header style (
Link: <...>; rel="next")
Proposed CLI conventions:
--allto auto-fetch all pages safely--max-items <n>as guardrail--page-size <n>override when supported--starting-token <token>for resume--pagination-debugto print paging metadata
Safety defaults:
--allshould require confirmation for very large transfers unless--yesis set- bounded retries/backoff for transient failures
- Pagination abstraction + generated paging flags (
--all,--max-items) - config-driven secret and signature UX hardening
- production replay/import workflow for named events
- examples-first generation mode (payloads + mock responses)
- advanced schema combiner normalization (
allOf/oneOf/anyOf)