scorpiox-executecurl network

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.

Platforms: linux-x64 linux-arm64 macos-arm64

⚙️ Flags & Options

This tool accepts curl commands as arguments. All inputs are security-validated before execution to prevent injection attacks.

📖 Usage Examples

Basic GET request

# Fetch a URL and capture the response body
scorpiox-executecurl "https://api.example.com/status"

{"status": "ok", "uptime": 99.97}

POST request with JSON payload

# 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 file with progress

# 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

Authenticated API request

# 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}, ...]

Pipeline with other ScorpioX tools

# 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"

Multipart form upload

# 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"}

Custom headers and verbose output

# 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..."}}

🔧 Source & Build Info

Source File
scorpiox/scorpiox-executecurl.c
Lines of Code
474
Dependencies
libsxutil

🔗 Related Tools