Convert curl commands to code in several languages

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • curl-to-php

    Convert curl commands to PHP code in your browser

  • Yeah, this is a really odd choice. I find https://incarnate.github.io/curl-to-php/ (found in the footer) way more interesting since it uses PHP's cURL lib

  • insomnia

    The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

  • I use Paw[1] for this, which is obviously a lot more powerful by allowing me to easily toggle and/or modify query params, headers, edit body as structured JSON/XML, etc. Probably doable in other API clients like Insomnia[2], too.

    [1] https://paw.cloud/

    [2] https://insomnia.rest/

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • curl-to-go

    Convert curl commands to Go code in your browser

  • blog

  • Seems to be mostly doing text-replacement and not actually understand what it's handling and what it can't actually do: https://github.com/icing/blog/blob/main/curl_on_a_weekend.md

  • Paw-cURLImporter

    Paw importer for cURL command lines

  • All 3 of these are linked to under "Related Tools".

    Those projects use a pretty basic tokenizer

    https://github.com/luckymarmot/Paw-cURLImporter/blob/master/...

    Insomnia and Postman use commander.js for their bash parsing which looks like it just splits on space:

    https://github.com/tj/commander.js/blob/02a124c7d58dbae2ef11...

    and only support a few of curl's options. Curlconverter uses tree-sitter's Bash grammar https://github.com/tree-sitter/tree-sitter-bash/ and tries to at least correctly discard all of curl's options and any options that curl used to have.

  • Commander.js

    node.js command-line interfaces made easy

  • All 3 of these are linked to under "Related Tools".

    Those projects use a pretty basic tokenizer

    https://github.com/luckymarmot/Paw-cURLImporter/blob/master/...

    Insomnia and Postman use commander.js for their bash parsing which looks like it just splits on space:

    https://github.com/tj/commander.js/blob/02a124c7d58dbae2ef11...

    and only support a few of curl's options. Curlconverter uses tree-sitter's Bash grammar https://github.com/tree-sitter/tree-sitter-bash/ and tries to at least correctly discard all of curl's options and any options that curl used to have.

  • tree-sitter-bash

    Bash grammar for tree-sitter

  • All 3 of these are linked to under "Related Tools".

    Those projects use a pretty basic tokenizer

    https://github.com/luckymarmot/Paw-cURLImporter/blob/master/...

    Insomnia and Postman use commander.js for their bash parsing which looks like it just splits on space:

    https://github.com/tj/commander.js/blob/02a124c7d58dbae2ef11...

    and only support a few of curl's options. Curlconverter uses tree-sitter's Bash grammar https://github.com/tree-sitter/tree-sitter-bash/ and tries to at least correctly discard all of curl's options and any options that curl used to have.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • NSwag

    The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript.

  • Something a bit different but I'm a huge fan of NSwag recently.

    https://github.com/RicoSuter/NSwag

    We use it on a project at work in C# and I've also been using it personally on pet projects with TypeScript.

    Allows you to automatically generate REST API clients based on Swagger/OpenAPI specs and is very customizable.

    Really nice if building out microservices and you're wanting to communicate between each other or building web apps and want to communicate with APIs. Saves a lot of time writing code to make requests and handle different status codes etc.

  • curlconverter

    Transpile curl commands into Python, JavaScript and 27 other languages

  • Original author here. Many smart people have contributed code over the years, but one warrants special mention.

    About a year ago, verhovsky showed up out of nowhere. He rewrote the core of the application and increased the professionalism across the board. (dedicated domain, github page hosting, UI refresh, privacy improvements, and much more)

    The tree-sitter PR is a monster achievement: https://github.com/curlconverter/curlconverter/pull/278

    Search for parseAnsiCString in there. I don't think that had ever been implemented in JavaScript before.

    For you, verhovsky, 10x engineer might be an understatement. Thank you!

  • gencurl

    gencurl generates a curl command based on an http.Request to be used for logging and debugging

  • I haven't touched it in years, but I made a utility to do the opposite in Go. Start with Go's request and transform it into a curl call. It was helpful for testing at the time. Looking at it, wow, that was 7 years ago!

    https://github.com/sethgrid/gencurl

  • openfirmware

    Open Firmware (IEE1275-1994) implementation by its inventor. (by MitchBradley)

  • >I find, only pointfree notation has some beauty to it that makes reading code sweet again.

    I haven't written FORTH code in ages, but I still enjoy reading well written FORTH code for its pure literary pleasure!

    https://github.com/MitchBradley/openfirmware/blob/master/for...

  • rosso

    Discontinued Data parsers and formatters

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts