Skip to content
Documentation

CLI Options

Complete reference for all curl-runner command-line options including execution control, output formatting, and debugging flags.

Comprehensive reference for all command-line options available in curl-runner, including examples and best practices.

curl-runner provides numerous CLI options to customize execution behavior, output formatting, and error handling. Options can be combined and have both short and long forms.

Option syntax

  • Short options: -v -p -c (can be combined as -vpc)
  • Long options: --verbose --execution parallel
  • Options with values: --timeout 5000

Available Options

Options are grouped by functionality for easier reference.

Help & Information

OptionTypeDefaultDescriptionExample
-h, --helpbooleanfalseDisplay help information with usage examples and exit.curl-runner --help
--versionbooleanfalseShow the curl-runner version number and exit.curl-runner --version

Execution Control

OptionTypeDefaultDescriptionExample
-p, --execution parallelstringsequentialSet execution mode. Options: 'sequential' (default) or 'parallel'.curl-runner tests/ --execution parallel
-c, --continue-on-errorbooleanfalseContinue executing remaining requests even if some fail.curl-runner tests/ --continue-on-error
--timeout <milliseconds>numbernoneSet global timeout for all requests in milliseconds.curl-runner tests/ --timeout 10000
--retries <count>number0Maximum number of retries for failed requests.curl-runner tests/ --retries 3
--retry-delay <milliseconds>number1000Delay between retry attempts in milliseconds.curl-runner tests/ --retries 3 --retry-delay 2000
--no-retrybooleanfalseDisable retry mechanism completely.curl-runner tests/ --no-retry
-n, --dry-runbooleanfalseShow curl commands without executing them. Useful for previewing and debugging.curl-runner api.yaml --dry-run
--http2booleanfalseUse HTTP/2 protocol with multiplexing for improved performance.curl-runner api.yaml --http2
-e, --env <name>stringnoneSelect environment to load .env.{name} files. Enables environment-specific variable overrides.curl-runner api.yaml --env production
--no-redactbooleanfalseDisable automatic secret redaction in output. Not recommended for shared terminals.curl-runner api.yaml --no-redact

File Discovery

OptionTypeDefaultDescriptionExample
--allbooleanfalseRecursively search for YAML files in directories.curl-runner tests/ --all

Output Control

OptionTypeDefaultDescriptionExample
-v, --verbosebooleanfalseEnable verbose output with detailed request/response information.curl-runner tests/ --verbose
-o, --output <file>stringnoneSave execution results to a JSON file.curl-runner tests/ --output results.json
-q, --quietbooleanfalseSuppress all output except errors (opposite of --verbose).curl-runner tests/ --quiet
--output-format <format>stringprettySet output format. Options: 'json', 'pretty', or 'raw'.curl-runner tests/ --output-format json
--pretty-level <level>stringminimalSet pretty format detail level. Options: 'minimal', 'standard', or 'detailed'.curl-runner tests/ --pretty-level detailed
--show-headersbooleanfalseInclude response headers in output.curl-runner tests/ --show-headers
--show-bodybooleantrueInclude response body in output.curl-runner tests/ --show-body
--show-metricsbooleanfalseInclude performance metrics in output.curl-runner tests/ --show-metrics

Watch Mode

OptionTypeDefaultDescriptionExample
-w, --watchbooleanfalseWatch files for changes and automatically re-run requests when files are modified.curl-runner api.yaml --watch
--watch-debounce <milliseconds>number300Debounce delay for watch mode. Prevents rapid re-runs when files change quickly.curl-runner tests/ -w --watch-debounce 500
--no-watch-clearbooleanfalseDisable screen clearing between watch mode runs.curl-runner api.yaml -w --no-watch-clear

Security

OptionTypeDefaultDescriptionExample
--allow-protocol <proto>stringhttp, httpsPermit an additional URL protocol beyond the default http/https allow-list (e.g. ftp, gopher, file). Repeatable. Requests using a non-allowed protocol are blocked before curl runs.curl-runner tests/ --allow-protocol ftp --allow-protocol file
--allow-pathbooleanfalseAllow output, saveToFile, and formData file paths to point outside the working directory. By default these are confined to the current directory to prevent reads/writes of arbitrary files.curl-runner upload.yaml --allow-path
--no-redactbooleanfalseDisable automatic redaction of secrets (auth tokens/passwords, sensitive headers, and known key patterns) in console output and saved result files.curl-runner api.yaml --no-redact

Combining Options

Short options can be combined, and multiple options can be used together for powerful configurations.

# Basic combinations
curl-runner tests/ -v                    # Verbose output
curl-runner tests/ -p                    # Parallel execution
curl-runner tests/ -c                    # Continue on error
curl-runner tests/ -n                    # Dry run (preview commands)
curl-runner tests/ -pv                   # Parallel + verbose
curl-runner tests/ -pc                   # Parallel + continue on error
curl-runner tests/ -pvc                  # Parallel + verbose + continue on error

# With long options
curl-runner tests/ --execution parallel --verbose --continue-on-error

# Output format combinations
curl-runner tests/ --output-format json --show-metrics
curl-runner tests/ --output-format pretty --pretty-level detailed
curl-runner tests/ --show-headers --show-body --show-metrics

# Advanced combinations
curl-runner tests/ \
  --execution parallel \
  --continue-on-error \
  --output-format pretty \
  --pretty-level detailed \
  --show-headers \
  --show-metrics \
  --timeout 30000 \
  --retries 3 \
  --retry-delay 2000 \
  --output results.json \
  --all

