cmd

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Overview

Package cmd implements the bc CLI commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteAgentNames

func CompleteAgentNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteAgentNames returns a completion function for agent names

func CompleteChannelNames

func CompleteChannelNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteChannelNames returns a completion function for channel names

func CompleteRoleNames

func CompleteRoleNames(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteRoleNames returns a completion function for role names. Uses the daemon API to get role names (roles are managed by bcd, not local files).

func Execute

func Execute() error

Execute runs the root command.

func InitWithPreset

func InitWithPreset(dir string, preset WizardPreset) error

InitWithPreset initializes a workspace with a specific preset (non-interactive).

func Root

func Root() *cobra.Command

Root returns the root command for testing and extension.

func RunServer

func RunServer(addr, wsRoot, corsOrigin, apiKey string) error

RunServer starts the bc server (formerly bcd) in the foreground. It loads the workspace, wires up all services, and blocks until the context is canceled or a signal is received.

func RunWizard

func RunWizard(dir string) error

RunWizard runs the interactive workspace initialization wizard.

func SetVersionInfo

func SetVersionInfo(v, c, d string)

SetVersionInfo sets the version information from build flags.

Types

type AgentHealth

type AgentHealth struct {
	Name          string `json:"name"`
	Role          string `json:"role"`
	Status        string `json:"status"`
	LastUpdated   string `json:"last_updated"`
	StaleDuration string `json:"stale_duration,omitempty"`
	ErrorMessage  string `json:"error_message,omitempty"`
	StuckReason   string `json:"stuck_reason,omitempty"`
	StuckDetails  string `json:"stuck_details,omitempty"`
	TmuxAlive     bool   `json:"tmux_alive"`
	StateFresh    bool   `json:"state_fresh"`
	IsStuck       bool   `json:"is_stuck,omitempty"`
}

AgentHealth represents the health status of an agent.

type ChannelInfo

type ChannelInfo struct {
	Name         string   `json:"name"`
	Description  string   `json:"description,omitempty"`
	Members      []string `json:"members"`
	MemberCount  int      `json:"member_count"`
	HistoryCount int      `json:"history_count"`
}

ChannelInfo represents detailed channel information for JSON output.

type WizardPreset

type WizardPreset string

WizardPreset represents a preconfigured workspace setup.

const (
	PresetSolo      WizardPreset = "solo"
	PresetSmallTeam WizardPreset = "small-team"
	PresetFullTeam  WizardPreset = "full-team"
	PresetCustom    WizardPreset = "custom"
)

type WizardState

type WizardState struct {
	Dir       string
	Nickname  string
	Tool      string
	Preset    WizardPreset
	Channels  []string
	Step      int
	TotalStep int
}

WizardState tracks the wizard's progress and collected data.

func NewWizardState

func NewWizardState(dir string) *WizardState

NewWizardState creates a new wizard state for the given directory.

type WorkspaceContext

type WorkspaceContext struct {
	Workspace *workspace.Workspace
	Manager   *agent.Manager
}

WorkspaceContext holds workspace and agent manager for command handlers. Use withWorkspace() or withAgentManager() to create instances.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL