Execute curl commands programmatically with structured output capture. Wraps curl invocations, validates inputs, captures HTTP responses, and returns results in a machine-readable format for use in automation pipelines.
# Fetch a URL and capture the response body scorpiox-executecurl "https://api.example.com/status" {"status": "ok", "uptime": 99.97}
# Send a POST request with JSON data scorpiox-executecurl "https://api.example.com/data" \ -X POST \ -H "Content-Type: application/json" \ -d '{"key": "value", "count": 42}' HTTP/1.1 201 Created {"id": "abc-123", "created": true}
# Download a binary file and capture output scorpiox-executecurl -o /tmp/release.tar.gz \ "https://releases.example.com/v2.1.0/app-linux-x64.tar.gz" % Total % Received 100 4521k 100 4521k 0 0 2.1M 0 0:00:02 Saved to /tmp/release.tar.gz
# Use Bearer token for authenticated endpoints scorpiox-executecurl "https://api.github.com/user/repos" \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" [{"name":"my-project","private":false,"stars":42}, ...]
# Fetch JSON API → pipe to scorpiox tools for processing scorpiox-executecurl "https://api.example.com/metrics" | \ scorpiox-jq '.cpu_usage' # Use as fallback when scorpiox-fetch is unavailable scorpiox-fetch --url "https://example.com" 2>/dev/null || \ scorpiox-executecurl "https://example.com"
# Upload a file via multipart form data scorpiox-executecurl "https://api.example.com/upload" \ -X POST \ -F "file=@./report.csv" \ -F "format=csv" \ -F "overwrite=true" {"upload_id":"u-5f3a","bytes":204800,"status":"complete"}
# Include response headers and use custom user-agent scorpiox-executecurl -i \ -H "User-Agent: scorpiox/1.0" \ -H "X-Request-ID: $(uuidgen)" \ "https://httpbin.org/headers" HTTP/2 200 content-type: application/json {"headers":{"User-Agent":"scorpiox/1.0","X-Request-ID":"a1b2c3d4..."}}