divekit doctor

Diagnose your Divekit environment and detect common configuration issues.

divekit doctor runs a series of focused checks to validate your local setup. It helps identify misconfigurations early and prints PASS/FAIL results for each check.

Usage

divekit doctor

What it currently checks

The current implementation performs these checks:

  • Divekit Home Directory
    • Ensures your Divekit home directory exists and is initialized.
  • Configuration Availability
    • Verifies that a valid Divekit home can be determined for configuration access.
  • GitLab Connection (basic)
    • Attempts to read a token from the OS credential store and a default host from ~/.divekit/hosts.json, then performs a basic API connectivity check.
    • Notes:
      • Tokens are retrieved from your OS credential manager (Keychain on macOS, Credential Manager on Windows, Secret Service on Linux).
      • hosts.json stores host metadata and a token-key reference, not the token itself.
  • Unresolved Token Detection (sanity)
    • Runs a lightweight sanity-check for unresolved template tokens in example content using your effective token delimiters.

Output format

The command prints a compact PASS/FAIL report:

--- Doctor Results ---
PASS Divekit Home Directory
PASS Configuration File
PASS GitLab Connection & Token (Basic Check)
PASS Unresolved Token Detection
--------------------

If a check fails, a FAIL line is printed with an error explanation.

Preparing your environment for doctor

To enable the GitLab connection check:

  1. Configure a GitLab host and token
# Simplified (prompts for token and stores it in OS keychain)
divekit config set @hosts git-nrw https://gitlab.git.nrw/

# Or non-interactive with token flag
divekit config set @hosts git-nrw https://gitlab.git.nrw/ --token glpat-xxx...
  1. Verify the host entry
divekit config get @hosts.git-nrw

Troubleshooting

  • Token not found:
    • Add a host as shown above or open your OS credential manager and verify an entry exists for “divekit-cli”.
  • Base URL unknown:
    • Ensure ~/.divekit/hosts.json contains a default host or the host you intend to use.
  • Keychain inspection:
    • macOS: Keychain Access → search “divekit-cli”
    • Windows: Credential Manager → Windows Credentials → search “divekit-cli”
    • Linux: secret-tool search service divekit-cli

Notes and roadmap

  • The doctor command focuses on essential checks. Additional in-depth validations (e.g., distribution remotes, module presence) may be added in future iterations.
  • No subcommands are currently available; the legacy “doctor list/check …” interface mentioned in older drafts is not implemented.