convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
hunchom

Bodega – Gerenciador de Pacotes macOS com MCP

hunchom/bodega

yum/dnf para macOS: ~4× mais rápido, transacional, com MCP nativo

Ver no GitHub
InicialPluginScore · de 0 a 100

Um gerenciador de pacotes para macOS que oferece interface `yum`/`dnf` sobre Homebrew, com instalador nativo em Go (~4× mais rápido), diário de transações, TUI interativa e integração nativa com Claude. Permite desfazer qualquer instalação via `yum history undo` e suporta busca full-text, árvore de dependências e verificação de integridade.

Instalação

$npx convez-ai hunchom/bodega

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
57%
Último commit
há 5 meses
Versão
—
Issues abertas
1
Contribuidores
2

Casos de uso

  • Instalação e atualização rápida de pacotes em macOS sem Homebrew
  • Gerenciamento transacional de dependências com possibilidade de reverter
  • Navegação interativa de packages via TUI com Claude Code plugin
  • Integração nativa com Claude para operações de package management mid-conversation

Veredito

Ferramental sólido para quem quer substituir Homebrew em macOS com performance real (4× mais rápido), transações reversíveis e integração nativa com Claude. Valor técnico legítimo em índice local otimizado e MCP server bem projetado; restrição a macOS é esperada e bem documentada.

README

A tradução para o português deste README ainda está na fila.


A macOS package manager with a yum / dnf command surface, a native Go bottle installer that's ~4× faster than brew install, a real transaction journal, a proper TUI, and first-class Claude Code integration.

Twenty-nine commands. Every read supports --json. Every mutation writes to a SQLite journal. Every install you ship can be undone with yum history undo.

  • Native package index — fetches Homebrew's signed JSON index straight from formulae.brew.sh, verifies the homebrew-1 PS512 signature, and stores it in a local SQLite index (FTS5 search, normalized deps + bottles). yum update builds it — no brew update. Warm lookups are sub-millisecond vs brew's 200–600 ms reparse, and it works on a host where brew was never run.
  • Native, no-brew commands — update, info, search, outdated, deplist/tree, why, leaves, repolist, provides, plus install / remove / reinstall / upgrade / autoremove / cleanup / pin all run against the index + filesystem directly. The brew binary is invoked only for casks and source-only formulae (no bottle for your macOS) — and even then only as a clearly-scoped fallback.
  • Native bottle installer — resolves deps from the index, downloads via GHCR OAuth2, extracts, relocates Mach-O + re-codesigns. Falls back to brew for casks and source builds.
  • Transactional — install / remove / upgrade / reinstall / pin / sync / manifest-apply all journaled. Undo any one with yum history undo <id>.
  • Interactive TUI — yum browse. Two panes, live filter, amber installed / dim latest, install-from-keyboard, help overlay.
  • Claude Code plugin — 12 slash commands, a proactive package-doctor agent, a yum-packages skill.
  • MCP server — Anthropic-native TypeScript, @modelcontextprotocol/sdk + zod. 12 tools, 3 resources, 2 templates, 2 prompts. Claude can call yum_install mid-conversation.

From the shell

yum install ripgrep              # native fast path — ~0.74s vs 3.02s for brew
yum browse                       # interactive TUI
yum search "text editor" --deps  # ranked: name → desc → tap → dep-of
yum log ripgrep                  # every event that's ever touched this package
yum verify                       # missing deps, broken symlinks, orphaned versions
yum duplicates --prune           # collapse multi-version cellar entries
yum history undo 14              # roll back the last transaction
yum manifest export > pkgs.toml  # declarative system snapshot
yum sync                         # refresh + upgrade + autoremove + cleanup, journaled

From a Claude Code session

install ripgrep and bat
what's outdated
why do i have two copies of openssl
verify my install tree — actually fix the broken symlinks
show me every event for git, then undo whatever changed it yesterday
browse my installed packages

You're not telling Claude to shell out. With the MCP server installed, Claude calls yum_install, yum_verify, yum_log as typed tools.


Why

Without bodega, installing a package through Claude looks like this:

you:    install ripgrep and see what's outdated
Claude: [bash: brew install ripgrep]
        [3.02s of install output pours in, eating your context window]
        [bash: brew outdated]
        [plain text list, no versions, no semver diff]
        done. want me to upgrade?

With bodega:

