beads/docs
Peter Chanthamynavong b7d650bd8e
fix(init): respect BEADS_DIR environment variable (#1273)
* fix(sync): read sync.mode from yaml first, then database

bd config set sync.mode writes to config.yaml (because sync.* is a
yaml-only prefix), but GetSyncMode() only read from the database.

This caused dolt-native mode to be ignored - JSONL export still
happened because the database had no sync.mode value.

Now GetSyncMode() checks config.yaml first (via config.GetSyncMode()),
falling back to database for backward compatibility.

Fixes: oss-5ca279

* fix(init): respect BEADS_DIR environment variable

Problem:
- `bd init` ignored BEADS_DIR when checking for existing data
- `bd init` created database at CWD/.beads instead of BEADS_DIR
- Contributor wizard used ~/.beads-planning as default, ignoring BEADS_DIR

Solution:
- Add BEADS_DIR check in checkExistingBeadsData() (matches FindBeadsDir pattern)
- Compute beadsDirForInit early, before initDBPath determination
- Use BEADS_DIR as default in contributor wizard when set
- Preserve precedence: --db > BEADS_DB > BEADS_DIR > default

Impact:
- Users with BEADS_DIR set now get consistent behavior across all bd commands
- ACF-style fork tracking (external .beads directory) now works correctly

Fixes: steveyegge/beads#???

* fix(doctor): respect BEADS_DIR environment variable

Also updates documentation to reflect BEADS_DIR support in init and doctor.

Changes:
- doctor.go: Check BEADS_DIR before falling back to CWD
- doctor_test.go: Add tests for BEADS_DIR path resolution
- WORKTREES.md: Document simplified BEADS_DIR+init workflow
- CONTRIBUTOR_NAMESPACE_ISOLATION.md: Note init/doctor BEADS_DIR support

* test(init): add BEADS_DB > BEADS_DIR precedence test

Verifies that BEADS_DB env var takes precedence over BEADS_DIR
when both are set, ensuring the documented precedence order:
--db > BEADS_DB > BEADS_DIR > default

* chore: fill in GH#1277 placeholder in sync_mode comment
2026-01-24 17:10:05 -08:00
..
design docs(design): add KV store design for Dolt team review 2026-01-21 20:39:45 -08:00
dev-notes docs: fix broken relative links across documentation 2025-12-16 00:46:08 -08:00
ADAPTIVE_IDS.md docs: fix broken relative links across documentation 2025-12-16 00:46:08 -08:00
ADVANCED.md docs: add Database Redirects section to ADVANCED.md (bd-8x43) 2025-12-27 22:04:25 -08:00
AIDER_INTEGRATION.md Add Aider integration for beads issue tracking 2025-11-23 15:13:54 -08:00
ANTIVIRUS.md feat: add Windows code signing infrastructure (bd-14v0) 2025-12-24 00:07:16 -08:00
ARCHITECTURE.md Add close_reason to JSONL format documentation and tests (bd-lxzx) 2025-12-30 17:05:48 -08:00
ATTRIBUTION.md Reorganize project structure: move Go files to internal/beads, docs to docs/ 2025-11-05 21:04:00 -08:00
CLAUDE.md docs: fix broken relative links across documentation 2025-12-16 00:46:08 -08:00
CLAUDE_INTEGRATION.md docs: document bd setup command 2025-12-16 01:08:42 -08:00
CLI_REFERENCE.md feat(setup): add Codex CLI setup recipe (#1243) 2026-01-21 21:50:01 -08:00
COLLISION_MATH.md docs: fix broken relative links across documentation 2025-12-16 00:46:08 -08:00
COMMUNITY_TOOLS.md Add beads-kanban-ui and beads-orchestration to Community Tools (#1255) 2026-01-22 13:04:48 -08:00
CONFIG.md feat(dolt): auto-commit write commands and set explicit commit authors (#1270) 2026-01-22 20:52:20 -08:00
CONTRIBUTOR_NAMESPACE_ISOLATION.md fix(init): respect BEADS_DIR environment variable (#1273) 2026-01-24 17:10:05 -08:00
daemon-summary.md feat(daemon): unify auto-sync config for simpler agent workflows (#904) 2026-01-06 12:52:19 -08:00
DAEMON.md fix(daemon): prevent zombie state after database file replacement (#1213) 2026-01-21 22:46:59 -08:00
DELETIONS.md docs: update documentation for CLI consolidation (bd-bxqv) 2025-12-27 16:21:08 -08:00
ERROR_HANDLING.md docs: Complete error handling audit 2025-11-24 00:35:04 -08:00
EXCLUSIVE_LOCK.md docs: update daemon CLI syntax from flags to subcommands 2026-01-14 21:47:15 -08:00
EXTENDING.md docs: deprecate EXTENDING.md custom tables approach 2026-01-14 20:59:13 -08:00
FAQ.md docs: fix README and PLUGIN.md documentation issues (#763) 2025-12-27 17:20:00 -08:00
GIT_INTEGRATION.md feat(dolt): auto-commit write commands and set explicit commit authors (#1270) 2026-01-22 20:52:20 -08:00
graph-links.md refactor: remove Gas Town references from codebase 2025-12-30 14:13:32 -08:00
INSTALLING.md feat(setup): add Codex CLI setup recipe (#1243) 2026-01-21 21:50:01 -08:00
INTERNALS.md bd sync: 2025-11-25 11:35:26 2025-11-25 11:35:26 -08:00
LABELS.md feat: add bd state and bd set-state helper commands (bd-7l67) 2025-12-30 15:57:08 -08:00
LINTING.md Document -short flag, update linting baseline, clarify bd edit MCP exclusion 2025-11-06 19:42:01 -08:00
MOLECULES.md refactor: remove Gas Town references from codebase 2025-12-30 14:13:32 -08:00
MULTI_REPO_AGENTS.md docs: update beads.jsonl references to issues.jsonl 2025-12-16 01:08:46 -08:00
MULTI_REPO_HYDRATION.md Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
MULTI_REPO_MIGRATION.md Merge GH#409 2025-12-16 01:19:07 -08:00
PERFORMANCE_TESTING.md docs: add performance testing guide (bd-zj8e) 2025-11-28 23:26:24 -08:00
PLUGIN.md Update link to install script (#867) 2026-01-03 12:53:58 -08:00
pr-752-chaos-testing-review.md refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
PROTECTED_BRANCHES.md fix: Validate sync-branch at config-time and runtime (closes #1166) (#1168) 2026-01-19 10:11:06 -08:00
QUICKSTART.md feat(dolt): auto-commit write commands and set explicit commit authors (#1270) 2026-01-22 20:52:20 -08:00
README_TESTING.md DOCTOR IMPROVEMENTS: visual improvements/grouping + add comprehensive tests + fix gosec warnings (#656) 2025-12-20 03:10:06 -08:00
RELEASING.md docs: fix broken relative links across documentation 2025-12-16 00:46:08 -08:00
REPO_CONTEXT.md feat(context): centralize RepoContext API for git operations (#1102) 2026-01-15 07:55:08 -08:00
ROUTING.md fix(routing): auto-enable hydration and flush JSONL after routed create (#1251) 2026-01-21 21:22:04 -08:00
SETUP.md feat(setup): add Codex CLI setup recipe (#1243) 2026-01-21 21:50:01 -08:00
SYNC.md docs: update paths for claude-plugin subdirectory structure (GH#985) (#1007) 2026-01-10 22:49:29 -08:00
TESTING.md chore: code health review - test fix and error comments (bd-9g1z, bd-ork0) 2025-12-22 21:30:57 -08:00
TESTING_PHILOSOPHY.md DOCTOR IMPROVEMENTS: visual improvements/grouping + add comprehensive tests + fix gosec warnings (#656) 2025-12-20 03:10:06 -08:00
TROUBLESHOOTING.md fix(daemon): prevent zombie state after database file replacement (#1213) 2026-01-21 22:46:59 -08:00
UI_PHILOSOPHY.md docs: consolidate duplicate UI_PHILOSOPHY files (GH#745) 2025-12-27 18:01:59 -08:00
UNINSTALLING.md chore: remove obsolete BD_GUIDE.md references 2025-12-20 20:50:33 -08:00
WORKTREES.md fix(init): respect BEADS_DIR environment variable (#1273) 2026-01-24 17:10:05 -08:00