Skip to main content

Module init_picker

Module init_picker 

Source
Expand description

Interactive teamctl init picker — a two-pane ratatui screen launched by teamctl init (via teamctl-ui --init-picker). Branch-first: Browse a template vs Co-design with AI; choosing Browse opens a list ↔ live-detail view of the on-disk example teams, with a team-shape preview (the reporting tree + per-agent capability counts) drawn from team_core::preview.

Self-contained on purpose: it shares teamctl-ui’s theme + terminal lifecycle but NOT the dashboard app::run loop, which is wired to tmux panes / mailbox.db / a file-watcher. This is a small standalone app.

The binary entry (--init-picker in main.rs) renders to stderr and prints the chosen key to stdout, so teamctl init can capture the selection while the UI still shows on the operator’s terminal (the fzf pattern). run_standalone owns that stderr terminal lifecycle.

Structs§

Counts
Aggregate per-team capability counts, for the detail headline.
Entry
One browsable catalog entry — an example team, already parsed into its reporting shape so the detail pane is a pure render.
PickerState
The picker’s full state. Deterministic and terminal-free, so render_to_buffer can snapshot any screen without a real terminal.

Enums§

Outcome
What the picker resolves to. The binary entry maps this to stdout + an exit code that teamctl init consumes.

Functions§

render_to_buffer
Snapshot helper: render state into a fresh width × height buffer.
run_standalone
Binary entry: own the stderr terminal lifecycle (so stdout stays clean for the selection token), run the picker, and restore the terminal on every exit path including panics.