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
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
-h, --help | boolean | false | Display help information with usage examples and exit. | curl-runner --help |
--version | boolean | false | Show the curl-runner version number and exit. | curl-runner --version |
Execution Control
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
-p, --execution parallel | string | sequential | Set execution mode. Options: 'sequential' (default) or 'parallel'. | curl-runner tests/ --execution parallel |
-c, --continue-on-error | boolean | false | Continue executing remaining requests even if some fail. | curl-runner tests/ --continue-on-error |
--timeout <milliseconds> | number | none | Set global timeout for all requests in milliseconds. | curl-runner tests/ --timeout 10000 |
--retries <count> | number | 0 | Maximum number of retries for failed requests. | curl-runner tests/ --retries 3 |
--retry-delay <milliseconds> | number | 1000 | Delay between retry attempts in milliseconds. | curl-runner tests/ --retries 3 --retry-delay 2000 |
--no-retry | boolean | false | Disable retry mechanism completely. | curl-runner tests/ --no-retry |
-n, --dry-run | boolean | false | Show curl commands without executing them. Useful for previewing and debugging. | curl-runner api.yaml --dry-run |
--http2 | boolean | false | Use HTTP/2 protocol with multiplexing for improved performance. | curl-runner api.yaml --http2 |
-e, --env <name> | string | none | Select environment to load .env.{name} files. Enables environment-specific variable overrides. | curl-runner api.yaml --env production |
--no-redact | boolean | false | Disable automatic secret redaction in output. Not recommended for shared terminals. | curl-runner api.yaml --no-redact |
File Discovery
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
--all | boolean | false | Recursively search for YAML files in directories. | curl-runner tests/ --all |
Output Control
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
-v, --verbose | boolean | false | Enable verbose output with detailed request/response information. | curl-runner tests/ --verbose |
-o, --output <file> | string | none | Save execution results to a JSON file. | curl-runner tests/ --output results.json |
-q, --quiet | boolean | false | Suppress all output except errors (opposite of --verbose). | curl-runner tests/ --quiet |
--output-format <format> | string | pretty | Set output format. Options: 'json', 'pretty', or 'raw'. | curl-runner tests/ --output-format json |
--pretty-level <level> | string | minimal | Set pretty format detail level. Options: 'minimal', 'standard', or 'detailed'. | curl-runner tests/ --pretty-level detailed |
--show-headers | boolean | false | Include response headers in output. | curl-runner tests/ --show-headers |
--show-body | boolean | true | Include response body in output. | curl-runner tests/ --show-body |
--show-metrics | boolean | false | Include performance metrics in output. | curl-runner tests/ --show-metrics |
Watch Mode
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
-w, --watch | boolean | false | Watch files for changes and automatically re-run requests when files are modified. | curl-runner api.yaml --watch |
--watch-debounce <milliseconds> | number | 300 | Debounce delay for watch mode. Prevents rapid re-runs when files change quickly. | curl-runner tests/ -w --watch-debounce 500 |
--no-watch-clear | boolean | false | Disable screen clearing between watch mode runs. | curl-runner api.yaml -w --no-watch-clear |
Security
| Option | Type | Default | Description | Example |
|---|---|---|---|---|
--allow-protocol <proto> | string | http, https | Permit 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-path | boolean | false | Allow 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-redact | boolean | false | Disable 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 + verboseEnvironment 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 millisecondsCURL_RUNNER_RETRIES: maximum retry attemptsCURL_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.jsonConfiguration 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 minimalOutput 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.
{
"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:
- CLI options: command-line flags take highest precedence, for example
--verbose --timeout 5000. - Environment variables: override the files but yield to CLI flags, for example
CURL_RUNNER_VERBOSE=true. - The
globalblock of the test file: settings in the YAML file you run. - Configuration file: project-specific defaults from
curl-runner.yaml. - Built-in defaults: fallback values when nothing else is specified, for example sequential execution.
Best Practices
Recommended
- Use configuration files for team consistency
- Use
--verboseduring development - Set appropriate timeouts for your APIs
- Use
--continue-on-errorfor test suites - Save results with
--outputfor 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