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
Thedoctor command performs a series of checks to verify:
- Authentication - NEAR AI session or API key
- Database - Database backend connectivity
- Workspace - Directory existence and permissions
- External binaries - Docker, cloudflared, ngrok, tailscale
[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_KEYenvironment variable is set, OR- Session file exists at
~/.nearai/sessionand is readable
- No API key and no session file
- Session file exists but is empty
- Session file cannot be read
Database Backend
Checks database connectivity:PostgreSQL
Pass conditions:DATABASE_URLis set- Can connect to the database
SELECT 1query succeeds
DATABASE_URLnot set- Connection timeout (5s)
- Connection refused
- Authentication failure
libSQL/Turso/SQLite
Pass conditions:- Database file exists, OR
- Database will be created on first run
- Location of database file
- Whether it exists or will be created
Workspace Directory
Verifies the base directory for IronClaw data: Pass conditions:- Directory exists and is readable
- Directory will be created on first run
- Path exists but is not a directory
- Permission denied
Docker
Checks if Docker is available (required for sandboxed tool execution): Pass conditions:dockerbinary found in PATHdocker --versionsucceeds
- Docker not installed (normal if not using sandboxed tools)
- Docker installed but not responding
- Docker daemon not running
cloudflared
Checks if Cloudflare Tunnel client is available (for exposing webhooks): Pass conditions:cloudflaredbinary found in PATHcloudflared --versionsucceeds
- Not installed (normal if not using Cloudflare Tunnels)
ngrok
Checks if ngrok is available (for exposing webhooks): Pass conditions:ngrokbinary found in PATHngrok versionsucceeds
- Not installed (normal if not using ngrok)
tailscale
Checks if Tailscale is available (for secure networking): Pass conditions:tailscalebinary found in PATHtailscale versionsucceeds
- Not installed (normal if not using Tailscale)
When to Run Doctor
Runironclaw doctor when:
- After installation - Verify everything is set up correctly
- Before first run - Check all dependencies
- After configuration changes - Validate new settings
- Troubleshooting - Diagnose issues
- 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 passed1- One or more checks failed
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
Includedoctor in your deployment scripts: