Remove nodb_prefix.txt in favor of config.yaml

Remove support for the legacy .beads/nodb_prefix.txt file and use
the cleaner config.yaml approach exclusively for setting the issue
prefix. This simplifies the configuration system and makes it more
consistent.

Changes:
- Remove nodb_prefix.txt creation in cmd/bd/init.go
- Remove nodb_prefix.txt check in cmd/bd/nodb.go detectPrefix()
- Update error message to recommend config.yaml instead
- Update documentation to reflect config.yaml-only approach

New prefix detection order for --no-db mode:
1. issue-prefix in config.yaml (if set)
2. Common prefix from existing issues (if all share same prefix)
3. Current directory name (fallback)

Users should now set the prefix in .beads/config.yaml:
  issue-prefix: "myproject"

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
Ryan Newton + Claude
2025-10-26 14:46:28 +00:00
parent 7cf36cec23
commit 2ba7b5b3a3
2 changed files with 6 additions and 22 deletions

View File

@@ -20,7 +20,7 @@ var initCmd = &cobra.Command{
Long: `Initialize bd in the current directory by creating a .beads/ directory
and database file. Optionally specify a custom issue prefix.
With --no-db: creates .beads/ directory and nodb_prefix.txt file instead of SQLite database.`,
With --no-db: creates .beads/ directory and issues.jsonl file instead of SQLite database.`,
Run: func(cmd *cobra.Command, _ []string) {
prefix, _ := cmd.Flags().GetString("prefix")
quiet, _ := cmd.Flags().GetBool("quiet")
@@ -96,14 +96,8 @@ With --no-db: creates .beads/ directory and nodb_prefix.txt file instead of SQLi
os.Exit(1)
}
// Handle --no-db mode: create nodb_prefix.txt instead of database
// Handle --no-db mode: create issues.jsonl file instead of database
if noDb {
prefixFile := filepath.Join(localBeadsDir, "nodb_prefix.txt")
if err := os.WriteFile(prefixFile, []byte(prefix+"\n"), 0644); err != nil {
fmt.Fprintf(os.Stderr, "Error: failed to write prefix file: %v\n", err)
os.Exit(1)
}
// Create empty issues.jsonl file
jsonlPath := filepath.Join(localBeadsDir, "issues.jsonl")
if _, err := os.Stat(jsonlPath); os.IsNotExist(err) {