Skip to main content

CLI Commands

doctor

The doctor command runs diagnostics and can automatically fix issues with your Cogni+ CLI installation.

Usage

cogni doctor [OPTIONS]

Description

The doctor command performs a series of checks on your Cogni+ CLI installation and environment to identify any potential issues. It verifies things like:
  • Configuration file integrity
  • Authentication status
  • Network connectivity
  • Required dependencies
  • File permissions
  • Docker configuration (if applicable)
When issues are found, it can either suggest fixes or automatically resolve them with your permission.

Options

OptionDescription
--fixAutomatically try to fix identified issues
--verboseShow detailed information for all checks
--jsonOutput results in JSON format
--helpShow help message for the doctor command

Examples

# Run diagnostics and show issues
cogni doctor

# Run diagnostics and automatically fix issues
cogni doctor --fix

# Run diagnostics with detailed output
cogni doctor --verbose

# Export diagnostic results as JSON
cogni doctor --json > diagnostics.json

Output

The command displays each check it performs with a status indicator:
Running diagnostics...

✅ Configuration file: Found at ~/.cogni/config.json
✅ Authentication: Logged in as [email protected]
✅ Network connectivity: Can reach Cogni+ API
✅ Dependencies: All required tools are installed
⚠️ Docker connectivity: Docker daemon not running
❌ MCP server: Unable to start MCP gateway server

Found 2 issues:
1. ⚠️ Docker daemon is not running
   Run 'sudo systemctl start docker' to start the Docker daemon.

2. ❌ MCP gateway server fails to start
   Port 8080 is already in use. Use 'cogni init' to configure a different port.

Run 'cogni doctor --fix' to attempt automatic fixes.
With the --fix flag, it attempts to resolve issues:
Running diagnostics...
[checks output...]

Found 2 issues. Attempting to fix:

1. ⚠️ Docker daemon is not running
   Starting Docker daemon... done ✅

2. ❌ MCP gateway server fails to start
   Updating configuration to use port 8081... done ✅

All issues have been resolved. Run 'cogni doctor' to verify.

Tips

  • Run this command if you encounter unexpected errors with other commands
  • Use it after updating to ensure everything is working correctly
  • The --verbose flag is useful for troubleshooting difficult issues
  • Include the JSON output when seeking support from the Cogni+ team