package cli import ( "context" "fmt" "github.com/urfave/cli/v3" ) // uiCommand launches the Bubbletea TUI. Implemented in internal/ui; wired // up once that package exists (see runUI, set from cmd/vault-tui/main.go's // init-time hook to avoid internal/cli importing the TUI toolkit itself and // thus keeping headless commands buildable/testable without it). var runUI func(ctx context.Context, a *App) error func uiCommand() *cli.Command { return &cli.Command{ Name: "ui", Usage: "launch the terminal UI (default when no subcommand is given)", Action: func(ctx context.Context, cmd *cli.Command) error { a, err := appFrom(ctx) if err != nil { return err } if runUI == nil { return fmt.Errorf("the TUI is not available in this build") } return runUI(ctx, a) }, } } // SetUIRunner lets cmd/vault-tui wire the real internal/ui implementation // into the "ui" command without internal/cli importing a TUI toolkit. func SetUIRunner(f func(ctx context.Context, a *App) error) { runUI = f }