Skip to content

MoLinesDesigns/BrewTUI

Repository files navigation

BrewTUI-Bar

Your Homebrew, finally visible.

npm Node License Homebrew Tests

A keyboard-driven terminal UI for Homebrew, with a native macOS menu bar companion that watches updates in the background. No daemons, no middleware — both tools call brew directly.

BrewTUI-Bar demo

brew tap MoLinesDesigns/tap
brew install brewtui-bar      # then just type:  brewtui-bar

Why BrewTUI-Bar?

You don't memorize brew outdated && brew upgrade && brew services list && brew leaves. You forget half of them. BrewTUI-Bar puts every command behind one keystroke and shows you what brew never tells you until something breaks: orphans, vulnerabilities, services that died last Tuesday.

Without BrewTUI-Bar With BrewTUI-Bar
brew outdated → wall of text → grep Press 3 → list with version arrows → Enter to upgrade
brew services list → restart by hand Press 4 → toggle services with one key
Vulnerable packages? Press 9 → cross-checked against OSV.dev (Pro)
Forgot to update? BrewTUI-Bar lives in your menu bar and tells you (Pro)

Install

# Homebrew (recommended)
brew tap MoLinesDesigns/tap
brew install brewtui-bar

# npm
npm install -g brewtui-bar

# Run without installing
npx brewtui-bar

Requirements: Homebrew, macOS. The Homebrew formula installs the required Node.js runtime dependency.


Features

Feature Description
Dashboard Overview of installed packages, outdated counts, services, and system info
Installed Browse and filter formulae and casks with version info and status badges
Search Find and install packages directly from the TUI
Outdated Version comparison arrows, upgrade individually or all at once
Services Start, stop, and restart Homebrew services
Doctor Run brew doctor and see warnings at a glance
Package Info Detailed view with dependencies, caveats, and quick actions

Pro Features — €9,95/mo or €82/year (-31%)

Feature What it solves
Smart Rollback Auto-snapshots after every install/upgrade/uninstall/pin; revert with bottle/versioned/pin strategies. Press R from a flagged CVE to jump straight to the rollback plan
Cross-machine Sync iCloud Drive backend, AES-256-GCM encrypted client-side. Brewfile and snapshots stay aligned across all your Macs with interactive conflict resolution
CVE Real-time BrewTUI-Bar polls OSV.dev hourly. Critical/high CVEs trigger native macOS notifications and a badge count
Declarative Brewfile YAML desired state, drift score 0-100, interactive reconciliation. Closer to a lightweight Nix-flake than brew bundle
Impact Analysis Pre-upgrade risk panel (low/medium/high) with dependency tree and reverse-deps that will be affected, surfaced before each upgrade
Profiles Replicate your exact setup on a new Mac in one command
Smart Cleanup Reclaim gigabytes by listing orphans ranked by size
Action History "What did I install last week?" — answered
Security Audit Cross-checks every installed package against OSV.dev live
BrewTUI-Bar A menu bar app that watches your packages while you sleep — auto-installs and auto-launches the moment you go Pro

Team Tier — €8/seat/mo or €81,60/seat/year (-15%, min 3 seats)

Everything in Pro plus Team Compliance — admin defines a central PolicyFile (JSON) listing required and forbidden packages and required taps. Each Mac on the team gets a 0-100 compliance score, severity-graded violations and an automatic remediation plan. Useful for onboarding, security audits and keeping every developer's environment aligned.

See pricing →


Screenshots

Dashboard Outdated
Dashboard Outdated
Services Doctor
Services Doctor
Smart Cleanup (Pro) Security Audit (Pro)
Smart Cleanup Security Audit

Smart Cleanup ranks orphans by size — find your 34 MB unused jpeg-xl in 2 seconds. Security Audit cross-checks every installed package against OSV.dev live.


Usage

brewtui-bar                   # Launch the TUI
brewtui-bar status            # Show license status
brewtui-bar activate <key>    # Activate Pro license
brewtui-bar revalidate        # Revalidate Pro license
brewtui-bar deactivate        # Deactivate license on this machine
brewtui-bar delete-account    # Remove all local data (~/.brewtui-bar/)

Keyboard Navigation

Heads up — keyboard model changed in 0.9.0 / 0.9.1. Numbers 10 no longer jump between views; they now run the numbered actions in the footer of the current view. The side menu opens automatically on launch (0.9.1) so arrows operate it from the first frame; press m to close or reopen it. The blinking orange M in the menu indicator marks the toggle. Old per-view letter shortcuts (i, u, r, …) still work as aliases.

