Rebuild the developer CLI and interactive TUI from the ground up using Bubble Tea v2, Lip Gloss v2, and non-blocking background workers. Adds support for background docker pulls with live per-layer byte progress, build log streaming, interactive container shells, dynamic sidebar tabs (logs / build / ci), and gh cli integration to view or watch CI checks.
26 lines
776 B
Go
26 lines
776 B
Go
package tui
|
|
|
|
import tea "charm.land/bubbletea/v2"
|
|
|
|
// Run starts the interactive application. showInstances opens directly on the
|
|
// instances screen instead of the development browser.
|
|
func Run(showInstances bool) error {
|
|
model := New(showInstances)
|
|
program := tea.NewProgram(model)
|
|
final, err := program.Run()
|
|
// Background work outlives the render loop unless it is stopped here, and a
|
|
// stray `docker logs --follow` would keep the terminal's child process alive
|
|
// after the CLI has exited.
|
|
if quit, ok := final.(Model); ok {
|
|
quit.tasks.CancelAll()
|
|
quit.logs.Close()
|
|
}
|
|
return err
|
|
}
|
|
|
|
// RunDev opens the development browser.
|
|
func RunDev() error { return Run(false) }
|
|
|
|
// RunDashboard opens the instances screen.
|
|
func RunDashboard() error { return Run(true) }
|