diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index ca0fc4f..2e57b9f 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -73,20 +73,29 @@ OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ## Verifying your configuration -The CLI checks for required environment variables before making a call. Run a quick check: +!!! tip "Verify your setup" + Run `call-use doctor` to check all variables are set and LiveKit is reachable. See the [CLI guide](../guides/cli.md#call-use-doctor) for full details. ```bash -call-use dial "+18001234567" -i "Test" 2>&1 | head -5 +call-use doctor ``` -If any variables are missing, you will see a clear error message listing what is needed: +If everything is configured correctly you will see all green checks: ``` -Missing required environment variables: - LIVEKIT_URL — LiveKit server URL (wss://...) - SIP_TRUNK_ID — Twilio SIP trunk ID in LiveKit + ✓ LIVEKIT_URL set + ✓ LIVEKIT_API_KEY set + ✓ LIVEKIT_API_SECRET set + ✓ SIP_TRUNK_ID set + ✓ OPENAI_API_KEY set + ✓ DEEPGRAM_API_KEY set + ✓ LiveKit connection OK + + 7 passed, 0 failed ``` +If any variables are missing, doctor will flag them with ✗ and exit with code 1. + ## Starting the worker Before making calls, start the call-use worker process in a separate terminal: diff --git a/docs/guides/cli.md b/docs/guides/cli.md index 0eefb1b..5af3785 100644 --- a/docs/guides/cli.md +++ b/docs/guides/cli.md @@ -35,6 +35,57 @@ call-use dial PHONE [OPTIONS] | `--timeout` | | `int` | `600` | Max call duration in seconds | | `--approval-required` | | flag | `False` | Require interactive approval for sensitive actions | +### `call-use doctor` + +Check that all required environment variables are set and that LiveKit is reachable. This is the fastest way to verify your setup before making a call. + +```bash +call-use doctor +``` + +The command checks six environment variables (`LIVEKIT_URL`, `LIVEKIT_API_KEY`, `LIVEKIT_API_SECRET`, `SIP_TRUNK_ID`, `OPENAI_API_KEY`, `DEEPGRAM_API_KEY`) and then attempts to connect to your LiveKit server. + +**Example output (all configured):** + +``` + ✓ LIVEKIT_URL set + ✓ LIVEKIT_API_KEY set + ✓ LIVEKIT_API_SECRET set + ✓ SIP_TRUNK_ID set + ✓ OPENAI_API_KEY set + ✓ DEEPGRAM_API_KEY set + ✓ LiveKit connection OK + + 7 passed, 0 failed +``` + +**Example output (partial configuration):** + +``` + ✓ LIVEKIT_URL set + ✓ LIVEKIT_API_KEY set + ✓ LIVEKIT_API_SECRET set + ✗ SIP_TRUNK_ID missing + ✗ OPENAI_API_KEY missing + ✓ DEEPGRAM_API_KEY set + ✗ LiveKit connection failed: ... + + 3 passed, 4 failed +``` + +**When to use it:** + +- After first-time setup, to confirm every credential is in place. +- When a call fails unexpectedly, to rule out configuration issues. +- In CI, as a smoke test before running integration tests. + +**Exit codes:** + +| Code | Meaning | +|------|---------| +| `0` | All checks passed | +| `1` | One or more checks failed | + ### `call-use --version` Print the installed version.