CLI Options
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
Understanding curl-runner
option formats
-v -p -c
(can be combined as -vpc
)--verbose --parallel
--timeout 5000
Available Options
Options are grouped by functionality for easier reference.
Help & Information
-h
--help
Display help information with usage examples and exit.
Example:
curl-runner --help
--version
Show the curl-runner version number and exit.
Example:
curl-runner --version
Execution Control
-p
--execution parallel
Set execution mode. Options: 'sequential' (default) or 'parallel'.
Example:
curl-runner tests/ --execution parallel
-c
--continue-on-error
Continue executing remaining requests even if some fail.
Example:
curl-runner tests/ --continue-on-error
--timeout <milliseconds>
Set global timeout for all requests in milliseconds.
Example:
curl-runner tests/ --timeout 10000
--retries <count>
Maximum number of retries for failed requests.
Example:
curl-runner tests/ --retries 3
--retry-delay <milliseconds>
Delay between retry attempts in milliseconds.
Example:
curl-runner tests/ --retries 3 --retry-delay 2000
--no-retry
Disable retry mechanism completely.
Example:
curl-runner tests/ --no-retry
File Discovery
--all
Recursively search for YAML files in directories.
Example:
curl-runner tests/ --all
Output Control
-v
--verbose
Enable verbose output with detailed request/response information.
Example:
curl-runner tests/ --verbose
--output <file>
Save execution results to a JSON file.
Example:
curl-runner tests/ --output results.json
--quiet
Suppress all output except errors (opposite of --verbose).
Example:
curl-runner tests/ --quiet
--output-format <format>
Set output format. Options: 'json', 'pretty', or 'raw'.
Example:
curl-runner tests/ --output-format json
--pretty-level <level>
Set pretty format detail level. Options: 'minimal', 'standard', or 'detailed'.
Example:
curl-runner tests/ --pretty-level detailed
--show-headers
Include response headers in output.
Example:
curl-runner tests/ --show-headers
--show-body
Include response body in output.
Example:
curl-runner tests/ --show-body
--show-metrics
Include performance metrics in output.
Example:
curl-runner tests/ --show-metrics
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/ -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
Environment Variables
Many CLI options can be set via environment variables, which take precedence over default values but are overridden by explicit CLI options.
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 millisecondsCURL_RUNNER_RETRIES
maximum retry attemptsOutput Options
CURL_RUNNER_VERBOSE
enable verbose output (true/false)CURL_RUNNER_OUTPUT
output file pathCURL_RUNNER_QUIET
suppress output (true/false)# Environment variables override CLI options
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/
# 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/
# 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 (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 # Overrides config file settings
Output Format
When using --output
, results are saved in structured JSON format.
# JSON output format (when using --output)
{
"summary": {
"total": 10,
"successful": 8,
"failed": 2,
"duration": 2345
},
"requests": [
{
"name": "Get Users",
"status": "success",
"statusCode": 200,
"duration": 234,
"url": "https://api.example.com/users"
},
{
"name": "Invalid Request",
"status": "failed",
"error": "Request timeout after 5000ms",
"url": "https://slow-api.example.com/endpoint"
}
]
}
Option Precedence
When options are specified in multiple ways, curl-runner follows this precedence order:
CLI Options
Command-line flags take highest precedence
--verbose --timeout 5000
Environment Variables
Override defaults but yield to CLI flags
CURL_RUNNER_VERBOSE=true
Configuration File
Project-specific defaults from curl-runner.yaml
curl-runner.yaml
Built-in Defaults
Fallback values when nothing else is specified
sequential, timeout: 5000
Best Practices
Recommended Practices
Best practices for optimal usage
--verbose
during development--continue-on-error
for test suites--output
for analysisImportant Cautions
Things to be mindful of when using options