cURL to Axios (TypeScript)
Generate a typed axios.request<TResponse>() call from any cURL command.
Typed Axios requests
Query params are passed through Axios' params option, the JSON body is sent as data, and the response is typed with Axios' generic.
Why curl2ts?
- Recursive type inference. JSON request bodies become clean, named
interfaces — nested objects get their own interface, arrays are typed, and keys missing from some array items become optional. - Typed query parameters. The URL query string becomes a
QueryParamsinterface, passed as an optional argument. - Fetch, Axios or Ky. Every client returns
Promise<TResponse>so you can plug in your own response type. - Private by design. Your Bearer tokens and cookies never leave the browser tab. There is no backend.
Supported cURL flags
-X / --request, -H / --header, -d / --data / --data-raw / --data-binary,
--json, -u / --user, -b / --cookie, --url,
plus single, double and $'…' quoting and \ line continuations (Chrome / Firefox "Copy as cURL" works).