Function bodies 209 total
status.NewLoader function · go · L73-L79 (7 LOC)src/internal/domain/status/loader.go
func NewLoader() *Loader {
loader := &Loader{
updates: make(chan UpdateMsg, 100),
}
loader.buildItems()
return loader
}status.Loader.GetItems method · go · L82-L88 (7 LOC)src/internal/domain/status/loader.go
func (l *Loader) GetItems() []Item {
l.mu.Lock()
defer l.mu.Unlock()
items := make([]Item, len(l.items))
copy(items, l.items)
return items
}status.Loader.GetPendingCount method · go · L91-L99 (9 LOC)src/internal/domain/status/loader.go
func (l *Loader) GetPendingCount() int {
count := 0
for _, item := range l.items {
if !item.Loaded && item.Kind != KindHeader {
count++
}
}
return count
}status.Loader.buildItems method · go · L102-L217 (116 LOC)src/internal/domain/status/loader.go
func (l *Loader) buildItems() {
// System Info header
l.addItem(Item{
ID: "sysinfo",
Kind: KindSystemInfo,
Section: "System",
Name: "System Info",
})
// Setup section (standalone)
l.addItem(Item{ID: "header-setup", Kind: KindHeader, Section: "Setup", SubSection: "Setup", Loaded: true})
for _, script := range config.Scripts {
if script.CheckFn == nil {
continue
}
l.addItem(Item{
ID: "setup-" + script.Name,
Kind: KindSetup,
Section: "Setup",
SubSection: "Setup",
Name: script.Name,
Description: script.Description,
})
}
l.addItem(Item{
ID: "setup-remote",
Kind: KindSetup,
Section: "Setup",
SubSection: "Setup",
Name: "remote",
Description: "Configure remote SSH access",
})
// Security section
l.addItem(Item{ID: "header-security", Kind: KindHeader, Section: "System", SubSection: "Security", Loaded: true})
for _, check := range config.SecurityChecks {
l.addItem(Istatus.Loader.WaitForUpdate method · go · L430-L438 (9 LOC)src/internal/domain/status/loader.go
func (l *Loader) WaitForUpdate() tea.Cmd {
return func() tea.Msg {
update, ok := <-l.updates
if !ok {
return AllLoadedMsg{}
}
return update
}
}status.Loader.loadSystemInfo method · go · L441-L462 (22 LOC)src/internal/domain/status/loader.go
func (l *Loader) loadSystemInfo() Item {
hostname, _ := os.Hostname()
// Shorten hostname (remove .local suffix and truncate if too long)
if idx := strings.Index(hostname, "."); idx > 0 {
hostname = hostname[:idx]
}
if len(hostname) > 20 {
hostname = hostname[:20]
}
osInfo := tool.GetCommandOutput("uname", "-sr")
arch := tool.GetCommandOutput("uname", "-m")
user := os.Getenv("USER")
shell := filepath.Base(os.Getenv("SHELL"))
return Item{
ID: "sysinfo",
Kind: KindSystemInfo,
Loaded: true,
Detail: osInfo + " " + arch + " • " + hostname + " • " + user + " • " + shell,
}
}tool.parseFirstLineField function · go · L27-L41 (15 LOC)src/internal/domain/tool/parser.go
func parseFirstLineField(s string, fieldIndex int, stripV bool) string {
s = StripAnsi(s)
lines := strings.Split(s, "\n")
if len(lines) > 0 {
parts := strings.Fields(lines[0])
if len(parts) > fieldIndex {
v := parts[fieldIndex]
if stripV {
v = strings.TrimPrefix(v, "v")
}
return v
}
}
return ""
}Repobility · MCP-ready · https://repobility.com
tool.ParseGitVersion function · go · L54-L61 (8 LOC)src/internal/domain/tool/parser.go
func ParseGitVersion(s string) string {
s = StripAnsi(s)
v := strings.TrimPrefix(strings.TrimSpace(s), "git version ")
if idx := strings.Index(v, " ("); idx != -1 {
v = v[:idx]
}
return v
}tool.ParseGoVersion function · go · L74-L81 (8 LOC)src/internal/domain/tool/parser.go
func ParseGoVersion(s string) string {
s = StripAnsi(s)
parts := strings.Fields(s)
if len(parts) >= 3 {
return strings.TrimPrefix(parts[2], "go")
}
return ""
}tool.ParseJavaVersion function · go · L84-L96 (13 LOC)src/internal/domain/tool/parser.go
func ParseJavaVersion(s string) string {
s = StripAnsi(s)
for _, line := range strings.Split(s, "\n") {
if strings.Contains(line, "version") {
start := strings.Index(line, "\"")
end := strings.LastIndex(line, "\"")
if start != -1 && end != -1 && end > start {
return line[start+1 : end]
}
}
}
return ""
}tool.ParseAnsibleVersion function · go · L115-L133 (19 LOC)src/internal/domain/tool/parser.go
func ParseAnsibleVersion(s string) string {
s = StripAnsi(s)
lines := strings.Split(s, "\n")
if len(lines) > 0 {
line := lines[0]
if strings.Contains(line, "[core") {
start := strings.Index(line, "[core ")
end := strings.Index(line, "]")
if start != -1 && end != -1 {
return line[start+6 : end]
}
}
parts := strings.Fields(line)
if len(parts) >= 2 {
return parts[1]
}
}
return ""
}tool.ParseCodexVersion function · go · L141-L148 (8 LOC)src/internal/domain/tool/parser.go
func ParseCodexVersion(s string) string {
v := parseFirstLineField(s, 1, false)
if v == "" {
// Fallback: return first field if only one field present
return parseFirstLineField(s, 0, false)
}
return v
}tool.ParseMoleVersion function · go · L151-L162 (12 LOC)src/internal/domain/tool/parser.go
func ParseMoleVersion(s string) string {
s = StripAnsi(s)
for _, line := range strings.Split(s, "\n") {
if strings.HasPrefix(line, "Mole version") {
parts := strings.Fields(line)
if len(parts) >= 3 {
return parts[2]
}
}
}
return ""
}tool.ParseEasVersion function · go · L182-L193 (12 LOC)src/internal/domain/tool/parser.go
func ParseEasVersion(s string) string {
s = StripAnsi(s)
for _, line := range strings.Split(s, "\n") {
if strings.HasPrefix(line, "eas-cli/") {
parts := strings.Fields(line)
if len(parts) >= 1 {
return strings.TrimPrefix(parts[0], "eas-cli/")
}
}
}
return ""
}tool.FormatBytes function · go · L201-L212 (12 LOC)src/internal/domain/tool/parser.go
func FormatBytes(bytes int64) string {
const unit = 1024
if bytes < unit {
return fmt.Sprintf("%d B", bytes)
}
div, exp := int64(unit), 0
for n := bytes / unit; n >= unit; n /= unit {
div *= unit
exp++
}
return fmt.Sprintf("%.1f %cB", float64(bytes)/float64(div), "KMGTPE"[exp])
}Powered by Repobility — scan your code at https://repobility.com
tool.FilterStrings function · go · L219-L232 (14 LOC)src/internal/domain/tool/parser.go
func FilterStrings(slice, exclude []string) []string {
excludeSet := make(map[string]bool)
for _, s := range exclude {
excludeSet[s] = true
}
var result []string
for _, s := range slice {
if !excludeSet[s] {
result = append(result, s)
}
}
return result
}tool.VersionFromCmd function · go · L16-L24 (9 LOC)src/internal/domain/tool/tool.go
func VersionFromCmd(cmd string, args []string, parser func(string) string) func() string {
return func() string {
out, err := exec.Command(cmd, args...).CombinedOutput()
if err != nil {
return ""
}
return parser(string(out))
}
}tool.VersionFromBrewFormula function · go · L27-L40 (14 LOC)src/internal/domain/tool/tool.go
func VersionFromBrewFormula(formula string) func() string {
return func() string {
out, err := exec.Command("brew", "list", "--versions", formula).Output()
if err != nil {
return ""
}
// Output: "formula 1.2.3" or "formula 1.2.3 1.2.2"
parts := strings.Fields(string(out))
if len(parts) >= 2 {
return parts[1]
}
return ""
}
}tool.VersionFromBrewCask function · go · L43-L56 (14 LOC)src/internal/domain/tool/tool.go
func VersionFromBrewCask(cask string) func() string {
return func() string {
out, err := exec.Command("brew", "list", "--cask", "--versions", cask).Output()
if err != nil {
return ""
}
// Output: "cask 1.2.3"
parts := strings.Fields(string(out))
if len(parts) >= 2 {
return parts[1]
}
return ""
}
}tool.VersionFromAppPlist function · go · L59-L68 (10 LOC)src/internal/domain/tool/tool.go
func VersionFromAppPlist(appName string) func() string {
return func() string {
plistPath := fmt.Sprintf("/Applications/%s.app/Contents/Info.plist", appName)
out, err := exec.Command("defaults", "read", plistPath, "CFBundleShortVersionString").Output()
if err != nil {
return ""
}
return strings.TrimSpace(string(out))
}
}tool.GetCommandOutput function · go · L77-L83 (7 LOC)src/internal/domain/tool/tool.go
func GetCommandOutput(name string, args ...string) string {
out, err := exec.Command(name, args...).Output()
if err != nil {
return ""
}
return strings.TrimSpace(string(out))
}tool.GetCommandOutputWithTimeout function · go · L86-L99 (14 LOC)src/internal/domain/tool/tool.go
func GetCommandOutputWithTimeout(timeout time.Duration, name string, args ...string) (string, error) {
ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel()
cmd := exec.CommandContext(ctx, name, args...)
out, err := cmd.Output()
if err != nil {
if ctx.Err() == context.DeadlineExceeded {
return "", fmt.Errorf("command timed out after %v", timeout)
}
return "", err
}
return strings.TrimSpace(string(out)), nil
}components.Badge function · go · L18-L23 (6 LOC)src/internal/presentation/components/badge.go
func Badge(ok bool) string {
if ok {
return BadgeOK()
}
return BadgeError()
}Citation: Repobility (2026). State of AI-Generated Code. https://repobility.com/research/
components.ServiceBadge function · go · L31-L36 (6 LOC)src/internal/presentation/components/badge.go
func ServiceBadge(running bool) string {
if running {
return theme.ServiceRunning.Render(theme.IconServiceOn) + " " + theme.Success.Render("running")
}
return theme.ServiceStopped.Render(theme.IconServiceOff) + " " + theme.Warning.Render("stopped")
}components.SectionHeader function · go · L25-L44 (20 LOC)src/internal/presentation/components/box.go
func SectionHeader(title string, width int) string {
innerWidth := width - 2 // for the borders
if innerWidth < 10 {
innerWidth = 10
}
displayTitle := strings.ToUpper(title)
padding := innerWidth - len(displayTitle) - 2 // -2 for " " prefix
if padding < 0 {
padding = 0
}
borderStyle := theme.SectionBorder
top := borderStyle.Render(theme.BoxThickTopLeft + strings.Repeat(theme.BoxThickHorizontal, innerWidth) + theme.BoxThickTopRight)
middle := borderStyle.Render(theme.BoxThickVertical) + " " + theme.SectionTitle.Render(displayTitle) + strings.Repeat(" ", padding) + borderStyle.Render(theme.BoxThickVertical)
bottom := borderStyle.Render(theme.BoxThickBottomLeft + strings.Repeat(theme.BoxThickHorizontal, innerWidth) + theme.BoxThickBottomRight)
return top + "\n" + middle + "\n" + bottom
}components.SubsectionBox function · go · L55-L90 (36 LOC)src/internal/presentation/components/box.go
func SubsectionBox(title string, lines []string, width int) string {
innerWidth := width - 4 // account for border + padding
if innerWidth < 20 {
innerWidth = 20
}
borderStyle := theme.SectionBorder
// Build top border with title: ╭─ Title ─────────────────╮
// Total width = innerWidth + 2 (for borders ╭ and ╮)
// Left part: ╭─ (2 chars)
// Title part: title
// Right part: ─...─╮ (remaining chars)
totalBorderChars := innerWidth + 2 // total horizontal space including corners
leftPart := 2 // "─ " after ╭
rightPart := 2 // " ─" before ╮
titleSpace := len(title) // title text
remainingDashes := totalBorderChars - leftPart - titleSpace - rightPart + 1
if remainingDashes < 1 {
remainingDashes = 1
}
top := borderStyle.Render(theme.BoxRoundedTopLeft+theme.BoxRoundedHorizontal+" ") +
theme.SubSection.Render(title) +
borderStyle.Render(" "+strings.Repeat(theme.BoxRoundedHorizontal, remainingDashes)+theme.BoxRoundedTcomponents.SimpleBox function · go · L97-L115 (19 LOC)src/internal/presentation/components/box.go
func SimpleBox(content string, width int) string {
lines := strings.Split(content, "\n")
innerWidth := width - 4
if innerWidth < 10 {
innerWidth = 10
}
borderStyle := theme.SectionBorder
top := borderStyle.Render(theme.BoxRoundedTopLeft + strings.Repeat(theme.BoxRoundedHorizontal, innerWidth+2) + theme.BoxRoundedTopRight)
bottom := borderStyle.Render(theme.BoxRoundedBottomLeft + strings.Repeat(theme.BoxRoundedHorizontal, innerWidth+2) + theme.BoxRoundedBottomRight)
var paddedLines []string
for _, line := range lines {
paddedLines = append(paddedLines, padBoxLine(line, innerWidth))
}
return top + "\n" + strings.Join(paddedLines, "\n") + "\n" + bottom
}components.padBoxLine function · go · L122-L129 (8 LOC)src/internal/presentation/components/box.go
func padBoxLine(line string, innerWidth int) string {
borderStyle := theme.SectionBorder
padding := innerWidth - VisibleLen(line)
if padding < 0 {
padding = 0
}
return borderStyle.Render(theme.BoxRoundedVertical+" ") + line + strings.Repeat(" ", padding) + borderStyle.Render(" "+theme.BoxRoundedVertical)
}components.VisibleLen function · go · L132-L149 (18 LOC)src/internal/presentation/components/box.go
func VisibleLen(s string) int {
inEscape := false
length := 0
for _, r := range s {
if r == '\x1b' {
inEscape = true
continue
}
if inEscape {
if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {
inEscape = false
}
continue
}
length++
}
return length
}components.NewProgressBar function · go · L21-L28 (8 LOC)src/internal/presentation/components/progress.go
func NewProgressBar(current, total int) *ProgressBar {
return &ProgressBar{
Current: current,
Total: total,
Width: 30,
ShowCount: true,
}
}components.ProgressBar.Render method · go · L31-L60 (30 LOC)src/internal/presentation/components/progress.go
func (p *ProgressBar) Render() string {
if p.Total == 0 {
return ""
}
// Calculate fill percentage
filled := int(float64(p.Current) / float64(p.Total) * float64(p.Width))
if filled > p.Width {
filled = p.Width
}
// Build bar
bar := theme.ProgressFilled.Render(strings.Repeat(theme.IconProgressFull, filled)) +
theme.ProgressEmpty.Render(strings.Repeat(theme.IconProgressEmpty, p.Width-filled))
// Build result
var parts []string
if p.ShowSpinner && p.Spinner != "" {
parts = append(parts, theme.SpinnerStyle.Render(p.Spinner))
}
parts = append(parts, bar)
if p.ShowCount {
parts = append(parts, fmt.Sprintf("%d/%d", p.Current, p.Total))
}
return strings.Join(parts, " ")
}Repobility's GitHub App fixes findings like these · https://github.com/apps/repobility-bot
components.NewSpinner function · go · L21-L29 (9 LOC)src/internal/presentation/components/spinner.go
func NewSpinner() Spinner {
s := spinner.New()
s.Spinner = spinner.Spinner{
Frames: theme.BrailleSpinner,
FPS: SpinnerFPS,
}
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(theme.ColorSpinner))
return Spinner{Model: s}
}components.NewSpinnerWithStyle function · go · L32-L40 (9 LOC)src/internal/presentation/components/spinner.go
func NewSpinnerWithStyle(color string) Spinner {
s := spinner.New()
s.Spinner = spinner.Spinner{
Frames: theme.BrailleSpinner,
FPS: SpinnerFPS,
}
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(color))
return Spinner{Model: s}
}components.NewSpinnerModel function · go · L43-L51 (9 LOC)src/internal/presentation/components/spinner.go
func NewSpinnerModel() spinner.Model {
s := spinner.New()
s.Spinner = spinner.Spinner{
Frames: theme.BrailleSpinner,
FPS: SpinnerFPS,
}
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color(theme.ColorSpinner))
return s
}components.PadRight function · go · L60-L66 (7 LOC)src/internal/presentation/components/text.go
func PadRight(text string, width int) string {
visibleLen := VisibleLen(text)
if visibleLen >= width {
return text
}
return text + strings.Repeat(" ", width-visibleLen)
}components.PadLeft function · go · L69-L75 (7 LOC)src/internal/presentation/components/text.go
func PadLeft(text string, width int) string {
visibleLen := VisibleLen(text)
if visibleLen >= width {
return text
}
return strings.Repeat(" ", width-visibleLen) + text
}components.CellSpecial function · go · L103-L108 (6 LOC)src/internal/presentation/components/text.go
func CellSpecial(text string, width int) string {
if text == "" {
return theme.Muted.Render(fmt.Sprintf("%-*s", width, text))
}
return theme.Special.Render(fmt.Sprintf("%-*s", width, text))
}components.RenderDescription function · go · L129-L134 (6 LOC)src/internal/presentation/components/text.go
func RenderDescription(text string) string {
if text == "" {
return ""
}
return theme.Muted.Render(ColumnSeparator + text)
}components.Breadcrumb function · go · L141-L158 (18 LOC)src/internal/presentation/components/text.go
func Breadcrumb(parts ...string) string {
if len(parts) == 0 {
return ""
}
if len(parts) == 1 {
return theme.BreadcrumbActive.Render(parts[0])
}
var result strings.Builder
for i, part := range parts {
if i == len(parts)-1 {
result.WriteString(theme.BreadcrumbActive.Render(part))
} else {
result.WriteString(theme.Breadcrumb.Render(part + " > "))
}
}
return result.String()
}Repobility · MCP-ready · https://repobility.com
components.PageHeaderHeight function · go · L177-L182 (6 LOC)src/internal/presentation/components/text.go
func PageHeaderHeight(hasSubtitle bool) int {
if hasSubtitle {
return 5
}
return 4
}components.PageHeader function · go · L186-L195 (10 LOC)src/internal/presentation/components/text.go
func PageHeader(title string, subtitle string) string {
var lines []string
lines = append(lines, "") // Top padding
lines = append(lines, PageIndent+theme.SectionTitle.Render(strings.ToUpper(title)))
if subtitle != "" {
lines = append(lines, PageIndent+theme.Muted.Render(subtitle))
}
lines = append(lines, "") // Bottom padding
return lipgloss.JoinVertical(lipgloss.Left, lines...) + "\n"
}components.NewApp function · go · L54-L68 (15 LOC)src/internal/presentation/components/tui_app.go
func NewApp(config AppConfig) *App {
items := config.BuildItems()
list := NewList(items)
list.CalculateLabelWidth()
page := NewPage(config.Title)
page.Breadcrumbs = config.Breadcrumbs
return &App{
config: config,
list: list,
page: page,
spinner: NewSpinner(),
}
}components.App.Update method · go · L76-L171 (96 LOC)src/internal/presentation/components/tui_app.go
func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
// Always allow quit with ctrl+c
if key.Matches(msg, key.NewBinding(key.WithKeys("ctrl+c"))) {
a.quitting = true
return a, tea.Quit
}
if a.processing {
return a, nil
}
switch {
case key.Matches(msg, key.NewBinding(key.WithKeys("esc"))):
// First try custom OnBack handler
if a.config.OnBack != nil && a.config.OnBack() {
return a, nil
}
// Then try navigation stack
if a.navigateBack() {
return a, nil
}
a.quitting = true
return a, tea.Quit
case key.Matches(msg, key.NewBinding(key.WithKeys("q"))):
a.quitting = true
return a, tea.Quit
case key.Matches(msg, key.NewBinding(key.WithKeys("up", "k"))):
a.list.Up()
case key.Matches(msg, key.NewBinding(key.WithKeys("down", "j"))):
a.list.Down()
case key.Matches(msg, key.NewBinding(key.WithKeys("enter", " "))):
return a.handleSelect()
}
case ActionDoneMsg:
a.components.App.View method · go · L174-L189 (16 LOC)src/internal/presentation/components/tui_app.go
func (a *App) View() string {
if a.quitting {
return ""
}
if len(a.config.Breadcrumbs) > 0 {
a.page.Help = DefaultHelpWithBack()
} else {
a.page.Help = DefaultHelp()
}
// Pass spinner frame to list for loading states
a.list.SpinnerFrame = a.spinner.View()
a.page.Content = a.list.Render(a.page.ContentHeight())
return a.page.Render()
}components.App.handleSelect method · go · L191-L214 (24 LOC)src/internal/presentation/components/tui_app.go
func (a *App) handleSelect() (*App, tea.Cmd) {
idx := a.list.SelectedIndex()
if idx < 0 || idx >= len(a.list.Items) {
return a, nil
}
item := a.list.Items[idx]
if item.Kind == KindHeader {
return a, nil
}
if a.config.OnSelect != nil {
cmd := a.config.OnSelect(idx, item)
if cmd != nil {
a.processing = true
a.page.Processing = true
// Rebuild items immediately to show loading state
a.rebuildItems()
return a, cmd
}
}
return a, nil
}components.App.rebuildItems method · go · L216-L234 (19 LOC)src/internal/presentation/components/tui_app.go
func (a *App) rebuildItems() {
cursor := a.list.Cursor
items := a.config.BuildItems()
a.list = NewList(items)
a.list.CalculateLabelWidth()
if cursor >= len(items) {
cursor = len(items) - 1
}
a.list.SetCursor(cursor)
for a.list.Cursor > 0 && !a.list.Items[a.list.Cursor].Selectable() {
a.list.Cursor--
}
if a.width > 0 && a.height > 0 {
a.list.SetSize(a.width, a.height)
}
}components.App.navigateTo method · go · L236-L261 (26 LOC)src/internal/presentation/components/tui_app.go
func (a *App) navigateTo(config AppConfig) {
// Push current config to stack
a.configStack = append(a.configStack, a.config)
// Build breadcrumbs from stack
var breadcrumbs []string
for _, c := range a.configStack {
breadcrumbs = append(breadcrumbs, c.Title)
}
config.Breadcrumbs = breadcrumbs
// Switch to new config
a.config = config
a.page = NewPage(config.Title)
a.page.Breadcrumbs = breadcrumbs
// Build new list with cursor at top
items := a.config.BuildItems()
a.list = NewList(items)
a.list.CalculateLabelWidth()
if a.width > 0 && a.height > 0 {
a.list.SetSize(a.width, a.height)
a.page.SetSize(a.width, a.height)
}
}Powered by Repobility — scan your code at https://repobility.com
components.App.navigateBack method · go · L263-L292 (30 LOC)src/internal/presentation/components/tui_app.go
func (a *App) navigateBack() bool {
if len(a.configStack) == 0 {
return false
}
// Pop from stack
a.config = a.configStack[len(a.configStack)-1]
a.configStack = a.configStack[:len(a.configStack)-1]
// Rebuild breadcrumbs
var breadcrumbs []string
for _, c := range a.configStack {
breadcrumbs = append(breadcrumbs, c.Title)
}
a.page = NewPage(a.config.Title)
a.page.Breadcrumbs = breadcrumbs
// Build new list with cursor at top
items := a.config.BuildItems()
a.list = NewList(items)
a.list.CalculateLabelWidth()
if a.width > 0 && a.height > 0 {
a.list.SetSize(a.width, a.height)
a.page.SetSize(a.width, a.height)
}
return true
}components.Run function · go · L317-L322 (6 LOC)src/internal/presentation/components/tui_app.go
func Run(config AppConfig) error {
app := NewApp(config)
p := tea.NewProgram(app, tea.WithAltScreen())
_, err := p.Run()
return err
}components.RunOrExit function · go · L325-L330 (6 LOC)src/internal/presentation/components/tui_app.go
func RunOrExit(config AppConfig) {
if err := Run(config); err != nil {
fmt.Printf("Error: %v\n", err)
os.Exit(1)
}
}