Skip to content

qm init: pick one email transport and scaffold only its keys - #31

Merged
ReganBell merged 2 commits into
mainfrom
init-email-transport
Jul 30, 2026
Merged

qm init: pick one email transport and scaffold only its keys#31
ReganBell merged 2 commits into
mainfrom
init-email-transport

Conversation

@ReganBell

@ReganBell ReganBell commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

A real deployment was confused by qm init scaffolding both transports at once: .env.example offered RESEND_API_KEY and SMTP_HOST/SMTP_USERNAME/SMTP_PASSWORD while the config silently defaulted to resend, so operators filled in the wrong set and only found out when sign-in emails never arrived.

qm init now takes --email-transport resend|smtp (default resend, matching the previous scaffold), mirroring the existing --model-provider flag pattern:

  • the scaffolded config's env.auth.AUTH_EMAIL_TRANSPORT is set to the chosen transport (fly and aws scaffolds; docker has no auth service)
  • renderEnvExample drops catalog entries gated on the other AUTH_EMAIL_TRANSPORT value, so the scaffolded .env and .env.example contain only the chosen transport's keys — the chosen transport's keys appear uncommented and required
  • AUTH_EMAIL_TRANSPORT validation and the flag share one EMAIL_TRANSPORTS definition in config.ts

Tests: new init case asserting --email-transport smtp writes a matching config with SMTP_* required and no RESEND_API_KEY anywhere in .env/.env.example, plus assertions that the default resend scaffold contains no SMTP_* keys. npm run typecheck, eslint, and oxlint clean; init/secrets/config/cli-dispatch/providers/auth-broker/setup suites pass (127/127).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@ReganBell
ReganBell force-pushed the init-email-transport branch from f1282dc to f194e93 Compare July 30, 2026 21:13
@ReganBell
ReganBell merged commit 9723930 into main Jul 30, 2026
13 of 14 checks passed
@ReganBell
ReganBell deleted the init-email-transport branch July 30, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant