The praisonai doctor command provides comprehensive health checks and diagnostics for your PraisonAI installation, configuration, and environment.
Quick Start
# Run all fast checks
praisonai doctor
# Run checks for a specific category
praisonai doctor env
praisonai doctor config
praisonai doctor tools
# Output in JSON format
praisonai doctor --json
# CI mode with deterministic output
praisonai doctor ci
Subcommands
| Subcommand | Description |
|---|
env | Check environment variables and system configuration |
config | Validate configuration files (agents.yaml, workflow.yaml) |
tools | Check tool availability and dependencies |
db | Check database drivers and connectivity |
mcp | Check MCP server configuration |
obs | Check observability providers (Langfuse, LangSmith, etc.) |
skills | Check agent skills directories |
memory | Check memory storage and sessions |
permissions | Check filesystem permissions |
network | Check network connectivity and proxy settings |
performance | Check import times and module counts |
ci | CI-optimized checks with JSON output |
selftest | Test agent creation and chat functionality |
Global Flags
| Flag | Description |
|---|
--json | Output in JSON format |
--format text|json | Output format (default: text) |
--output PATH | Write report to file |
--deep | Enable deeper probes (DB connects, network checks) |
--timeout SEC | Per-check timeout in seconds (default: 10) |
--strict | Treat warnings as failures |
--quiet | Minimal output |
--no-color | Disable ANSI colors |
--only IDS | Only run these check IDs (comma-separated) |
--skip IDS | Skip these check IDs (comma-separated) |
--list-checks | List available check IDs |
--version | Show doctor module version |
Exit Codes
Root Command
| Code | Meaning |
|---|
| 0 | All checks passed |
| 1 | One or more checks failed (or warnings in strict mode) |
| 2 | Internal error |
CI Mode
| Code | Meaning |
|---|
| 0 | All checks passed |
| 1 | One or more checks failed |
| 2 | Timeout |
| 3 | Internal error |
Examples
Environment Checks
# Check all environment settings
praisonai doctor env
# Check with API key visibility
praisonai doctor env --show-keys
Configuration Validation
# Validate all config files
praisonai doctor config
# Validate specific file
praisonai doctor config --file agents.yaml
# Show expected schema
praisonai doctor config --schema
Database Checks
# Check database drivers
praisonai doctor db
# Test database connectivity (deep mode)
praisonai doctor db --deep
# Check specific provider
praisonai doctor db --provider postgresql
MCP Server Checks
# Check MCP configuration
praisonai doctor mcp
# List MCP tools
praisonai doctor mcp --list-tools
# Test server spawning (deep mode)
praisonai doctor mcp --deep
Skills Diagnostics
# Check skills health
praisonai doctor skills
# Detailed requirements diagnostics
praisonai doctor skills --requirements
# Deep skill validation
praisonai doctor skills --deep
# Check import times
praisonai doctor performance
# Set import time budget
praisonai doctor performance --budget-ms 1000
# Show top slow imports
praisonai doctor performance --top 20
Self-Test
# Run mock self-test (no API calls)
praisonai doctor selftest --mock
# Run live self-test with API calls
praisonai doctor selftest --live
# Use specific model
praisonai doctor selftest --live --model gpt-4o
CI Integration
# Run CI checks with JSON output
praisonai doctor ci
# Fail fast on first error
praisonai doctor ci --fail-fast
# Save report to file
praisonai doctor ci --output report.json
Filtering Checks
# List all available checks
praisonai doctor --list-checks
# Run only specific checks
praisonai doctor --only python_version,openai_api_key
# Skip specific checks
praisonai doctor --skip network_dns,network_https
# Combine filters
praisonai doctor env --only openai_api_key,anthropic_api_key
Status Symbols
The text formatter automatically picks symbols that match your terminal encoding.
| Status | UTF-8 terminals | Non-UTF-8 terminals (e.g. Windows cp1252) |
|---|
| Pass | ✓ | [OK] |
| Warn | ⚠ | [!] |
| Fail | ✗ | [X] |
| Skip | ○ | [-] |
| Error | ✗ | [X] |
Detection runs once when the formatter starts. UTF-8 terminals always
use the Unicode symbols. Anything else (Windows default consoles,
legacy cp1252/cp437, etc.) automatically falls back to ASCII so
praisonai doctor never crashes with UnicodeEncodeError.
Use --json for machine-readable output that does not depend on terminal encoding.
{
"version": "1.0.0",
"timestamp": "2025-01-01T00:00:00.000000+00:00",
"duration_ms": 150.5,
"environment": {
"python_version": "3.11.0",
"os_name": "Darwin",
"praisonai_version": "2.7.0"
},
"results": [
{
"id": "python_version",
"title": "Python Version",
"category": "environment",
"status": "pass",
"message": "Python 3.11.0 (>= 3.9 required)",
"duration_ms": 0.5
}
],
"summary": {
"total": 50,
"passed": 45,
"warnings": 3,
"failed": 1,
"skipped": 1,
"errors": 0
},
"exit_code": 1
}
Check Categories
Environment (env)
- Python version validation
- Package installation checks
- API key configuration
- OS and architecture info
- Virtual environment detection
- Binary availability (git, docker, npx)
Configuration (config)
- agents.yaml existence and syntax
- workflow.yaml validation
- .praison config directory
- .env file detection
- Tool registry access
- Web search tools
- File operation tools
- Code execution tools
- API key requirements
Database (db)
- Driver availability (PostgreSQL, SQLite, Redis, MongoDB)
- ChromaDB for RAG
- Connection testing (deep mode)
MCP (mcp)
- Configuration file validation
- npx availability
- Python MCP package
- Server configuration validation
- Server spawn testing (deep mode)
Observability (obs)
- Langfuse configuration
- LangSmith configuration
- AgentOps configuration
- PraisonAI telemetry
Skills (skills)
- Skills directory discovery
- SKILL.md validation
- PraisonAI skills module
- Capability requirements (active/degraded/unavailable counts, enforcement level)
Memory (memory)
- Memory directories
- JSON file integrity
- Session storage
- ChromaDB vector memory
Permissions (permissions)
- ~/.praison directory
- Project .praison directory
- Temp directory
- Current working directory
- Config directory
Network (network)
- DNS resolution (deep mode)
- HTTPS connectivity (deep mode)
- Proxy configuration
- SSL/TLS settings
- OpenAI base URL
- Package import times
- Slow import detection (deep mode)
- Loaded module count
Self-Test (selftest)
- Agent import
- Agent instantiation
- LLM configuration
- Mock/live chat testing
- Tools wiring
Serve & Endpoints (serve)
- Serve module availability
- Endpoints module availability
- Endpoints CLI handler
- Server connectivity (deep mode)
- Discovery endpoint (deep mode)
- A2U module availability
- Provider adapters availability
- FastAPI availability
- Uvicorn availability
Bots (bots)
- Bot token environment variables (
bot_tokens)
- Bot.yaml configuration file validation (
bot_config)
- Bot security configuration checks (
bot_security)
- Multi-channel token configuration validation (
multi_channel_tokens)
Multi-Channel Token Check Details
The multi_channel_tokens check validates your multi-channel bot setup:
Category: BOTS
Severity: MEDIUM
PASS Conditions:
- Each channel uses a unique environment variable
- Each environment variable resolves to a unique token value
- Follows
PLATFORM_<ROLE>_BOT_TOKEN naming convention
WARN Conditions:
- Environment variable doesn’t follow naming convention
- Environment variable is unset but referenced in config
FAIL Conditions:
- Two channels point to the same environment variable
- Two environment variables resolve to the same token value
Skip Condition:
bot.yaml missing → check is skipped
Sample Remediation Messages:
- “Each channel must have a unique bot token. Create separate bots in @BotFather and use unique environment variables.”
- “Consider following the naming convention PLATFORM_ROLE_BOT_TOKEN for clarity.”