doctor command is a built-in diagnostic tool that checks your Apicentric installation and environment for potential issues.
Overview
The doctor command performs automated checks on your system to ensure everything is configured correctly. It helps you quickly identify and resolve common problems.What it checks
The doctor command runs the following checks:Apicentric version
Verifies that Apicentric is properly installed and displays the current version.This check always passes if you can run the doctor command, as it confirms the CLI is working.
Rust installation
Checks if Rust and Cargo are installed on your system. This is useful if you plan to build Apicentric from source or install plugins.If Cargo is not found, you’ll see a ❌ error. However, this only affects building from source—prebuilt binaries work without Rust.
Docker installation
Verifies that Docker is installed and available. Docker is required for thedockerize command.
Services directory
Checks if a./services directory exists in your current working directory. This is where Apicentric looks for service definition files by default.
Configuration file
Checks for anapicentric.json configuration file in the current directory.
Apicentric works perfectly fine with default settings. A configuration file is only needed for custom settings.
Understanding the output
After running all checks, the doctor command displays a summary:All checks passed
Some checks failed
Common issues and solutions
Cargo not found
Issue: ❌ Cargo not found Impact: You cannot build Apicentric from source or install Cargo-based plugins. Solution: Install Rust and Cargo:apicentric doctor again.
Docker not found
Issue: ⚠️ Docker not found Impact: Thedockerize command will not work.
Solution: Install Docker from docker.com
After installation, verify with:
No services directory
Issue: ℹ️ ./services not found Impact: None—this is informational only. Solution: Create a services directory if you want to organize your service definitions:No configuration file
Issue: ℹ️ apicentric.json not found Impact: None—default settings will be used. Solution: Create a configuration file only if you need custom settings:When to run doctor
Run the doctor command:- After installing Apicentric for the first time
- When troubleshooting installation or runtime issues
- Before filing a bug report (include the output)
- After system updates that might affect dependencies
- When switching between different installation methods
Example output
Here’s an example of a complete doctor command output:Next steps
If the doctor command reveals issues:- Follow the suggestions provided in the output
- Check the common issues guide for detailed solutions
- Review the installation guide if reinstalling is needed
- Visit the GitHub issues if problems persist