Skip to main content

ironclaw doctor

Run comprehensive health diagnostics to validate your IronClaw configuration and check external dependencies. Use this command to troubleshoot issues before they affect normal operation.

Syntax

Description

The doctor command performs a series of checks to verify:
  1. Authentication - NEAR AI session or API key
  2. Database - Database backend connectivity
  3. Workspace - Directory existence and permissions
  4. External binaries - Docker, cloudflared, ngrok, tailscale
Each check reports:
  • [pass] - Check succeeded
  • [FAIL] - Check failed (requires attention)
  • [skip] - Binary not found (normal if not used)

Examples

Output

Successful Run

With Failures

With Optional Tools Missing

Checks Explained

NEAR AI Session

Verifies authentication with NEAR AI: Pass conditions:
  • NEARAI_API_KEY environment variable is set, OR
  • Session file exists at ~/.nearai/session and is readable
Fail conditions:
  • No API key and no session file
  • Session file exists but is empty
  • Session file cannot be read
Fix:

Database Backend

Checks database connectivity:

PostgreSQL

Pass conditions:
  • DATABASE_URL is set
  • Can connect to the database
  • SELECT 1 query succeeds
Fail conditions:
  • DATABASE_URL not set
  • Connection timeout (5s)
  • Connection refused
  • Authentication failure
Fix:

libSQL/Turso/SQLite

Pass conditions:
  • Database file exists, OR
  • Database will be created on first run
Info shown:
  • Location of database file
  • Whether it exists or will be created
Fix:

Workspace Directory

Verifies the base directory for IronClaw data: Pass conditions:
  • Directory exists and is readable
  • Directory will be created on first run
Fail conditions:
  • Path exists but is not a directory
  • Permission denied
Fix:

Docker

Checks if Docker is available (required for sandboxed tool execution): Pass conditions:
  • docker binary found in PATH
  • docker --version succeeds
Skip conditions:
  • Docker not installed (normal if not using sandboxed tools)
Fail conditions:
  • Docker installed but not responding
  • Docker daemon not running
Fix:

cloudflared

Checks if Cloudflare Tunnel client is available (for exposing webhooks): Pass conditions:
  • cloudflared binary found in PATH
  • cloudflared --version succeeds
Skip conditions:
  • Not installed (normal if not using Cloudflare Tunnels)
Fix:

ngrok

Checks if ngrok is available (for exposing webhooks): Pass conditions:
  • ngrok binary found in PATH
  • ngrok version succeeds
Skip conditions:
  • Not installed (normal if not using ngrok)
Fix:

tailscale

Checks if Tailscale is available (for secure networking): Pass conditions:
  • tailscale binary found in PATH
  • tailscale version succeeds
Skip conditions:
  • Not installed (normal if not using Tailscale)
Fix:

When to Run Doctor

Run ironclaw doctor when:
  1. After installation - Verify everything is set up correctly
  2. Before first run - Check all dependencies
  3. After configuration changes - Validate new settings
  4. Troubleshooting - Diagnose issues
  5. Before deploying - Ensure production readiness

Common Issues

”session file not found"

"PostgreSQL connection failed"

"Docker not found”

Docker is optional. If you need it:

“Permission denied” on workspace directory

Exit Codes

  • 0 - All critical checks passed
  • 1 - One or more checks failed
Note: Skipped checks (optional binaries) do not affect the exit code.

Interpreting Results

Critical Failures

These must be fixed before using IronClaw:
  • NEAR AI session
  • Database backend
  • Workspace directory

Optional Failures

These are only needed for specific features:
  • Docker - Required for sandboxed WASM tool execution
  • cloudflared - Only needed for Cloudflare Tunnel webhooks
  • ngrok - Only needed for ngrok webhooks
  • tailscale - Only needed for Tailscale networking

Automated Checks

Include doctor in your deployment scripts:

CI/CD Integration

  • onboard - Run initial configuration wizard
  • config - View and modify settings
  • service - Manage background service