you:    install ripgrep and see what's outdated
Claude: [yum_install ripgrep]   done in 0.74s, journaled as tx #47
        [yum_outdated]          17 outdated — 2 major, 4 minor, 11 patch
        shall i upgrade the 11 patch bumps?

Same ask. Quarter the time, structured output, one reversible transaction.

What changes

brewbodega
Install speed (bottled)~3s cold, serial deps~0.7s, GHCR-parallel, native extract + codesign
Undo an installbrew uninstall loses the version infoyum history undo <id> — typed, reversible, journaled
"what changed yesterday"cat ~/.brew/brew-history-file if you feel braveyum history, yum log <pkg>, both --json
Outdated at a glancea flat listsemver-diff colored: major red · minor amber · patch green
Interactive browse—yum browse TUI: filter, preview, install, remove
Integrity checkbrew doctor (system-level)yum verify — missing deps, broken symlinks, orphaned versions, stale pins; --fix
Claude Codebash: brew … every time12 slash commands + 12 MCP tools + 2 prompts + subagent
JSON output--json=v2 on some commands--json on every read
Dry runpartialevery mutation

What it is

flowchart LR
  subgraph client["your terminal"]
    CLI[yum CLI]
    TUI[yum browse]
  end
  subgraph bodega["bodega"]
    Native[native bottle installer]
    J[(SQLite journal)]
    V[verify engine]
    CLI --> Native
    CLI --> J
    CLI --> V
    TUI --> CLI
  end
  subgraph claude["Claude Code"]
    S[12 slash commands]
    M[MCP server · 12 tools]
  end
  S -- shells out --> CLI
  M -- shells out --> CLI
  Native -. bottles .-> GHCR
  Native -. cellar links .-> Prefix["/opt/homebrew"]
  • Native fast path for bottled formulae; brew subprocess for casks and source builds — automatic fallback on ErrNativeUnsupported.
  • Journal is authoritative. Every mutation writes a row. Rollback replays in reverse.
  • The TUI is the CLI. yum browse wires into the same backends — it's a renderer, not a second implementation.
  • Claude talks to yum, not brew. The plugin's slash commands and MCP tools both shell out to the binary.

Install

From source:

git clone https://github.com/hunchom/bodega ~/bodega
cd ~/bodega
./build.sh --install

Binary lands at ~/.local/bin/yum; zsh completions at ~/.zsh/completions/_yum.

fpath=(~/.zsh/completions $fpath)
autoload -U compinit && compinit

Claude Code plugin (in any Claude session):

/plugin install claude-plugin/ from the local bodega repo

Or copy the directory into ~/.claude/plugins/ manually.

