Skip to main content

CLI Reference

Complete reference documentation for all Dochia CLI commands. This section provides detailed information about every command, flag, and option available in the Dochia CLI tool.

Available Commands

test - Main Testing Command

The primary command for executing API tests against your OpenAPI specifications. This is the core functionality of Dochia.

Key Features:

  • Execute comprehensive API testing with 100+ fuzzing playbooks
  • Support for authentication, rate limiting, and custom configurations
  • Flexible output formats and detailed reporting
  • Parallel execution and performance optimization

Common Usage:

dochia test --contract api.yml --server https://api.example.com

list - List Available Resources

Display available playbooks, mutators, and other testing resources.

Key Features:

  • List all available playbooks by category
  • Show mutator information and capabilities
  • Filter and search available resources
  • Export lists for documentation or automation

Common Usage:

dochia list --playbooks
dochia list --mutators

replay - Replay Previous Tests

Re-execute specific test scenarios from previous test runs.

Key Features:

  • Replay individual test cases or entire test suites
  • Replay all errors and/or warnings from a previous run with --errors / --warnings
  • Reproduce specific error conditions
  • Debug and investigate test failures
  • Validate fixes and improvements

Common Usage:

dochia replay Test1,Test5 -s https://api.example.com
dochia replay --errors

info - System Information

Display system information, version details, and environment configuration.

Key Features:

  • Show Dochia version and build information
  • Display system environment details
  • Check configuration and connectivity
  • Troubleshoot installation issues

Common Usage:

dochia info
dochia info --verbose

fuzz - Random Fuzzing

Execute continuous random fuzzing with mutators rather than structured playbooks.

Key Features:

  • Continuous random mutation testing
  • Configurable mutation strategies
  • Real-time feedback and monitoring
  • Discovery of unexpected vulnerabilities

Common Usage:

dochia fuzz --contract api.yml --server https://api.example.com --duration 30m

explain - Explain Results

Get detailed explanations of test results, error codes, and response codes.

Key Features:

  • Explain custom response codes (9XX series)
  • Detailed error code descriptions
  • Playbook and mutator explanations
  • Troubleshooting guidance

Common Usage:

dochia explain --type response_code 953
dochia explain --type playbook BypassAuthenticationPlaybook

init-skills - Agent Skills Generation

Generate Agent Skills files for agentic IDE integration (Windsurf, Cursor, Claude Code, OpenAI Codex).

Key Features:

  • Generate skill definitions for every Dochia command
  • Follows the open agentskills.io specification
  • Automatically discovered by supported AI coding assistants
  • Includes report schemas and jq recipes for result parsing

Common Usage:

dochia init-skills
dochia init-skills --dir /path/to/project
dochia init-skills --force

Command Categories

Core Testing Commands

  • test - Primary testing functionality
  • fuzz - Random mutation testing
  • replay - Re-execute specific tests

Information & Discovery Commands

  • list - List available resources
  • info - System and version information
  • explain - Explain results and codes

Setup & Integration Commands

  • init-skills - Generate Agent Skills for AI coding assistants

Common Patterns

Basic Test Execution

# Simple test with minimal configuration
dochia test --contract openapi.yml --server https://api.example.com

# Test with authentication
dochia test --contract api.yml --server https://api.example.com --header "Authorization: Bearer token"

# Test with custom configuration
dochia test --contract api.yml --server https://api.example.com --config dochia.properties

Advanced Testing Scenarios

# Specific playbooks only
dochia test --contract api.yml --server https://api.example.com --playbooks SecurityPlaybooks

# Custom output location
dochia test --contract api.yml --server https://api.example.com --output ./test-results

# Rate limited testing
dochia test --contract api.yml --server https://api.example.com --rate-limit 10

Debugging and Analysis

# List available playbooks
dochia list --playbooks

# Explain a specific error
dochia explain --type response_code 954

# Get system information
dochia info --verbose

Global Options

Most commands support these common options:

  • --help - Display command-specific help
  • --verbose - Enable verbose output
  • --config - Specify configuration file
  • --output - Set output directory
  • --server - Target server URL

Exit Codes

Dochia uses standard exit codes across all commands:

  • 0 - Success, no errors found
  • 1 - One or more test errors found during execution
  • 2 - Usage error or internal error (invalid arguments, missing files, internal fault)

Quick Reference

Most Common Commands

# Run comprehensive tests
dochia test --contract api.yml --server https://api.example.com

# List available playbooks
dochia list --playbooks

# Explain an error code
dochia explain --type response_code 953

# Get version information
dochia info

Getting Help

# General help
dochia --help

# Command-specific help
dochia test --help
dochia list --help

Next Steps

Need Help?