{"record":{"id":"ca732fd25a5b443e","repo":"gastownhall/beads","slug":"no-beads-config-yaml-found-run-bd-init-first","errorCode":null,"errorMessage":"no .beads/config.yaml found (run 'bd init' first)","messagePattern":"no \\.beads/config\\.yaml found \\(run 'bd init' first\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/yaml_config.go","lineNumber":602,"sourceCode":"\t\t\treturn configPath, nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"no config.yaml found in BEADS_DIR (%s) (run 'bd init' first)\", beadsDir)\n\t}\n\n\tif configPath := projectConfigPathFromLoadedState(); configPath != \"\" {\n\t\treturn configPath, nil\n\t}\n\n\tif findBeadsDir != nil {\n\t\tif beadsDir := findBeadsDir(); beadsDir != \"\" {\n\t\t\tconfigPath := filepath.Join(beadsDir, \"config.yaml\")\n\t\t\tif _, err := os.Stat(configPath); err == nil {\n\t\t\t\treturn configPath, nil\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\", fmt.Errorf(\"no .beads/config.yaml found (run 'bd init' first)\")\n}\n\nfunc projectConfigPathFromLoadedState() string {\n\tconfigPath := ConfigFileUsed()\n\tif configPath == \"\" {\n\t\treturn \"\"\n\t}\n\tif filepath.Base(configPath) != \"config.yaml\" {\n\t\treturn \"\"\n\t}\n\tif filepath.Base(filepath.Dir(configPath)) != \".beads\" {\n\t\treturn \"\"\n\t}\n\tif _, err := os.Stat(configPath); err != nil {\n\t\treturn \"\"\n\t}\n\treturn configPath\n}","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/config/yaml_config.go#L584-L620","documentation":"findProjectConfigYamlWithFinder returns this error when no BEADS_DIR override applies and no .beads/config.yaml can be located in the project (via finder or loaded state). It is the terminal 'project not initialized' condition for YAML config writes.","triggerScenarios":"Calling SetYamlConfig / UnsetYamlConfig (via findProjectConfigYaml) from a directory chain with no .beads/config.yaml, with BEADS_DIR unset, and no config path recorded in loaded state.","commonSituations":"Running 'bd config set' outside any initialized beads project; running from a subdirectory whose repo lacks .beads/; after deleting .beads/config.yaml; forgetting 'bd init' in a fresh clone.","solutions":["Run 'bd init' in the project root to create .beads/config.yaml","cd into the repository/project that contains .beads/config.yaml before running config commands","If the config lives elsewhere, set BEADS_DIR to the directory containing config.yaml","Restore a deleted .beads/config.yaml (e.g., from git history if it was tracked)"],"exampleFix":"// before (fails in bare repo)\n$ cd ~/newproject && bd config set hierarchy.max-depth 5\nno .beads/config.yaml found (run 'bd init' first)\n// after\n$ cd ~/newproject && bd init && bd config set hierarchy.max-depth 5","handlingStrategy":"validation","validationCode":"if os.Getenv(\"BEADS_DIR\") == \"\" {\n    if _, err := os.Stat(\".beads/config.yaml\"); os.IsNotExist(err) {\n        return fmt.Errorf(\"not an initialized beads project: run 'bd init'\")\n    }\n}","typeGuard":"func inBeadsProject() bool {\n    _, err := os.Stat(\".beads/config.yaml\")\n    return err == nil\n}","tryCatchPattern":"if err := SetYamlConfig(key, value); err != nil {\n    if strings.Contains(err.Error(), \"no .beads/config.yaml found\") {\n        // cd to project root or run bd init, then retry\n    }\n    return err\n}","preventionTips":["Run bd config commands from the project root (or any directory with .beads/config.yaml up the tree)","Run 'bd init' in every fresh clone before configuring","Don't delete or gitignore .beads/config.yaml if project-local config is required"],"tags":["config","setup","project-init","go"],"backgroundTag":"config-not-initialized","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}