Documentation
¶
Overview ¶
Package beads provides a minimal public API for extending bd with custom orchestration.
Most extensions should use direct SQL queries against bd's database. This package exports only the essential types and functions needed for Go-based extensions that want to use bd's storage layer programmatically.
For detailed guidance on extending bd, see EXTENDING.md.
Index ¶
- Constants
- Variables
- func ComputeRepoID() (string, error)
- func FindDatabasePath() string
- func FindJSONLPath(dbPath string) string
- func GetCloneID() (string, error)
- type BlockedIssue
- type Comment
- type DatabaseInfo
- type Dependency
- type DependencyType
- type EpicStatus
- type Event
- type EventType
- type Issue
- type IssueFilter
- type IssueType
- type Label
- type SortPolicy
- type Statistics
- type Status
- type Storage
- type TreeNode
- type WorkFilter
Constants ¶
const ( StatusOpen = types.StatusOpen StatusInProgress = types.StatusInProgress StatusClosed = types.StatusClosed StatusBlocked = types.StatusBlocked )
Status constants
const ( TypeBug = types.TypeBug TypeFeature = types.TypeFeature TypeTask = types.TypeTask TypeEpic = types.TypeEpic TypeChore = types.TypeChore )
IssueType constants
const ( DepBlocks = types.DepBlocks DepRelated = types.DepRelated DepParentChild = types.DepParentChild DepDiscoveredFrom = types.DepDiscoveredFrom )
DependencyType constants
const ( SortPolicyHybrid = types.SortPolicyHybrid SortPolicyPriority = types.SortPolicyPriority SortPolicyOldest = types.SortPolicyOldest )
SortPolicy constants
const ( EventCreated = types.EventCreated EventUpdated = types.EventUpdated EventStatusChanged = types.EventStatusChanged EventCommented = types.EventCommented EventClosed = types.EventClosed EventReopened = types.EventReopened EventDependencyAdded = types.EventDependencyAdded EventDependencyRemoved = types.EventDependencyRemoved EventLabelAdded = types.EventLabelAdded EventLabelRemoved = types.EventLabelRemoved EventCompacted = types.EventCompacted )
EventType constants
const CanonicalDatabaseName = "beads.db"
CanonicalDatabaseName is the required database filename for all beads repositories
Variables ¶
var LegacyDatabaseNames = []string{"bd.db", "issues.db", "bugs.db"}
LegacyDatabaseNames are old names that should be migrated
Functions ¶
func ComputeRepoID ¶ added in v0.17.7
ComputeRepoID generates a unique identifier for this git repository
func FindDatabasePath ¶
func FindDatabasePath() string
FindDatabasePath discovers the bd database path using bd's standard search order:
- $BEADS_DB environment variable
- .beads/*.db in current directory or ancestors
Returns empty string if no database is found.
func FindJSONLPath ¶
FindJSONLPath returns the expected JSONL file path for the given database path. It searches for existing *.jsonl files in the database directory and returns the first one found, or defaults to "issues.jsonl".
This function does not create directories or files - it only discovers paths. Use this when you need to know where bd stores its JSONL export.
func GetCloneID ¶ added in v0.17.7
GetCloneID generates a unique ID for this specific clone (not shared with other clones)
Types ¶
type BlockedIssue ¶ added in v0.12.0
type BlockedIssue = types.BlockedIssue
BlockedIssue represents an issue with blocking dependencies.
type DatabaseInfo ¶ added in v0.17.0
type DatabaseInfo struct {
Path string // Full path to the .db file
BeadsDir string // Parent .beads directory
IssueCount int // Number of issues (-1 if unknown)
}
DatabaseInfo contains information about a discovered beads database
func FindAllDatabases ¶ added in v0.17.0
func FindAllDatabases() []DatabaseInfo
FindAllDatabases scans the directory hierarchy for all .beads directories Returns a slice of DatabaseInfo for each database found, starting from the closest to CWD (most relevant) to the furthest (least relevant).
type Dependency ¶ added in v0.12.0
type Dependency = types.Dependency
Dependency represents a relationship between issues.
type DependencyType ¶ added in v0.12.0
type DependencyType = types.DependencyType
DependencyType represents the type of dependency (blocks, related, parent-child, discovered-from).
type EpicStatus ¶ added in v0.12.0
type EpicStatus = types.EpicStatus
EpicStatus represents the status of an epic issue.
type IssueFilter ¶ added in v0.12.0
type IssueFilter = types.IssueFilter
IssueFilter represents filtering criteria for issue queries.
type SortPolicy ¶ added in v0.17.7
type SortPolicy = types.SortPolicy
SortPolicy determines how ready work is ordered.
type Statistics ¶ added in v0.12.0
type Statistics = types.Statistics
Statistics represents project-wide metrics.
type Storage ¶
Storage provides the minimal interface for extension orchestration
func NewSQLiteStorage ¶
NewSQLiteStorage opens a bd SQLite database for programmatic access. Most extensions should use this to query ready work and update issue status.
type WorkFilter ¶
type WorkFilter = types.WorkFilter
WorkFilter represents filtering criteria for work queries.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
bd
command
Package main implements the bd CLI dependency management commands.
|
Package main implements the bd CLI dependency management commands. |
|
examples
|
|
|
go-agent
module
|
|
|
monitor-webui
module
|
|
|
internal
|
|
|
compact
Package compact provides AI-powered issue compaction using Claude Haiku.
|
Package compact provides AI-powered issue compaction using Claude Haiku. |
|
storage
Package storage defines the interface for issue storage backends.
|
Package storage defines the interface for issue storage backends. |
|
storage/memory
Package memory implements the storage interface using in-memory data structures.
|
Package memory implements the storage interface using in-memory data structures. |
|
storage/sqlite
Package sqlite implements dependency management for the SQLite storage backend.
|
Package sqlite implements dependency management for the SQLite storage backend. |
|
types
Package types defines core data structures for the bd issue tracker.
|
Package types defines core data structures for the bd issue tracker. |
