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
  • Amplication - open-source Node.js backend code generator
  • Appwrite - The open-source backend cloud platform
  • SurveyJS - A Non-Cloud Alternative to Google Forms that has it all.
  • Sonar - Write Clean JavaScript Code. Always.
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Mergify - Updating dependencies is time-consuming.
  • 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 and gRPC.

    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/

  • Amplication

    Amplication: open-source Node.js backend code generator. An open-source platform that helps developers build backends without spending time on boilerplate & repetitive coding. Including production-ready GraphQL & REST APIs, DB schema, DTOs, filtering, pagination, RBAC, & more.

  • 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.

  • Appwrite

    Appwrite - The open-source backend cloud platform. The open-source backend cloud platform for developing Web, Mobile, and Flutter applications. You can set up your backend faster with real-time APIs for authentication, databases, file storage, cloud functions, and much more!

  • 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

    Convert cURL commands into code

    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

    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