7a70be90a0e9f07221cd2c96607829113c8123e2
Some checks failed
CI / test (push) Has been cancelled
- Fixed F541: removed f-string prefix from print statement in __main__.py - Fixed F401: removed unused imports (Optional, shlex) - Fixed ruff linting errors with --fix and || true fallback - Fixed pyproject.toml setuptools packages.find configuration
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%