fix(cli): pass Grafana password directly to Docker during local-install

Summary

Fixes the bug where the Grafana password shown after mon local-install doesn't work, even on a fresh install.

Problem

The password shown to the user didn't work because of a silent failure in the code:

  1. Step 4 generates password and saves to .pgwatch-config
  2. Step 5 calls runCompose() which re-reads .pgwatch-config
  3. Bug: If reading/parsing fails, the catch block silently continues without setting GF_SECURITY_ADMIN_PASSWORD
  4. Docker falls back to default password demo (from docker-compose.yml)
  5. User sees generated password but Grafana has demo

Solution

Pass the password directly to runCompose() when we already have it in memory (during local-install), instead of relying on re-reading the file.

Changes

  • Added optional grafanaPassword parameter to runCompose() function
  • Modified logic to use passed password first, then fall back to reading from .pgwatch-config
  • Pass grafanaPassword to runCompose() in the local-install Step 5

Closes #79 (closed)

🤖 Generated with Claude Code

Merge request reports

Loading