https://github.com/pkopel/curl-gen
Tool generating bash/powershell scripts from curl commands
https://github.com/pkopel/curl-gen
bash-scripting code-generation curl-commands powershell-scripting
Last synced: 4 months ago
JSON representation
Tool generating bash/powershell scripts from curl commands
- Host: GitHub
- URL: https://github.com/pkopel/curl-gen
- Owner: PKopel
- License: other
- Created: 2022-08-28T22:25:54.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-01T15:21:58.000Z (5 months ago)
- Last Synced: 2025-09-06T08:48:07.579Z (5 months ago)
- Topics: bash-scripting, code-generation, curl-commands, powershell-scripting
- Language: Haskell
- Homepage: https://pkopel.github.io/curl-gen-web/
- Size: 124 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# curl-gen


Tool generating bash/powershell scripts from lists of curl commands.
Also available as a web app at .
## Usage
1. Run `stack install` to build and install `curl-gen` executable.
2. Prepare a txt file with curl commands (like in [examples](examples))
3. Run `curl-gen ` (writes results to stdout) or `curl-gen -o script.sh` ([example result](examples/example3.sh))
4. To learn more about options run `curl-gen --help`
### Options
- `-r|--random` (optional) Include random values generator in the output script
- `-t|--threads` (optional) Make the output script multi-threaded (able to run multiple calls at the same time)
- `-l|--language Bash|Powershell|OsDefault` (optional, default: `OsDefault`) Select language of the output script. `OsDefault` on Windows is Powershell, Bash otherwise.
### Input file format
```txt
# test example
curl -X PUT -k -v https://test.com/path \
--header 'Accept: application/json' \
--data '{"obj":{"string":"data"},"array":[1,null]}'
```
Contents of the comment at the beginning are used to identify this curl call in script,
i.e. in this example, to make above call one would run `script.sh test example`