582e807ad66c6af21b431f002c8bc84f8622eca6
Some checks failed
CI / test (push) Failing after 10s
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
pip install curl-to-code-converter
Usage
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
Languages
Python
100%