Skip to content

curl ⇄ YAML

Paste a curl command, get a test.

Convert curl commands, or a whole shell script, to YAML and back. Unknown flags come back as warnings, not errors. Postman collections convert too.

users.yaml
# curl-runner convert curl "curl https://api.example.com/users?page=2 \
#   -H 'Accept: application/json' -H 'Authorization: Bearer ${API_TOKEN}' -m 10"
request:
  method: GET
  url: https://api.example.com/users
  params:
    page: "2"
  headers:
    Accept: application/json
  auth:
    type: bearer
    token: "${API_TOKEN}"
  timeout: 10000

Benefits

  • From the docs to a test

    Copy the curl example from API docs or your browser’s network tab and turn it into a file in one command.

  • Understands curl

    Query strings become params, bearer headers become auth, -m becomes a timeout in milliseconds.

  • Both directions

    convert yaml prints the curl command for a file — handy for bug reports and teammates without curl-runner.

Good for

  1. Turning API documentation examples into tests
  2. Migrating a folder of shell scripts
  3. Sharing a test as a one-line curl command
  4. Reproducing a request from browser dev tools