Skip to content

feat(pgpm): add --minio flag to pgpm env for CDN/S3 environment variables#976

Merged
pyramation merged 1 commit intomainfrom
feat/pgpm-env-minio-profile
Apr 11, 2026
Merged

feat(pgpm): add --minio flag to pgpm env for CDN/S3 environment variables#976
pyramation merged 1 commit intomainfrom
feat/pgpm-env-minio-profile

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Adds a --minio flag to pgpm env that exports CDN/S3 environment variables (CDN_ENDPOINT, AWS_ACCESS_KEY, AWS_SECRET_KEY, AWS_REGION) alongside the existing PostgreSQL variables. This follows the same opt-in pattern as --supabase — Minio vars are only included when explicitly requested.

pgpm env --minio                  # Postgres + MinIO vars
pgpm env --supabase --minio       # Supabase + MinIO vars
eval "$(pgpm env --minio)"        # Load both into shell
pgpm env --minio pgpm deploy ...  # Run command with both sets

Also fixes the arg-parsing logic: the old code used index-based slicing that only knew about --supabase (everything before --supabase in arg position would be silently dropped). Replaced with a knownFlags filter that cleanly strips recognized flags regardless of position, which also makes it trivial to add future flags.

Context: follows PR #975 which added --include minio to pgpm docker. This gives users a matching way to get the env vars those containers need.

Review & Testing Checklist for Human

  • Verify env var naming: This exports CDN_ENDPOINT but CLAUDE.md references MINIO_ENDPOINT for S3/MinIO tests. Confirm CDN_ENDPOINT is correct for the app's upload/streaming packages, or if it should be MINIO_ENDPOINT (or both)
  • Verify AWS_ACCESS_KEY vs AWS_ACCESS_KEY_ID: Standard AWS SDK expects AWS_ACCESS_KEY_ID — confirm the codebase uses AWS_ACCESS_KEY (the non-standard name) everywhere
  • Test arg parsing edge cases: Run pgpm env --minio, pgpm env --supabase --minio, pgpm env --minio pgpm deploy --database db1 and verify the correct exports are printed and commands execute with the right env
  • Confirm defaults match docker command: The Minio defaults here (endpoint http://localhost:9000, creds minioadmin/minioadmin) should match what pgpm docker start --include minio actually starts

Notes

  • The help text examples were trimmed to make room for --minio variants — a few --supabase-only examples were removed (the flag still works, just fewer examples shown).
  • The arg parsing refactor changes behavior in one edge case: if --supabase appeared after positional command args (e.g., pgpm env createdb --supabase), the old code would drop createdb. The new code preserves it. This is a bug fix.
  • No automated tests — this is a CLI env-export command that would need integration testing with actual shell evaluation.

Link to Devin session: https://app.devin.ai/sessions/44eca4b3fe5a46aaaf5c4907f0a0b600
Requested by: @pyramation

…bles

- Add --minio flag that exports CDN_ENDPOINT, AWS_ACCESS_KEY, AWS_SECRET_KEY, AWS_REGION
- Works alongside --supabase: pgpm env --supabase --minio
- Fix arg parsing to use knownFlags filter instead of fragile index-based slicing
- Update help text in env.ts and display.ts
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit d9de676 into main Apr 11, 2026
49 checks passed
@pyramation pyramation deleted the feat/pgpm-env-minio-profile branch April 11, 2026 01:37
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