MCP server (TypeScript, adds 12 yum_* tools to Claude's tool list) — installed automatically by ./build.sh --install (skip with --no-mcp). To rebuild and relink it on its own, run ./build.sh --mcp-only.

After install, register it with Claude Code:

claude mcp add bodega -- bodega-mcp

The claude-plugin also ships a .mcp.json that references bodega-mcp, so once it's on PATH the MCP tools auto-register when you enable the plugin.

cd ~/bodega/mcp-server
npm install
npm run build
npm link                        # puts bodega-mcp on PATH

[!TIP] Restart your Claude Code session after install so the tool registry reloads. Verify with "list my installed packages" — Claude should call yum_list directly instead of shelling out to brew.

Configure

~/.config/yum/config.toml (optional):

[theme]
accent = "amber"
no_color = false

[defaults]
parallel = true

[aliases]
i = "install"
r = "remove"
u = "upgrade"

Global flags apply to every command:

--json          machine-readable output (every read command)
--yes / -y      assume yes on prompts
--no-color      disable ANSI
--dry-run       show what would happen — no side effects
--refresh       force tap refresh (skipped on --dry-run)
--no-refresh    skip tap refresh even if stale
--debug         verbose
--config PATH   override config.toml location

Ask Claude things like

install ripgrep and bat, then show me what changed
what's outdated — just the patch bumps
why is my openssl install so big
verify my install tree and fix the broken symlinks
show me the last 10 transactions
undo transaction 47
browse my installed packages grouped by leaf
remove anything that autoremove would remove, but show me first
export my current state as a manifest i can reapply

You're describing outcomes. The MCP server picks the tools.

Reliability

Installs mutate your filesystem. bodega treats that seriously:

  • Every mutation writes a journal row before it runs, closes it when it finishes. A killed yum install leaves a recorded transaction with exit-code 1 — you can see what was attempted, even if nothing got extracted.
  • Native install rolls back per-plan. If dep 3 of 5 fails, deps 1–2 are unlinked and their cellar dirs removed before the error surfaces. No half-installed kegs.
  • Sha256 verified. Every GHCR-downloaded bottle is streamed through a TeeReader into sha256; a mismatch aborts before extract.
  • Re-codesigned. Mach-O binaries touched by install_name_tool are re-signed with codesign --force --sign - (macOS 11+ refuses to run modified binaries otherwise).
  • Reverse-dep guard. yum remove openssl refuses if anything installed still depends on it. --force to override; --ignore-deps to skip the check entirely.
  • 5-minute info cache is invalidated on mutation. Install, remove, reinstall, upgrade, autoremove, pin, and cleanup all clear the affected entries.
  • yum verify walks the install tree: missing runtime deps, dangling symlinks, orphaned cellar versions (semver-correct, not string-compare), stale pins. --fix removes dangling symlinks.

Golden-file tests cover yum --help output; table / panel / tree renderers test against fixtures; native install, link/unlink, resolver, duplicates, and verify all test against synthetic prefixes under t.TempDir(). MCP server tests mock the subprocess and cover 13 shape/error/contract scenarios.

vs brew

brewyum (bodega)
Install a bottleRuby, serial deps, ~3sGo, parallel GHCR, ~0.7s
Undo an installbrew uninstall + manual cleanupyum history undo <id>
Inspect historybrew history doesn't existyum history, yum log <pkg>
Find dep treebrew deps --treeyum tree, yum why
Disk per packagebrew-du (third party)yum size
Machine outputbrew info --json=v2 (some commands)--json everywhere
Dry runpartialevery mutation
TUI—yum browse
Claude Codenone built-in12 slash commands + 12 MCP tools
Cask installs✓✓ (via brew fallback, today)
Source builds✓✓ (via brew fallback, today)

The pitch isn't "brew is bad." The pitch is "brew is a Ruby subprocess with a plain-text UI — Claude and the shell both deserve structured, fast, reversible ops."

Limitations

What this doesn't do, today, honestly:

  • Casks and source-only formulae still shell out to brew. Metadata and bottled-formula lifecycle are fully native (no brew binary), but installing a cask (dmg/pkg → /Applications, quarantine, sometimes sudo) and building a formula from source (running its Ruby install DSL) require brew's engine. These two are the deliberate, clearly-scoped escape hatches — everything else is native.
  • Apple Silicon + Intel macOS only. Linuxbrew works through the fallback path, but bottle tag resolution and GHCR retrieval assume arm64_<macos> or x86_64_<macos>.
  • No cross-machine sync. manifest export / apply is declarative within one machine. No multi-host rollout, no remote state store.
  • TUI requires a real terminal. Not a Claude Code TUI-rendering thing — it's bubbletea, which needs a proper stdio + TTY.
  • MCP tool surface is 12 tools, not 29. The CLI's tree, why, size, provides, repolist, doctor, rollback, browse, completions, version, clean, pin, manifest, sync, autoremove, reinstall, help are not MCP-exposed. Add via the tool-registration pattern in mcp-server/src/tools/ if you want them.

Testing

go test ./...                   # 10 packages, all green
go vet ./...                    # clean
staticcheck ./...               # clean

cd mcp-server
npm test                        # 13/13 tests, node:test
npx tsc --noEmit                # strict TS, 0 diagnostics
npm audit --omit=dev            # 0 vulnerabilities

CI runs the Go matrix (macos-13, macos-14, ubuntu-latest × Go 1.26) on every push.

Layout

cmd/yum/                 entrypoint
internal/backend/brew/   native bottle installer, GHCR, link/unlink, resolver, services
internal/cmd/            cobra commands (one per file, 29 commands)
internal/config/         TOML config loader
internal/journal/        SQLite transaction log + rollback planner + per-package log
internal/runner/         exec abstraction
internal/semver/         semver-diff classification
internal/tui/browse/     bubbletea TUI (~1,700 LOC)
internal/ui/             tables, panels, trees, picker, theme
internal/verify/         install-tree integrity engine
mcp-server/              Anthropic-native MCP server (TypeScript, zod)
claude-plugin/           Claude Code plugin (12 slash commands, agent, skill)
assets/                  hero SVG and repo imagery
docs/                    audit reports, design notes

License

MIT.

Ver o original no GitHub

Bom para

Relacionados