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
| Flag | Short | Default | Description |
|---|---|---|---|
--lang | -l | none | Language to generate: go, python, javascript, curl |
--clipboard | -c | false | Copy the output to the clipboard instead of printing it |
--reveal | false | Include 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 pythonA curl command with secrets masked
gurl codegen literal -l curlcurl -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 --clipboardRelated commands
gurl paste- Copy a request as curlgurl show- Show a saved requestgurl export- Export requests to a file