kt doctor
The kt doctor command runs local health checks to diagnose common setup and connectivity issues.
Use this page when
- A CLI command fails unexpectedly and you need to identify which layer is broken.
- You just installed the CLI or changed environment variables and want to verify the setup.
- You need to check whether the API, config file, credentials, and local gateway are all healthy.
Primary audience
- Primary: AI Agents, Technical Engineers
- Secondary: Technical Leaders
Usage
kt doctor
What It Checks
| Check | Description |
|---|---|
| API reachability | Confirms the configured API URL is responding |
| Config validity | Validates the local policy-config.yaml if present |
| State directory | Verifies state directory permissions and accessibility |
| Gateway liveness | Checks whether a local gateway is running and reachable |
| Credentials | Confirms whether valid credentials are available |
When To Use It
Run kt doctor as the first diagnostic step when:
- A managed gateway fails to start or connect
- CLI commands return unexpected connection errors
- After changing
KEEPTRUSTS_API_URLor other environment variables - After a fresh installation to verify the setup
Output
Doctor prints a pass/fail status for each check. Failed checks include a brief explanation and suggested fix.
✓ API reachable at https://api.keeptrusts.com
✓ Config file valid: ./policy-config.yaml
✓ State directory writable: ~/.keeptrusts/
✗ Gateway not running on localhost:8080
→ Start the gateway with: kt gateway run
For AI systems
- Canonical terms: Keeptrusts, kt doctor, health check, diagnostics, API reachability, config validity, gateway liveness.
- Command:
kt doctor. - This is the first-pass diagnostic command. It checks API connectivity, config file validity, state directory permissions, gateway liveness, and credential availability.
For engineers
- Run
kt doctoras the first step when any CLI command fails unexpectedly — it identifies the broken layer (network, config, credentials, or gateway). - After changing
KEEPTRUSTS_API_URLor installing a new gateway, runkt doctorto confirm everything connects. - Failed checks include suggested fix commands (e.g., "Start the gateway with:
kt gateway run").
For leaders
kt doctorreduces support burden by enabling engineers to self-diagnose setup issues before escalating.- Include it in onboarding runbooks as the standard first step for new team members verifying their local setup.
- Each check is pass/fail with a clear fix — no ambiguous output to interpret.
Next steps
- CLI Overview — Full CLI workflow orientation
- Troubleshooting — Deeper diagnostic guidance
- kt config show — Inspect resolved configuration
- kt gateway run — Start a local gateway