> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/apex/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/apex/_mcp/server.

# pensar doctor

> Check dependencies and install missing tools

## Overview

The `pensar doctor` command performs a health check on your Pensar Apex installation. It verifies that optional dependencies are installed and offers to install missing ones automatically.

## Usage

```bash
pensar doctor
```

## What It Checks

### System Tools

* **nmap** — network scanner used for port scanning and service detection. If nmap is not found, `doctor` offers to install it via your system package manager (Homebrew, apt, dnf, or pacman).

### AI Providers

Checks which AI provider API keys are configured via environment variables:

| Provider    | Environment Variable           |
| ----------- | ------------------------------ |
| Anthropic   | `ANTHROPIC_API_KEY`            |
| OpenAI      | `OPENAI_API_KEY`               |
| Google      | `GOOGLE_GENERATIVE_AI_API_KEY` |
| OpenRouter  | `OPENROUTER_API_KEY`           |
| AWS Bedrock | `BEDROCK_API_KEY`              |
| AWS IAM     | `AWS_ACCESS_KEY_ID`            |
| vLLM        | `LOCAL_MODEL_URL`              |

## Example Output

```
Pensar Doctor
=============

System Tools
------------
  ✓ nmap (Nmap 7.94)

AI Providers
------------
  ✓ Anthropic
  · OpenAI
  · Google
  · OpenRouter
  · AWS Bedrock
  · AWS IAM
  · vLLM (local)
```

> **Info**
>
> API keys configured via `/providers` in the TUI are stored in `~/.pensar/config.json` and are not detected by `pensar doctor`. The doctor command only checks environment variables.

## Related Commands

#### [pensar upgrade](/apex/cli-commands/pensar-upgrade)

Update to the latest version

#### [/providers](/apex/tui-slash-commands/providers)

Configure AI providers in the TUI