From e8d0860571e891e3a8ecfe514b3d9de452a9c601 Mon Sep 17 00:00:00 2001 From: Ryan <2199132+rsnodgrass@users.noreply.github.com> Date: Tue, 23 Dec 2025 02:30:33 -0800 Subject: [PATCH] fix(doctor): use --fix instead of manual commands (#715) UX improvement: doctor advice now recommends bd doctor --fix instead of manual commands --- cmd/bd/doctor/git.go | 4 ++-- cmd/bd/doctor/installation.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/bd/doctor/git.go b/cmd/bd/doctor/git.go index 97f4209d..99687b7c 100644 --- a/cmd/bd/doctor/git.go +++ b/cmd/bd/doctor/git.go @@ -394,7 +394,7 @@ func CheckSyncBranchHealth(path string) DoctorCheck { Status: StatusWarning, Message: fmt.Sprintf("Local %s diverged from remote", syncBranch), Detail: "The remote sync branch was likely reset/force-pushed. Your local branch has orphaned history.", - Fix: fmt.Sprintf("Reset local branch: git branch -D %s (it will be recreated on next bd sync)", syncBranch), + Fix: "Run 'bd doctor --fix' to reset sync branch", } } @@ -479,7 +479,7 @@ func CheckSyncBranchHealth(path string) DoctorCheck { Status: StatusWarning, Message: fmt.Sprintf("Sync branch %s commits behind %s on source files", aheadCount, mainBranch), Detail: fmt.Sprintf("%d source files differ between %s and %s. The sync branch has stale code.", fileCount, syncBranch, mainBranch), - Fix: fmt.Sprintf("Reset sync branch: git branch -f %s %s && git push --force-with-lease origin %s", syncBranch, mainBranch, syncBranch), + Fix: "Run 'bd doctor --fix' to reset sync branch to main", } } } diff --git a/cmd/bd/doctor/installation.go b/cmd/bd/doctor/installation.go index 535babb0..c5b94eeb 100644 --- a/cmd/bd/doctor/installation.go +++ b/cmd/bd/doctor/installation.go @@ -97,7 +97,7 @@ func CheckPermissions(path string) DoctorCheck { Name: "Permissions", Status: StatusError, Message: ".beads/ directory is not writable", - Fix: fmt.Sprintf("Fix permissions: chmod u+w %s", beadsDir), + Fix: "Run 'bd doctor --fix' to fix permissions", } } _ = os.Remove(testFile) // Clean up test file (intentionally ignore error) @@ -112,7 +112,7 @@ func CheckPermissions(path string) DoctorCheck { Name: "Permissions", Status: StatusError, Message: "Database file exists but cannot be opened", - Fix: fmt.Sprintf("Check database permissions: %s", dbPath), + Fix: "Run 'bd doctor --fix' to fix permissions", } } _ = db.Close() // Intentionally ignore close error @@ -127,7 +127,7 @@ func CheckPermissions(path string) DoctorCheck { Name: "Permissions", Status: StatusError, Message: "Database file is not readable", - Fix: fmt.Sprintf("Fix permissions: chmod u+rw %s", dbPath), + Fix: "Run 'bd doctor --fix' to fix permissions", } } }