Skip to content
gurl codegen

gurl codegen

Turn a saved request into Go, Python, JavaScript or curl code. Literal secrets are masked by default.

Synopsis

gurl codegen <name> --lang <go|python|javascript|curl> [flags]

Literal secret header values, sensitive query parameters and secret auth params are masked as *****. With --reveal they are included, except Authorization, which always becomes a placeholder (<your-token-here>). -l curl quotes each header as one argument: -H 'Content-Type: application/json'.

--clipboard and --reveal are refused in agent mode; there, codegen prints masked code to stdout.

Flags

FlagShortDefaultDescription
--lang-lnoneLanguage to generate: go, python, javascript, curl
--clipboard-cfalseCopy the output to the clipboard instead of printing it
--revealfalseInclude secret header and auth values instead of masking them (Authorization always becomes a placeholder)

Aliases

  • cg

Examples

Python client code

gurl codegen "create-order" --lang python

A curl command with secrets masked

gurl codegen literal -l curl
curl -X 'GET' -H 'Authorization: <your-token-here>' 'http://127.0.0.1:18731/x?token=*****'

Copy JavaScript to the clipboard

gurl codegen "create-order" -l javascript --clipboard

Related commands