From c47a1395eb16176a9dd3d83216ee04d70e004a0f Mon Sep 17 00:00:00 2001 From: Ryan Newton + Claude Date: Sun, 26 Oct 2025 14:11:32 +0000 Subject: [PATCH] Add no-db as a persistent configuration option This allows users to set --no-db mode persistently via: 1. .beads/config.yaml file (no-db: true) 2. BD_NO_DB environment variable 3. --no-db command-line flag (highest precedence) Changes: - Add no-db to config defaults in internal/config/config.go - Wire no-db flag to read from config in cmd/bd/main.go - Create example .beads/config.yaml with documentation The configuration precedence is: CLI flag > Environment variable > Config file > Default This makes no-db mode repository-scoped and automatically respected by all bd commands and the beads-mcp service. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .beads/config.yaml | 42 +++++++++++++++++++++++++++++++++++++++ cmd/bd/main.go | 3 +++ internal/config/config.go | 1 + 3 files changed, 46 insertions(+) create mode 100644 .beads/config.yaml diff --git a/.beads/config.yaml b/.beads/config.yaml new file mode 100644 index 00000000..90618901 --- /dev/null +++ b/.beads/config.yaml @@ -0,0 +1,42 @@ +# Beads Configuration File +# This file configures default behavior for all bd commands in this repository +# All settings can also be set via environment variables (BD_* prefix) +# or overridden with command-line flags + +# Use no-db mode: load from JSONL, no SQLite, write back after each command +# When true, bd will use .beads/issues.jsonl as the source of truth +# instead of SQLite database +no-db: false + +# Disable daemon for RPC communication (forces direct database access) +# no-daemon: false + +# Disable auto-flush of database to JSONL after mutations +# no-auto-flush: false + +# Disable auto-import from JSONL when it's newer than database +# no-auto-import: false + +# Enable JSON output by default +# json: false + +# Default actor for audit trails (overridden by BD_ACTOR or --actor) +# actor: "" + +# Path to database (overridden by BEADS_DB or --db) +# db: "" + +# Auto-start daemon if not running (can also use BEADS_AUTO_START_DAEMON) +# auto-start-daemon: true + +# Debounce interval for auto-flush (can also use BEADS_FLUSH_DEBOUNCE) +# flush-debounce: "5s" + +# Integration settings (access with 'bd config get/set') +# These are stored in the database, not in this file: +# - jira.url +# - jira.project +# - linear.url +# - linear.api-key +# - github.org +# - github.repo diff --git a/cmd/bd/main.go b/cmd/bd/main.go index adab0f46..cb01281a 100644 --- a/cmd/bd/main.go +++ b/cmd/bd/main.go @@ -105,6 +105,9 @@ var rootCmd = &cobra.Command{ if !cmd.Flags().Changed("no-auto-import") { noAutoImport = config.GetBool("no-auto-import") } + if !cmd.Flags().Changed("no-db") { + noDb = config.GetBool("no-db") + } if !cmd.Flags().Changed("db") && dbPath == "" { dbPath = config.GetString("db") } diff --git a/internal/config/config.go b/internal/config/config.go index da5e8918..ce8c4e6e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -71,6 +71,7 @@ func Initialize() error { v.SetDefault("no-daemon", false) v.SetDefault("no-auto-flush", false) v.SetDefault("no-auto-import", false) + v.SetDefault("no-db", false) v.SetDefault("db", "") v.SetDefault("actor", "")