Skip to main content

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

FlagDescriptionDefault
--fixAttempt to automatically fix detected issuesfalse

What It Checks

The doctor command inspects the following areas:

CheckDescription
Node.js versionVerifies Node.js 18+ is installed
npm versionVerifies npm 9+ is installed
.env.local completenessChecks that all required environment variables are present
Authentication statusValidates that stored credentials are present and not expired
Platform connectivityTests connectivity to all platform services
Package dependenciesVerifies node_modules is present and dependencies are up to date
TypeScript compilationChecks 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.local variables may be populated by running eai 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.
  • eai verify -- Focused platform connectivity checks (a subset of what doctor checks)
  • eai env pull -- Fix missing environment variables
  • eai login -- Fix authentication issues