diff --git a/cmd/bd/graph.go b/cmd/bd/graph.go index ec7c8a1a..d4e585dd 100644 --- a/cmd/bd/graph.go +++ b/cmd/bd/graph.go @@ -11,6 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/steveyegge/beads/internal/rpc" "github.com/steveyegge/beads/internal/storage" + "github.com/steveyegge/beads/internal/storage/sqlite" "github.com/steveyegge/beads/internal/types" "github.com/steveyegge/beads/internal/ui" "github.com/steveyegge/beads/internal/utils" @@ -80,6 +81,17 @@ Colors indicate status: os.Exit(1) } + // If daemon is running but doesn't support this command, use direct storage + if daemonClient != nil && store == nil { + var err error + store, err = sqlite.New(ctx, dbPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error: failed to open database: %v\n", err) + os.Exit(1) + } + defer func() { _ = store.Close() }() + } + // Load the subgraph subgraph, err := loadGraphSubgraph(ctx, store, issueID) if err != nil {