7000pctAUTO 7a70be90a0
Some checks failed
CI / test (push) Has been cancelled
fix: resolve CI linting failures and pyproject.toml configuration
- 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
2026-02-01 18:29:43 +00:00
2026-02-01 18:20:21 +00:00

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

Description
A CLI tool that converts cURL commands into code snippets in Python, JavaScript, Go, Ruby, PHP, and Java
Readme MIT 75 KiB
Languages
Python 100%