51 lines
1.1 KiB
Markdown
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
|