Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/cli/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ Inference authentication:
printer := ui.New(os.Stdout)
ctx := cmd.Context()

printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Installing fullsend for " + org)
printer.Blank()
Expand Down Expand Up @@ -603,7 +603,7 @@ func runPerRepoInstall(ctx context.Context, c perRepoInstallConfig) error {
client := gh.New(token)
printer := ui.New(os.Stdout)

printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Installing per-repo fullsend for " + repoFullName)
printer.Blank()
Expand Down Expand Up @@ -1048,7 +1048,7 @@ func newUninstallCmd() *cobra.Command {
printer := ui.New(os.Stdout)
ctx := cmd.Context()

printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Uninstalling fullsend from " + org)
printer.Blank()
Expand Down Expand Up @@ -1096,7 +1096,7 @@ func newAnalyzeCmd() *cobra.Command {
printer := ui.New(os.Stdout)
ctx := cmd.Context()

printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Analyzing fullsend installation for " + org)
printer.Blank()
Expand Down Expand Up @@ -2090,7 +2090,7 @@ func newDisableReposCmd() *cobra.Command {
// The yolo parameter is accepted for signature compatibility with reposRunFunc but is unused
// since enable has no destructive operations that require confirmation.
func runEnableRepos(ctx context.Context, client forge.Client, printer *ui.Printer, org string, repos []string, all bool, yolo bool) error {
printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Enabling repositories for " + org)
printer.Blank()
Expand Down Expand Up @@ -2203,7 +2203,7 @@ func runEnableRepos(ctx context.Context, client forge.Client, printer *ui.Printe

// runDisableRepos disables the specified repositories from fullsend enrollment.
func runDisableRepos(ctx context.Context, client forge.Client, printer *ui.Printer, org string, repos []string, all bool, yolo bool) error {
printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Disabling repositories for " + org)
printer.Blank()
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func newRunCmd() *cobra.Command {
}

func runAgent(agentName, fullsendDir, outputBase, targetRepo, fullsendBinary string, envFiles []string, noPostScript bool, debug string, printer *ui.Printer) (runErr error) {
printer.Banner()
printer.Banner(Version())
printer.Blank()
printer.Header("Running agent: " + agentName)
printer.Blank()
Expand Down
7 changes: 4 additions & 3 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ func New(w io.Writer) *Printer {
return &Printer{w: w}
}

// Banner prints the fullsend brand banner with tagline.
func (p *Printer) Banner() {
// Banner prints the fullsend brand banner with version and tagline.
func (p *Printer) Banner(version string) {
p.mu.Lock()
defer p.mu.Unlock()
brand := lipgloss.NewStyle().Bold(true).Foreground(ColorBrand).Render("fullsend")
fmt.Fprintf(p.w, "\u26a1 %s\n", brand)
ver := lipgloss.NewStyle().Foreground(ColorMuted).Render(version)
fmt.Fprintf(p.w, "\u26a1 %s %s\n", brand, ver)
tagline := lipgloss.NewStyle().Foreground(ColorMuted).Render("Autonomous agentic development for GitHub organizations")
fmt.Fprintf(p.w, " %s\n", tagline)
}
Expand Down
12 changes: 11 additions & 1 deletion internal/ui/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@ import (
func TestBanner(t *testing.T) {
var buf bytes.Buffer
p := New(&buf)
p.Banner()
p.Banner("v1.2.3")
out := buf.String()
assert.Contains(t, out, "fullsend")
assert.Contains(t, out, "v1.2.3")
}

func TestBannerDevVersion(t *testing.T) {
var buf bytes.Buffer
p := New(&buf)
p.Banner("dev")
out := buf.String()
assert.Contains(t, out, "fullsend")
assert.Contains(t, out, "dev")
}

func TestHeader(t *testing.T) {
Expand Down
Loading