Complete reference for all Hitman command-line options and features.
hitman [OPTIONS] <FILE>
hitman [OPTIONS] --stdinPath to the .hit file to execute.
Example:
hitman requests.hit
hitman /path/to/api-tests.hitRead the .hit content from standard input instead of a file.
Example:
echo 'GET https://httpbin.org/get' | hitman --stdin
cat requests.hit | hitman --stdinEnable verbose output with detailed request and response information.
Example:
hitman requests.hit --verbose
hitman requests.hit -vOutput includes:
- Request headers and body
- Response headers and status
- Timing information
- Variable substitution details
Suppress non-essential output. Only shows errors and final summary.
Example:
hitman requests.hit --quiet
hitman requests.hit -qSet the log level for debugging and troubleshooting.
Levels: debug, info, warn, error
Example:
hitman requests.hit --log debug
hitman requests.hit --log errorControl colored output.
Values: auto, always, never
Example:
hitman requests.hit --color always
hitman requests.hit --color neverValidate the .hit file syntax and show what would be executed without sending actual HTTP requests.
Example:
hitman requests.hit --dry-runUseful for:
- Syntax validation
- Variable substitution testing
- Request preview
Stop execution on the first error instead of continuing with remaining requests.
Example:
hitman requests.hit --strictExecute all HTTP requests in parallel instead of sequentially.
Example:
hitman requests.hit --parallelBenefits:
- Faster execution for independent requests
- Better performance testing
Considerations:
- May overwhelm servers with many concurrent requests
- Order of execution is not guaranteed
Add a delay between sequential requests (ignored in parallel mode).
Example:
hitman requests.hit --delay 1000 # 1 second delay
hitman requests.hit --delay 500 # 500ms delaySet the timeout for HTTP requests.
Default: 30 seconds
Example:
hitman requests.hit --timeout 60 # 60 second timeout
hitman requests.hit --timeout 5 # 5 second timeoutOverride or define variables from the command line. Can be used multiple times.
Example:
hitman requests.hit --define baseUrl="https://staging.api.com"
hitman requests.hit --define token="abc123" --define debug=truePrecedence: Command line variables override file variables.
Load variables from an environment file.
Example:
hitman requests.hit --env .env
hitman requests.hit --env config/staging.envEnvironment file format:
BASE_URL=https://api.example.com
API_TOKEN=your-token-here
DEBUG=trueSave a detailed JSON execution report to the specified file.
Example:
hitman requests.hit --report results.json
hitman requests.hit --report reports/$(date +%Y%m%d_%H%M%S).jsonReport includes:
- Request and response details
- Timing information
- Success/failure status
- Variable values
- Error messages
Show help information and exit.
hitman --help
hitman -hShow version information and exit.
hitman --version
hitman -VHitman uses standard exit codes to indicate execution status:
- 0: Success - All requests completed successfully
- 1: Parse Error - Invalid
.hitfile syntax - 2: Request Error - One or more HTTP requests failed
- 3: System Error - File not found, permission denied, etc.
# Simple execution
hitman api-tests.hit
# Verbose output
hitman api-tests.hit --verbose
# Dry run for validation
hitman api-tests.hit --dry-run# Override environment
hitman api-tests.hit --define baseUrl="https://staging.api.com"
# Multiple overrides
hitman api-tests.hit \
--define baseUrl="https://staging.api.com" \
--define token="staging-token" \
--define debug=true# Use staging environment
hitman api-tests.hit --env environments/staging.env
# Combine with overrides
hitman api-tests.hit --env .env --define debug=true# Parallel execution
hitman api-tests.hit --parallel
# Sequential with delay
hitman api-tests.hit --delay 1000
# Strict mode (stop on first error)
hitman api-tests.hit --strict# Generate report
hitman api-tests.hit --report results.json
# Quiet execution with report
hitman api-tests.hit --quiet --report results.json
# Timestamped report
hitman api-tests.hit --report "report-$(date +%Y%m%d_%H%M%S).json"# From stdin
echo 'GET https://httpbin.org/get' | hitman --stdin
# In CI/CD
hitman api-tests.hit --quiet --strict --report results.json
if [ $? -eq 0 ]; then
echo "All tests passed"
else
echo "Tests failed"
exit 1
fiVariables are resolved in the following order (highest to lowest priority):
- Command line (
--define) - Environment file (
--env) - File definitions (
DEFINEstatements)
- Use
--parallelfor independent requests - Use
--quietin scripts and CI/CD - Set appropriate
--timeoutfor your network - Use
--delayto avoid overwhelming servers - Use
--dry-runfor syntax validation before execution