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: 10000Benefits
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
- Turning API documentation examples into tests
- Migrating a folder of shell scripts
- Sharing a test as a one-line curl command
- Reproducing a request from browser dev tools