Skip to content

v0.7.0

Choose a tag to compare

@jefflinse jefflinse released this 06 Jun 00:47
· 19 commits to main since this release

Interactive request-body forms

clic now compiles an OpenAPI operation's request-body schema into an interactive terminal form. Pass -i (--interactive) to a body-carrying command and fill it in instead of hand-writing JSON:

clic -i --server https://petstore3.swagger.io/api/v3 \
  https://petstore3.swagger.io/api/v3/openapi.json pet create
  • Text inputs for strings/numbers, a confirm for booleans, a select for enum values, and grouped fields for nested objects.
  • Scalar lists are entered one per line; lists of objects are gathered with a repeatable "add another?" prompt.
  • Required fields are validated; optional fields left blank are omitted.
  • --body still works and takes precedence — -i only prompts when no --body is given.

Breaking: global flags now go before the spec

clic's own flags (--server, -i, and the auth flags --token / --username / --password / --api-key) are now parsed by the launcher before the spec, and everything after the spec is passed through to the generated app as its own arguments:

# before: clic ./api.yaml --token "$T" users get 42
# now:    clic --token "$T" ./api.yaml users get 42

This makes the spec a clean namespace boundary, so a clic flag can no longer collide with a spec parameter of the same name (e.g. a server query parameter).