eai doctor
Diagnose common issues with your development environment and optionally fix them.
Syntax
eai doctor [options]
Description
The eai doctor command performs a comprehensive health check of your local development environment and platform connectivity. It identifies common issues and can attempt to fix them automatically when the --fix flag is provided.
Options
| Flag | Description | Default |
|---|---|---|
--fix | Attempt to automatically fix detected issues | false |
What It Checks
The doctor command inspects the following areas:
| Check | Description |
|---|---|
| Node.js version | Verifies Node.js 18+ is installed |
| npm version | Verifies npm 9+ is installed |
.env.local completeness | Checks that all required environment variables are present |
| Authentication status | Validates that stored credentials are present and not expired |
| Platform connectivity | Tests connectivity to all platform services |
| Package dependencies | Verifies node_modules is present and dependencies are up to date |
| TypeScript compilation | Checks that the project compiles without errors |
Examples
Run diagnostics only
eai doctor
Sample output:
Running diagnostics...
Node.js version OK (v20.11.0)
npm version OK (v10.2.4)
.env.local WARN Missing ENTRA_CLIENT_ID
Authentication OK
Platform OK
Dependencies OK
TypeScript OK
1 warning found. Run 'eai doctor --fix' to attempt automatic fixes.
Run diagnostics and fix issues
eai doctor --fix
When --fix is provided, the doctor will attempt to resolve issues automatically. For example:
- Missing
.env.localvariables may be populated by runningeai env pull. - Outdated dependencies may be resolved by running
npm install. - Expired authentication may be resolved by triggering
eai login.
When to Use
- After cloning a project -- Verify your environment is set up correctly.
- When something is not working -- Get a quick overview of potential issues.
- Before submitting a bug report -- Include the doctor output to help with diagnosis.
Related Commands
eai verify-- Focused platform connectivity checks (a subset of what doctor checks)eai env pull-- Fix missing environment variableseai login-- Fix authentication issues