Skip to content

feat: hulak env migrate — convert env/*.env to encrypted store (#143)#185

Merged
xaaha merged 8 commits intomainfrom
143-hulak-migrate-env-convert-envenv-to-encrypted-store
Apr 30, 2026
Merged

feat: hulak env migrate — convert env/*.env to encrypted store (#143)#185
xaaha merged 8 commits intomainfrom
143-hulak-migrate-env-convert-envenv-to-encrypted-store

Conversation

@xaaha
Copy link
Copy Markdown
Owner

@xaaha xaaha commented Apr 30, 2026

Summary

  • Add hulak env migrate command that converts env/*.env files into .hulak/store.age
  • Refactor LoadEnvVars → extract LoadEnvVarsRaw for $VAR-preserving parsing
  • Extract bootstrapVault helper, reuse in InitVaultProject (−15 lines)
  • Update hulak migrate env references → hulak env migrate

Behavior

  • Scans env/ for *.env files, parses each with LoadEnvVarsRaw
  • Existing store values win on conflicts (re-running is safe/idempotent)
  • $VAR values stored as literals — resolved at runtime by resolveEnvRefs
  • Non-.env files skipped with warning
  • Empty .env files create empty sections
  • env/ directory NOT deleted — user does that manually
  • Recovery key warning only on first-time keypair generation

Test plan

  • Single/multiple .env file migration
  • Existing store wins on key conflicts
  • $VAR preserved as literal string
  • Non-.env files skipped
  • Empty .env creates empty section
  • Error: env/ missing
  • Error: env/ is a file
  • LoadEnvVarsRaw preserves raw values + type inference
  • LoadEnvVars regression: still resolves $VAR
  • mise check — 0 lint issues, all tests pass

Closes #143

@xaaha xaaha linked an issue Apr 30, 2026 that may be closed by this pull request
@xaaha xaaha requested a review from pthapa1 April 30, 2026 14:53
@xaaha xaaha merged commit 9223cbf into main Apr 30, 2026
2 checks passed
@xaaha xaaha deleted the 143-hulak-migrate-env-convert-envenv-to-encrypted-store branch April 30, 2026 15:25
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.

hulak migrate env — convert env/*.env to encrypted store

2 participants