Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/visible/cruel/llms.txt

Use this file to discover all available pages before exploring further.

The Cruel CLI provides a powerful command-line interface for chaos testing your APIs and services. Run tests, benchmarks, and predefined scenarios directly from your terminal.

Installation

Install Cruel globally to use the CLI:
npm install -g cruel
Or run directly with npx:
npx cruel test https://api.example.com

Quick Start

# Test an endpoint with 10% failure rate
cruel test https://api.example.com --fail 0.1 --count 20

# Benchmark endpoint performance
cruel benchmark https://api.example.com --count 100 --concurrent 10

# Run a chaos scenario
cruel scenario outage --duration 5000

Available Commands

test

Test endpoints with chaos injection

benchmark

Benchmark endpoint performance

scenarios

Run predefined chaos scenarios

stats

View chaos testing statistics

Global Options

These options work across all commands:
--fail
number
Failure rate between 0 and 1 (e.g., 0.1 = 10% failure rate)
--delay
number | string
Delay in milliseconds or min-max range (e.g., 100 or “100-500”)
--timeout
number
Timeout rate between 0 and 1 (e.g., 0.05 = 5% timeout rate)
--preset
string
Use a predefined chaos configuration presetAvailable presets: development, staging, production, harsh, nightmare, apocalypse
--retry
number
Number of retry attempts for failed requests
--circuit
number
Circuit breaker failure threshold before opening circuit

Chaos Presets

Cruel includes several built-in presets for different testing scenarios:
# View all available presets
cruel presets
Available Presets:
  • development - Light chaos for local development
  • staging - Moderate chaos for staging environments
  • production - Realistic production chaos patterns
  • harsh - High chaos for stress testing
  • nightmare - Extreme chaos conditions
  • apocalypse - Maximum chaos for worst-case scenarios

Usage Examples

cruel test https://api.example.com --preset nightmare

Output Format

The CLI provides visual feedback with colored output:
  • . - Successful request (green)
  • X - Failed request (red)
  • T - Timed out request (yellow)

Statistics

View accumulated chaos statistics:
cruel stats
This shows:
  • Total calls made
  • Number of failures injected
  • Number of timeouts
  • Number of delays
  • Corrupted responses
  • Rate limited requests
  • Streams cut

Version

Check your Cruel version:
cruel version
# or
cruel --version
cruel -v

Help

Get help on any command:
cruel help
# or
cruel --help
cruel -h

Build docs developers (and LLMs) love