Documentation
¶
Overview ¶
Package cli implements the command-line interface for programmator.
Index ¶
- func Execute() error
- func Run(ctx context.Context, sourceID, workingDir string, cfg RunConfig) (*loop.Result, error)
- func SetVersionInfo(v, c, d string)
- type Collector
- type RunConfig
- type TerminalCollector
- type Writer
- func (w *Writer) ClearFooter()
- func (w *Writer) SetClaudeConfigDir(dir string)
- func (w *Writer) SetExecutorName(name string)
- func (w *Writer) SetProcessStats(pid int, memKB int64)
- func (w *Writer) UpdateFooter(state *safety.State, item *domain.WorkItem, cfg safety.Config)
- func (w *Writer) WriteEvent(ev event.Event)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run creates a loop, wires callbacks to a Writer, and runs synchronously. It handles signal-based shutdown and guarantees footer cleanup on exit.
func SetVersionInfo ¶
func SetVersionInfo(v, c, d string)
SetVersionInfo sets the version information for the CLI.
Types ¶
type Collector ¶
type Collector interface {
// AskQuestion presents a question with options and returns the selected answer.
AskQuestion(ctx context.Context, question string, options []string) (string, error)
}
Collector provides interactive input collection for plan creation.
type RunConfig ¶
type RunConfig struct {
SafetyConfig safety.Config
ReviewConfig review.Config
PromptBuilder *prompt.Builder
TicketCommand string
GitWorkflowConfig loop.GitWorkflowConfig
ExecutorConfig executor.Config
Out io.Writer // output writer (default: os.Stdout)
IsTTY bool
TermWidth int
TermHeight int
}
RunConfig holds all configuration needed to run the loop.
type TerminalCollector ¶
type TerminalCollector struct {
// contains filtered or unexported fields
}
TerminalCollector implements Collector using fzf (if available) or numbered selection fallback.
func NewTerminalCollector ¶
func NewTerminalCollector() *TerminalCollector
NewTerminalCollector creates a new TerminalCollector with default stdin/stdout.
func NewTerminalCollectorWithIO ¶
func NewTerminalCollectorWithIO(stdin io.Reader, stdout io.Writer) *TerminalCollector
NewTerminalCollectorWithIO creates a TerminalCollector with custom I/O (for testing).
func (*TerminalCollector) AskQuestion ¶
func (c *TerminalCollector) AskQuestion(ctx context.Context, question string, options []string) (string, error)
AskQuestion presents options using fzf if available, otherwise falls back to numbered selection.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer prints events to stdout and redraws a sticky footer in TTY mode. In non-TTY mode, it prints plain text without ANSI escapes or footer.
In TTY mode, Writer uses inline Bubble Tea mode (no alt screen): - content is printed above the program via tea.Printf/tea.Println - View() renders sticky footer at the bottom - terminal scrollback remains standard.
func (*Writer) SetClaudeConfigDir ¶ added in v1.1.0
SetClaudeConfigDir sets a non-default Claude config directory to display in the footer.
func (*Writer) SetExecutorName ¶ added in v1.1.0
SetExecutorName sets the executor label used in footer status (e.g. claude, pi).
func (*Writer) SetProcessStats ¶
SetProcessStats updates the PID field used by the footer.
func (*Writer) UpdateFooter ¶
UpdateFooter redraws the sticky footer with current state.
func (*Writer) WriteEvent ¶
WriteEvent prints a single event to the output stream.