From 0f93bef2406209aed9c5e9113a7233e47e82e611 Mon Sep 17 00:00:00 2001 From: matt wilkie Date: Wed, 24 Dec 2025 09:38:13 -0700 Subject: [PATCH] fix(bd-68e4): export must specify -o to write to file, not stdout When 'bd doctor --fix' detects DB has more issues than JSONL, it runs 'bd export' to sync them. However, 'bd export' without -o flag outputs to stdout instead of writing to .beads/issues.jsonl, making the fix a no-op. Add -o .beads/issues.jsonl --force to the export command to ensure the JSONL file is actually updated. --- cmd/bd/doctor/fix/sync.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/bd/doctor/fix/sync.go b/cmd/bd/doctor/fix/sync.go index 3dfc3ce6..4024cce6 100644 --- a/cmd/bd/doctor/fix/sync.go +++ b/cmd/bd/doctor/fix/sync.go @@ -105,7 +105,9 @@ func DBJSONLSync(path string) error { // Run the appropriate sync command var cmd *exec.Cmd if syncDirection == "export" { - cmd = exec.Command(bdBinary, "export") // #nosec G204 -- bdBinary from validated executable path + // Export DB to JSONL file (must specify -o to write to file, not stdout) + jsonlOutputPath := filepath.Join(beadsDir, "issues.jsonl") + cmd = exec.Command(bdBinary, "export", "-o", jsonlOutputPath, "--force") // #nosec G204 -- bdBinary from validated executable path } else { cmd = exec.Command(bdBinary, "sync", "--import-only") // #nosec G204 -- bdBinary from validated executable path }