Help us shape the future of Go! Take the 2026 Go Developer Survey

picker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package picker runs the interactive picker workflow: structure-first skeleton launch, a background streaming scan, git-relevance rank patching, and selection-to-output conversion. It owns the scan lifecycle and selection callbacks so the CLI command only assembles options. The Bubble Tea model stays in internal/tui; this package bridges it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	App         *app.App
	RecordDump  func(rootDir string, files []format.FileEntry, ref string) error
	RecordDelta func(rootDir, ref string, files, tokens int) error
	CountTokens func(content []byte) int
}

Env supplies the picker with services beyond config: the application handle for scanning, rendering, and output, plus callbacks for recording dump and delta state and counting raw payloads, which live in the command layer.

type Result

type Result struct {
	// Selections is the user's file selection and modes, empty when the
	// session ended via a delta dump, the user selected nothing, or no
	// eligible files existed.
	Selections []tui.Selection
	// DeltaDone reports that the session ended by performing a delta dump,
	// whose output replaces any picker selection.
	DeltaDone bool
	// NoEligible reports that no files survived the ignore, binary, size, and
	// smart filters, so the picker never opened. The command surfaces this
	// distinctly from a plain non-selection.
	NoEligible bool
}

Result carries the picker workflow's outcome to the command layer.

func Run

func Run(ctx context.Context, cfg *config.Config, env Env) (Result, error)

Run executes the picker workflow and returns its outcome. When the user makes no selection the result carries empty Selections and DeltaDone false; callers distinguish "nothing eligible" via NoEligible.

Jump to

Keyboard shortcuts

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