{"record":{"id":"1c04ad9ec0e029ab","repo":"gastownhall/beads","slug":"no-beads-config-yaml-found-in-current-directory-o","errorCode":null,"errorMessage":"no .beads/config.yaml found in current directory or parents","messagePattern":"no \\.beads/config\\.yaml found in current directory or parents","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/repos.go","lineNumber":28,"sourceCode":"\n// ReposConfig represents the repos section of config.yaml\ntype ReposConfig struct {\n\tPrimary    string   `yaml:\"primary,omitempty\"`\n\tAdditional []string `yaml:\"additional,omitempty,flow\"`\n}\n\n// configFile represents the structure for reading/writing config.yaml\n// We use yaml.Node to preserve comments and formatting\ntype configFile struct {\n\troot yaml.Node\n}\n\n// FindConfigYAMLPath finds the config.yaml file in .beads directory\n// Walks up from CWD to find .beads/config.yaml\nfunc FindConfigYAMLPath() (string, error) {\n\tconfigPath, err := findProjectConfigYaml()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"no .beads/config.yaml found in current directory or parents\")\n\t}\n\treturn configPath, nil\n}\n\n// GetReposFromYAML reads the repos configuration from config.yaml\n// Returns an empty ReposConfig if repos section doesn't exist\nfunc GetReposFromYAML(configPath string) (*ReposConfig, error) {\n\tdata, err := os.ReadFile(configPath) // #nosec G304 - config file path from caller\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn &ReposConfig{}, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to read config.yaml: %w\", err)\n\t}\n\n\t// Parse into a generic map to extract repos section\n\tvar cfg map[string]interface{}\n\tif err := yaml.Unmarshal(data, &cfg); err != nil {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/config/repos.go#L10-L46","documentation":"FindConfigYAMLPath walks up from the current working directory looking for .beads/config.yaml and returns this error when no such file exists anywhere in the ancestor chain. It means the command was run outside any initialized beads project.","triggerScenarios":"Calling FindConfigYAMLPath() (used by AddRepo/RemoveRepo/ListRepos flows) while the CWD — or any parent — lacks a .beads/config.yaml; running from a freshly cloned repo before `bd init`; running from a subdirectory outside the project tree (e.g. $HOME).","commonSituations":"Forgetting to run `bd init` in a new repository; running the CLI from the wrong terminal tab/directory; the .beads directory was deleted or gitignored out of existence; working in a worktree whose fallback to the main repo config is broken.","solutions":["Run `bd init` in the project root to create .beads/config.yaml.","cd into the project directory (or a subdirectory of it) before running the command.","Verify .beads/config.yaml exists and wasn't deleted or excluded by your ignore/clean rules."],"exampleFix":"// before: command run in ~/random-dir\n// after\n$ cd /path/to/my-project\n$ bd init\n$ bd repo add ../other-repo","handlingStrategy":"try-catch","validationCode":"if _, err := os.Stat(filepath.Join(\".beads\", \"config.yaml\")); os.IsNotExist(err) {\n    return fmt.Errorf(\"not in a beads project; run `bd init` first\")\n}","typeGuard":null,"tryCatchPattern":"path, err := config.FindConfigYAMLPath()\nif err != nil {\n    return fmt.Errorf(\"no beads project here: %w (run `bd init`)\", err)\n}","preventionTips":["Run `bd init` before any repo/config subcommands.","Check your CWD (pwd) when commands claim no project exists.","Don't gitignore or clean .beads/config.yaml in projects that use beads."],"tags":["config","yaml","project-setup","cwd"],"backgroundTag":"config-file-not-found","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}