Skip to main content
The doctor command performs a comprehensive health check of your apicentric installation and environment.

Usage

apicentric doctor
No flags or arguments are required.

Checks performed

The doctor command runs the following diagnostic checks:

1. Apicentric version

Verifies that apicentric is properly installed and reports the current version.
✅ v0.1.0

2. Rust installation

Checks that Rust and Cargo are installed and accessible.
✅ cargo 1.78.0 (c1083181f 2024-02-29)
Cargo is required for building and running apicentric from source.

3. Docker installation

Verifies Docker availability for the dockerize command.
✅ Docker version 24.0.5, build ced0996
If Docker is not found:
âš ī¸ Docker not found (required for 'dockerize' command)
Docker is optional. This is a warning, not an error.

4. Services directory

Checks for the default ./services directory.
✅ Found ./services
If not found:
â„šī¸ ./services not found (will be created on first use)

5. Configuration file

Looks for apicentric.json in the current directory.
✅ Found apicentric.json
If not found:
â„šī¸ apicentric.json not found (using defaults)

Sample output

All checks passed

$ apicentric doctor

đŸĨ Apicentric Doctor
Checking your system for potential issues...

Checking apicentric version... ✅ v0.1.0
Checking Rust installation... ✅ cargo 1.78.0 (c1083181f 2024-02-29)
Checking Docker installation... ✅ Docker version 24.0.5, build ced0996
Checking services directory... ✅ Found ./services
Checking configuration... ✅ Found apicentric.json

✨ All systems operational! (5 checks passed) You are ready to build.

With warnings

$ apicentric doctor

đŸĨ Apicentric Doctor
Checking your system for potential issues...

Checking apicentric version... ✅ v0.1.0
Checking Rust installation... ✅ cargo 1.78.0 (c1083181f 2024-02-29)
Checking Docker installation... âš ī¸ Docker not found (required for 'dockerize' command)
Checking services directory... â„šī¸ ./services not found (will be created on first use)
Checking configuration... â„šī¸ apicentric.json not found (using defaults)

✨ All systems operational! (5 checks passed) You are ready to build.

With failures

$ apicentric doctor

đŸĨ Apicentric Doctor
Checking your system for potential issues...

Checking apicentric version... ✅ v0.1.0
Checking Rust installation... ❌ Cargo not found
Checking Docker installation... âš ī¸ Docker not found (required for 'dockerize' command)
Checking services directory... â„šī¸ ./services not found (will be created on first use)
Checking configuration... â„šī¸ apicentric.json not found (using defaults)

âš ī¸ Some issues were found (4 checks passed, 1 failed). Please review the errors above.

Exit codes

CodeMeaning
0All checks passed or only warnings
1One or more critical checks failed

When to run doctor

Run the doctor command:
  • After installation: Verify everything is set up correctly
  • Before deployment: Ensure production environment is ready
  • When troubleshooting: Identify missing dependencies or configuration issues
  • In CI/CD: Validate build environment before running tests

Fixing common issues

Cargo not found

Install Rust and Cargo from rustup.rs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Docker not found

Install Docker from docker.com:
  • macOS: Docker Desktop
  • Windows: Docker Desktop or WSL2 with Docker Engine
  • Linux: Docker Engine via package manager

Services directory missing

Create the directory manually:
mkdir services
Or let apicentric create it when you run simulator start.

Configuration file missing

Create a minimal configuration:
echo '{}' > apicentric.json
Or use the default configuration by not providing a file.

Use in scripts

The doctor command is useful in automation:
#!/bin/bash

if apicentric doctor; then
  echo "Environment ready"
  apicentric simulator start --services-dir ./services
else
  echo "Environment check failed"
  exit 1
fi

Dry run mode

The doctor command is not affected by --dry-run since it only reads system state.
apicentric --dry-run doctor
# Same output as without --dry-run

Next steps

  • Fix any issues reported by doctor
  • Create your first service definition
  • Start the simulator with apicentric simulator start

Build docs developers (and LLMs) love