Skip to main content
The doctor command checks your system configuration, verifies dependencies, and helps install missing tools required for penetration testing.

Syntax

Description

Runs a comprehensive system check that verifies:
  • System Tools: Checks for required penetration testing tools (nmap, etc.)
  • AI Providers: Verifies API key configuration for AI models
  • Dependencies: Ensures all required system dependencies are available
The doctor command can also offer to automatically install missing tools using your system’s package manager.

No Options Required

The doctor command runs without any flags or options. Simply execute:

Interactive Installation

When the doctor finds missing tools, it can automatically install them:
  • macOS: Uses Homebrew (brew)
  • Ubuntu/Debian: Uses apt-get
  • Fedora/RHEL: Uses dnf
  • Arch Linux: Uses pacman
You’ll be prompted before any installation occurs.

Examples

Basic System Check

Run a complete diagnostic:
Output:

First-Time Setup

When running on a fresh system:

Fully Configured System

When everything is set up correctly:

Missing API Keys

When no AI provider is configured:

Checked Components

System Tools

Purpose: Network discovery and security scanningRequired: Recommended (optional for basic usage)Installation:
Used for:
  • Port scanning
  • Service detection
  • Network reconnaissance

AI Providers

The doctor checks for API keys for these providers:

Anthropic (Claude)

Environment Variable: ANTHROPIC_API_KEYModels:
  • claude-sonnet-4-5 (recommended)
  • claude-opus-4-0
  • claude-3-5-sonnet
Get API Key: https://console.anthropic.com/Setup:
Environment Variable: OPENAI_API_KEYModels:
  • gpt-4o
  • gpt-4-turbo
  • gpt-4
Get API Key: https://platform.openai.com/api-keysSetup:
Environment Variable: OPENROUTER_API_KEYModels: Access to 100+ models from multiple providersGet API Key: https://openrouter.ai/keysSetup:
Environment Variable: BEDROCK_API_KEYModels:
  • Claude models via AWS
  • Other AWS Bedrock models
Setup:
Environment Variables:
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
Setup:
Environment Variable: LOCAL_MODEL_URLPurpose: Use locally hosted modelsSetup:

Status Indicators

The doctor uses these indicators:

Exit Codes

The doctor command always exits with code 0 unless an installation fails. Missing optional tools don’t cause failures.

Use Cases

Pre-Pentest Verification

Before running a pentest, verify your setup:

Troubleshooting

If pentests fail, check configuration:
Look for:
  • Missing nmap installation
  • No AI provider configured
  • Outdated tool versions

CI/CD Health Check

Verify CI environment before automated testing:

Fresh Installation

After installing Pensar, run doctor to complete setup:

Supported Package Managers

The doctor automatically detects and uses your system’s package manager:
Homebrew (brew)
Prerequisites:

Manual Installation

If automatic installation fails or is unavailable:

nmap

From source:
Official packages: https://nmap.org/download.html

Troubleshooting

Package Manager Not Found

If the doctor cannot detect a package manager:
Solution: Install nmap manually using the link provided.

Permission Denied

If installation fails with permission errors:

API Key Not Detected

If you set an API key but doctor doesn’t detect it:

nmap Version Issues

If you have an old version of nmap:

Configuration Files

The doctor reads configuration from:
  • pensar - Launch TUI after verifying setup
  • pentest - Run pentest after verification
  • upgrade - Update Pensar itself

Next Steps

Getting Started

Complete setup guide after running doctor

Configuration

Advanced configuration options