Skip to content

feat: auto-load .beads/.env for per-project Dolt credentials#2640

Open
DreadPirateRobertz wants to merge 1 commit intosteveyegge:mainfrom
DreadPirateRobertz:feat/beads-env-file
Open

feat: auto-load .beads/.env for per-project Dolt credentials#2640
DreadPirateRobertz wants to merge 1 commit intosteveyegge:mainfrom
DreadPirateRobertz:feat/beads-env-file

Conversation

@DreadPirateRobertz
Copy link

Summary

  • Auto-loads .beads/.env into process environment before store initialization
  • Enables per-project Dolt server configuration (BEADS_DOLT_SERVER_HOST, BEADS_DOLT_PASSWORD, etc.) without shell wrappers, direnv, or global env vars
  • Uses gotenv.Load (already an indirect dependency via viper) which is non-overriding — shell env always wins
  • Adds .env to .gitignore template and required patterns to prevent credential commits

How it works

project-a/.beads/.env  → BEADS_DOLT_SERVER_HOST=192.168.1.50 → connects to remote
project-b/.beads/.env  → BEADS_DOLT_SERVER_HOST=192.168.1.50 → connects to remote  
project-c/             → no .env → uses local embedded Dolt (unchanged)

Env var precedence (preserved)

shell environment > .beads/.env > metadata.json defaults

Test plan

  • Create .beads/.env with BEADS_DOLT_SERVER_HOST=some-host, verify bd attempts connection to that host
  • Verify shell env var overrides .env value
  • Verify bd doctor flags missing .env in .gitignore
  • Verify projects without .beads/.env behave unchanged

Addresses #2520

🤖 Generated with Claude Code

Loads .beads/.env into process environment before store initialization,
enabling per-project Dolt server configuration without shell wrappers
or global env vars.

Uses gotenv.Load which is non-overriding — shell environment always
takes precedence over .env values.

Also adds .env to the .gitignore template and required patterns to
prevent accidentally committing credentials.

Addresses steveyegge#2520

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Executed-By: gastown/crew/zhora
Rig: gastown
Role: crew
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