MCPcopy
hub / github.com/mholt/curl-to-go

github.com/mholt/curl-to-go @main sqlite

repository ↗ · DeepWiki ↗
204 symbols 569 edges 6 files 0 documented · 0%
README

curl-to-Go

curl-to-Go is a tool to instantly convert curl commands to Go code in the browser. It does not guarantee high-fidelity conversions, but it's good enough for most API docs that have curl samples.

This is a sister tool to JSON-to-Go, which converts JSON to a Go struct type definition. To do the reverse, check out moul/http2curl.

Try it

Check it out! It works inside your browser. Just give the code a once-over since it will need you to flesh out some parts like error handling.

FAQ

Does any curl command work?

Any curl command should work, but only certain flags are understood and converted into Go code. The rest of the flags will be ignored.

Which kinds of curl commands are understood?

Mostly simple HTTP commands (headers, basic auth, body, etc).

Will you consider supporting this-or-that flag?

curl has like a bajillion options, so don't expect all of them to be implemented; just the most common/important ones to stub out code from API samples and docs, etc. But feel free to open an issue or submit a pull request! To request a new flag, please provide the equivalent Go code.

Credits

curl-to-Go is brought to you by Matt Holt (mholt6). Enjoy!

Core symbols most depended-on inside this repo

$funcType
called by 890
resources/js/gofmt.js
$clone
called by 352
resources/js/gofmt.js
$ptrType
called by 287
resources/js/gofmt.js
$assertType
called by 276
resources/js/gofmt.js
$newType
called by 222
resources/js/gofmt.js
$substring
called by 207
resources/js/gofmt.js
$subslice
called by 198
resources/js/gofmt.js
$interfaceIsEqual
called by 184
resources/js/gofmt.js

Shape

Function 204

Languages

TypeScript100%

Modules by API surface

resources/js/gofmt.js86 symbols
resources/js/jquery.min.js73 symbols
resources/js/highlight.pack.js20 symbols
resources/js/curl-to-go.js20 symbols
resources/js/common.js3 symbols
sw.js2 symbols

For agents

$ claude mcp add curl-to-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact