{"record":{"id":"b35291275ea57ce7","repo":"gastownhall/beads","slug":"no-beads-directory-found-at-s-run-bd-init-to","errorCode":null,"errorMessage":"no .beads/ directory found at %s; run 'bd init' to initialize beads","messagePattern":"no \\.beads/ directory found at (.+?); run 'bd init' to initialize beads","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/doctor/perf.go","lineNumber":15,"sourceCode":"package doctor\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"runtime/pprof\"\n)\n\n// RunPerformanceDiagnostics runs performance diagnostics.\n// Delegates to Dolt backend diagnostics.\nfunc RunPerformanceDiagnostics(path string) error {\n\tbeadsDir := ResolveBeadsDirForRepo(path)\n\tif _, err := os.Stat(beadsDir); os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"no .beads/ directory found at %s; run 'bd init' to initialize beads\", path)\n\t}\n\n\tmetrics, err := RunDoltPerformanceDiagnostics(path, true)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"running performance diagnostics: %w\", err)\n\t}\n\tPrintDoltPerfReport(metrics)\n\treturn nil\n}\n\n// CollectPlatformInfo gathers platform information for diagnostics.\nfunc CollectPlatformInfo(path string) map[string]string {\n\tinfo := make(map[string]string)\n\tinfo[\"os_arch\"] = fmt.Sprintf(\"%s/%s\", runtime.GOOS, runtime.GOARCH)\n\tinfo[\"go_version\"] = runtime.Version()\n\n\tbeadsDir := ResolveBeadsDirForRepo(path)\n\tif IsDoltBackend(beadsDir) {","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/doctor/perf.go#L1-L33","documentation":"RunPerformanceDiagnostics refuses to run when the given repository path has no .beads/ directory. Before delegating to Dolt backend diagnostics it resolves the beads directory and stats it; if it does not exist, bd has not been initialized in that repo and there is nothing to diagnose.","triggerScenarios":"Calling RunPerformanceDiagnostics(path) (via 'bd doctor' performance checks) on a directory where ResolveBeadsDirForRepo(path) points at a .beads/ dir that does not exist — i.e. 'bd init' was never run there, or the path points at the wrong repo root.","commonSituations":"Running bd doctor from a parent or sibling directory instead of the repo root; a freshly cloned repo where .beads/ was gitignored and never created; a typo'd --path; running in CI before an init step.","solutions":["cd into the repository root (or pass the correct path) so the .beads/ directory is found","Run 'bd init' in the target repository to create .beads/","Verify the path exists and contains .beads/: ls <path>/.beads"],"exampleFix":"// before\nRunPerformanceDiagnostics(\"~/some-repo\")\n// after\nif _, err := os.Stat(filepath.Join(repo, \".beads\")); err == nil {\n    RunPerformanceDiagnostics(repo)\n} else {\n    exec.Command(\"bd\", \"init\").Run()\n}","handlingStrategy":"validation","validationCode":"func hasBeadsDir(repo string) bool {\n    _, err := os.Stat(filepath.Join(repo, \".beads\"))\n    return err == nil\n}\nif !hasBeadsDir(repo) { exec.Command(\"bd\", \"init\").Run() }","typeGuard":null,"tryCatchPattern":"if err := RunPerformanceDiagnostics(repo); err != nil && strings.Contains(err.Error(), \"no .beads/ directory\") {\n    // run bd init or abort\n}","preventionTips":["Always resolve the repo root before invoking bd doctor commands","Run 'bd init' as part of repo bootstrap/CI setup","Never gitignore .beads/ if tooling expects it present after clone"],"tags":["beads","initialization","doctor"],"backgroundTag":"missing-beads-init","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}