From 9ed74ca233643a0f1d46f66efd2b51e75d76974f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perttu=20Landstr=C3=B6m?= Date: Wed, 21 Jan 2026 00:05:03 +0200 Subject: [PATCH] fix(types): show custom types when daemon is running (#1216) The `bd types` command only checked `if store != nil` to fetch custom types. In daemon mode, `store` is nil (daemonClient handles RPC instead), so custom types were never displayed even when configured. This caused a mismatch where `bd config get types.custom` showed the correct values but `bd types` showed none. Fix by calling ensureDirectMode() at the start of the command, matching the pattern used by `bd config get`. This falls back from daemon mode to direct storage access when needed. Co-authored-by: Perttulands Co-authored-by: Claude Opus 4.5 --- cmd/bd/types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/bd/types.go b/cmd/bd/types.go index 43f28be5..69bc98e6 100644 --- a/cmd/bd/types.go +++ b/cmd/bd/types.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "os" "strings" "github.com/spf13/cobra" @@ -53,6 +54,13 @@ Examples: bd types --json # Output as JSON `, Run: func(cmd *cobra.Command, args []string) { + // Ensure direct mode for database access (types command needs to read config). + // In daemon mode, store is nil so custom types would never be fetched. + if err := ensureDirectMode("types command requires direct database access"); err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + return + } + // Get custom types from config var customTypes []string ctx := context.Background()