Skip to content

Commit 86fbfa6

Browse files
committed
feat(functions:config:export): add AI migration prompt and enhance export functionality
- Add --prompt flag to generate AI-optimized migration prompts - Add --dry-run flag to preview exports without writing files - Add --prefix flag to handle invalid environment variable keys - Implement smart secret detection with pattern matching - Enhance .env file formatting with aligned comments and categorized sections - Add secret categorization (definite secrets vs likely secrets vs safe configs) - Comment out detected secrets with migration instructions - Improve error messages for invalid prefixes - Fix JSON mode to be truly non-interactive - Add helpful migration hints and footer notes to .env files
1 parent c8290be commit 86fbfa6

File tree

3 files changed

+380
-216
lines changed

3 files changed

+380
-216
lines changed

prompts/functions-config-migration.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ Do not prefix parameter names with the codebase name (e.g., avoid TEAM_A_API_KEY
4040
- **Injected outside Firebase at runtime?**`process.env.NAME`
4141

4242
### 3. Edge‑case notes
43-
- **Invalid keys** – if `functions:config:export` prompts for a prefix (key starts with a digit), use the prefixed name (`FF_CONFIG_`).
43+
- **Invalid keys** – Some config keys cannot be directly converted to valid environment variable names (e.g., keys starting with digits, containing invalid characters). These will be marked in the configuration analysis. Always:
44+
- Ask the user for their preferred prefix (default suggestion: `CONFIG_`)
45+
- Apply the same prefix consistently to all invalid keys
46+
- Explain why the keys are invalid and show the transformation
4447
- **Nested blobs** – flatten (`service.db.user``SERVICE_DB_USER`). For large JSON config, must make individual value it's own parameter.
4548

4649
### 4. Worked out examples

0 commit comments

Comments
 (0)