>_ RESTERM
v1.10.2
cli.md

docs CLI

Import curl and OpenAPI

Turn curl commands and OpenAPI documents into request files.

Convert curl into Resterm request files:

shell
resterm --from-curl "curl https://example.com -H 'X-Test: 1'" --http-out example.http
resterm --from-curl ./requests.curl --http-out requests.http
cat requests.curl | resterm --from-curl - --http-out requests.http

Generate a collection from OpenAPI:

shell
resterm \
  --from-openapi openapi.yml \
  --http-out openapi.http \
  --openapi-mode both \
  --openapi-resolve-refs \
  --openapi-server-index 1

--from-openapi also takes an http(s) URL and fetches the spec directly:

shell
resterm --from-openapi https://petstore3.swagger.io/api/v3/openapi.json --http-out petstore.http

For a URL spec, relative servers URLs are resolved against it, and --openapi-resolve-refs follows external $refs over HTTP. --insecure and --proxy apply to the fetch.

Mock generation emits every concrete OpenAPI response status and media example. Named examples become named scenarios, and when a response has no example Resterm samples its schema. Range responses such as 2XX and default are skipped. External examples and binary example bodies cannot produce a deterministic inline mock, so they are dropped with a diagnostic.

Search

↑↓ moveEnter openEsc close

Help

These keys work like the ones in the TUI.

/
Search the docs (also Ctrl K)
j k
Scroll down and up
g g G
Jump to the top or the bottom
[ ]
Previous and next docs page
g d
Docs index
g h
Home page
t
Switch between dark and light
?
Show this help
Esc
Close a dialog