# Retry configurations
curl-runner tests/ --retries 5 --retry-delay 1500  # Custom retry settings
curl-runner tests/ --no-retry                      # Disable retries completely

# Watch mode
curl-runner api.yaml -w                            # Watch and re-run on changes
curl-runner tests/ --watch --watch-debounce 500    # Custom debounce delay
curl-runner api.yaml -w --no-watch-clear           # Don't clear screen between runs
curl-runner tests/ -wpv                            # Watch + parallel + verbose

Environment Variables

Many CLI options can be set via environment variables, which take precedence over default values and the configuration files but are overridden by explicit CLI options. See Environment Variables for the full list.

Supported Environment Variables

Execution options

  • CURL_RUNNER_EXECUTION: execution mode (sequential/parallel)
  • CURL_RUNNER_CONTINUE_ON_ERROR: continue on error (true/false)
  • CURL_RUNNER_TIMEOUT: global timeout in milliseconds
  • CURL_RUNNER_RETRIES: maximum retry attempts
  • CURL_RUNNER_DRY_RUN: dry run mode (true/false)

Output options

  • CURL_RUNNER_VERBOSE: enable verbose output (true/false)
  • CURL_RUNNER_OUTPUT_FILE: output file path
# Environment variables override the configuration files
CURL_RUNNER_TIMEOUT=10000 curl-runner tests/
CURL_RUNNER_RETRIES=3 curl-runner tests/
CURL_RUNNER_RETRY_DELAY=2000 curl-runner tests/
CURL_RUNNER_VERBOSE=true curl-runner tests/
CURL_RUNNER_EXECUTION=parallel curl-runner tests/
CURL_RUNNER_CONTINUE_ON_ERROR=true curl-runner tests/
CURL_RUNNER_DRY_RUN=true curl-runner tests/

# Output format environment variables
CURL_RUNNER_OUTPUT_FORMAT=json curl-runner tests/
CURL_RUNNER_PRETTY_LEVEL=detailed curl-runner tests/
CURL_RUNNER_OUTPUT_FILE=results.json curl-runner tests/

# Watch mode environment variables
CURL_RUNNER_WATCH=true curl-runner api.yaml
CURL_RUNNER_WATCH_DEBOUNCE=500 curl-runner tests/ -w
CURL_RUNNER_WATCH_CLEAR=false curl-runner api.yaml -w

# Multiple environment variables
CURL_RUNNER_TIMEOUT=15000 \
CURL_RUNNER_RETRIES=2 \
CURL_RUNNER_RETRY_DELAY=1500 \
CURL_RUNNER_VERBOSE=true \
CURL_RUNNER_OUTPUT_FORMAT=pretty \
CURL_RUNNER_PRETTY_LEVEL=detailed \
curl-runner tests/ --execution parallel

# Mix environment variables and CLI options
CURL_RUNNER_TIMEOUT=10000 \
CURL_RUNNER_OUTPUT_FORMAT=json \
curl-runner tests/ --verbose --show-metrics --output results.json

Configuration File

Create a curl-runner.yaml file in your project root to set default options.

curl-runner.yaml
# curl-runner.yaml (configuration file)
global:
  execution: parallel
  continueOnError: true
  output:
    verbose: false
    format: pretty
    prettyLevel: detailed
    showHeaders: true
    showBody: true
    showMetrics: true
    saveToFile: results.json
  defaults:
    timeout: 10000
    retry:
      count: 2
      delay: 1000
  variables:
    API_BASE: "https://api.example.com"
    API_VERSION: "v2"
# CLI options override config file settings
curl-runner tests/ --verbose --pretty-level minimal

Output Format

When using --output, results are saved in structured JSON format. Each entry in results has the original request, success, and either the status, headers, body and metrics of the response or an error.

results.json
{
  "total": 2,
  "successful": 1,
  "failed": 1,
  "skipped": 0,
  "duration": 109.8,
  "results": [
    {
      "request": { "name": "Get Users", "url": "https://api.example.com/users" },
      "success": true,
      "status": 200,
      "headers": { "content-type": "application/json; charset=utf-8" },
      "body": [],
      "metrics": { "duration": 105.5, "size": 5645 }
    },
    {
      "request": { "name": "Invalid Request", "url": "https://localhost:1/endpoint" },
      "success": false,
      "error": "curl: (7) Failed to connect to localhost:1 after 0 ms: Could not connect to server",
      "metrics": { "duration": 0.4 }
    }
  ]
}

Configuration Precedence

When options are specified in multiple ways, curl-runner follows this precedence order, from highest to lowest:

  1. CLI options: command-line flags take highest precedence, for example --verbose --timeout 5000.
  2. Environment variables: override the files but yield to CLI flags, for example CURL_RUNNER_VERBOSE=true.
  3. The global block of the test file: settings in the YAML file you run.
  4. Configuration file: project-specific defaults from curl-runner.yaml.
  5. Built-in defaults: fallback values when nothing else is specified, for example sequential execution.

Best Practices

Recommended

  • Use configuration files for team consistency
  • Use --verbose during development
  • Set appropriate timeouts for your APIs
  • Use --continue-on-error for test suites
  • Save results with --output for analysis

Cautions

  • Parallel execution may overwhelm servers
  • High retry counts can cause rate limiting
  • Very low timeouts may cause false failures
  • Verbose output can be overwhelming for large test suites
  • Environment variables affect all executions