Key Action
/ + Enter Operate the side menu (active by default on launch)
m Toggle the side menu (close / reopen)
1-9 Run the matching numbered action in the current view's footer
/ (or j / k) Move within a list
Enter Open / confirm the highlighted item
/ Filter the current list
S Open the Search view
Escape Go back
L Toggle language (en/es)
q Quit

Language

BrewTUI-Bar supports English and Spanish. Language is detected from your system locale (LANG), or you can:

  • Pass --lang=es or --lang=en as a CLI flag
  • Press L inside the TUI to toggle

BrewTUI-Bar (Pro)

BrewTUI-Bar is a native macOS menu bar companion app (Swift 6 / SwiftUI) that:

  • Shows a badge with outdated package count
  • Sends push notifications when updates are available
  • Lets you upgrade packages without opening a terminal
  • Displays Homebrew service status
  • Configurable check interval (1h / 4h / 8h)
  • Supports Launch at Login

Install BrewTUI-Bar

# Via BrewTUI-Bar CLI (Pro license required)
brewtui-bar install-brewtui-bar
brewtui-bar install-brewtui-bar --force   # Reinstall / update
brewtui-bar uninstall-brewtui-bar         # Remove

# Via Homebrew Cask
brew install --cask MoLinesDesigns/tap/brewbar

Build from Source

cd menubar
tuist generate
xcodebuild -workspace BrewTUI-Bar.xcworkspace -scheme BrewTUI-Bar build

Requires Tuist, Xcode, and macOS 14+.


Architecture

Views (React/Ink) --> Stores (Zustand) --> brew-api --> Parsers --> brew CLI (spawn)
Layer Tech Role
UI React 18 + Ink 5 Terminal rendering via ANSI escape codes
State Zustand 5 Global stores with per-key loading/error maps
API brew-api.ts Typed wrapper over brew CLI with input validation
Parsers json-parser / text-parser Parse brew info --json, brew search, brew doctor
CLI brew-cli.ts execBrew() (30s timeout) and streamBrew() (async generator, 5min idle timeout)
  • ESM-only, TypeScript strict mode, built with tsup
  • All streaming operations (install, upgrade) use AsyncGenerators yielding lines in real time
  • Package names validated via regex before passing to spawn (no shell injection)
  • 434 tests across 59 suites (Vitest)

Security

  • License data encrypted with AES-256-GCM, machine-bound via UUID
  • SHA-256 verification on BrewTUI-Bar binary downloads
  • Bundle integrity check at startup (fail-closed)
  • Runtime validation of all external API responses (Polar, OSV)
  • Rate limiting on license activation (5 attempts / 15min lockout)
  • No secrets in logs, no PII transmitted without consent

Project Structure

src/
  views/           # 16 React/Ink views (incl. rollback, brewfile, sync, compliance)
  stores/          # Zustand stores (brew, navigation, license, modal, rollback, sync, compliance, ...)
  components/      # Shared UI (StatusBadge, ResultBanner, SelectableRow, ...)
  hooks/           # useKeyboard, useBrewStream, useDebounce
  lib/
    license/       # Polar API, AES encryption, anti-tamper, canary
    security/      # OSV vulnerability scanning (Pro)
    profiles/      # Profile export/import (Pro)
    cleanup/       # Orphan detection (Pro)
    history/       # Action logging (Pro)
    rollback/      # Snapshot-based rollback engine (Pro)
    state-snapshot/# Periodic Brew state snapshots (Pro)
    diff-engine/   # Snapshot diff for rollback and sync (Pro)
    impact/        # Pre-upgrade impact analysis (Pro)
    brewfile/      # Declarative YAML Brewfile + drift score (Pro)
    sync/          # iCloud-backed cross-machine sync, AES-256-GCM (Pro)
    compliance/    # Team policy enforcement (Team)
    parsers/       # JSON and text parsers for brew output
  i18n/            # English + Spanish translations
  utils/           # Colors, spacing, logger, formatting
menubar/           # BrewTUI-Bar (Swift 6 / SwiftUI / Tuist)

Contributing

git clone https://github.com/MoLinesDesigns/BrewTUI-Bar.git
cd BrewTUI-Bar
npm install
npm run dev          # Run with tsx (requires interactive TTY)
npm run typecheck    # tsc --noEmit
npm run test         # vitest (434 tests)
npm run lint         # eslint
npm run build        # Production bundle via tsup

License

MIT -- MoLines Designs

About

BrewTUI-Bar — Visual TUI and CLI for Homebrew package management. React 18 + Ink 5 + TypeScript.

Topics

Resources

License

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors