Files
curl-to-code-converter/README.md
7000pctAUTO ef95b50489
Some checks failed
CI / test (push) Has been cancelled
fix: resolve CI workflow issues
2026-02-01 18:20:21 +00:00

51 lines
1.1 KiB
Markdown

# curl-to-code-converter
A CLI tool that converts cURL commands into code snippets in various programming languages.
## Features
- Convert cURL to Python requests code
- Convert cURL to JavaScript fetch code
- Convert cURL to Go HTTP code
- Convert cURL to Ruby Net::HTTP code
- Support for headers, authentication, JSON body
- Interactive mode for pasting cURL directly
- Copy to clipboard functionality
## Installation
```bash
pip install curl-to-code-converter
```
## Usage
```bash
curl-to-code 'curl https://api.example.com/data'
curl-to-code 'curl -X POST https://api.example.com -d "{\"key\":\"value\"}"' -l python
curl-to-code 'curl -H "Authorization: Bearer token" https://api.example.com' -l javascript
```
## Options
- `-l, --language`: Target programming language (default: python)
- `-o, --output`: Output file path
- `-v, --verbose`: Show verbose output
## Supported Languages
- Python (requests)
- JavaScript (fetch)
- Go (net/http)
- Ruby (Net::HTTP)
- PHP (cURL)
- Java (HttpURLConnection)
## Contributing
Contributions welcome! Please read the contributing guidelines.
## License
MIT License