[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74871":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":13,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":14,"lastSyncTime":31,"discoverSource":32},74871,"nanobrew","justrach\u002Fnanobrew","justrach","The fastest macOS package manager. Written in Zig. 3ms warm installs.","https:\u002F\u002Fnanobrew.trilok.ai",null,"Zig",1076,15,2,5,0,1,53.61,"Apache License 2.0",false,"main",[23,24,25,26,27],"apt-get","homebrew","linux","macos","zig","2026-06-13 04:01:13","\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Flogo.png\" alt=\"nanobrew logo\" width=\"200\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F25937\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Ftrendshift.io\u002Fapi\u002Fbadge\u002Frepositories\u002F25937\" alt=\"justrach%2Fnanobrew | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n# nanobrew\n\nA fast package manager for macOS and Linux. Written in Zig. Native install pipeline for the top 100 Homebrew formulae and top 100 casks (no `brew`, no Ruby), with verified Homebrew fallback for everything else and native `.deb` support for Linux\u002FDocker.\n\n## Why nanobrew?\n\n- **Fast warm installs** — already-installed no-ops return in milliseconds (5.8ms on the v0.1.192 sandboxed `yt-dlp` benchmark)\n- **Parallel downloads** — all dependencies download and extract at the same time\n- **No Ruby runtime** — single static binary, instant startup\n- **No auto-update** — `nb install` just installs; self-update is explicit via `nb update`\n- **No quarantine** — cask installs skip `com.apple.quarantine`, so apps open without Gatekeeper prompts\n- **Native installs** — top 100 formulae and top 100 casks install without Homebrew, Ruby, or `brew` subprocess (v0.1.192)\n- **Third-party taps** — `nb install user\u002Ftap\u002Fformula` just works. The only fast Homebrew client with tap support\n- **Drop-in Homebrew replacement** — same formulas, same bottles, same casks\n- **Linux + Docker** — native .deb support, **up to 13x faster** than apt-get on warm installs\n\n## nanobrew vs Homebrew\n\nHomebrew is great software and powers millions of dev machines. nanobrew makes different tradeoffs:\n\n| | Homebrew | nanobrew |\n|---|---------|----------|\n| **Auto-update** | `brew install` runs `brew update` first (can take minutes) | `nb install` just installs. Self-update is explicit via `nb update`. |\n| **Gatekeeper quarantine** | Casks get `com.apple.quarantine` — triggers \"Are you sure?\" dialog | No quarantine flag — apps open immediately |\n| **Parallel downloads** | Sequential by default; set `HOMEBREW_DOWNLOAD_CONCURRENCY` to change | All dependencies download simultaneously out of the box |\n| **Runtime** | Ruby (~57 MB) | Single 1.2 MB static binary. Instant startup, no bootstrapping. |\n| **Brewfile no-ops** | `brew bundle` rechecks everything (~10s even when satisfied) | `nb bundle install` returns instantly when nothing to do |\n\nIf you rely on `post_install` hooks, build-from-source options, or Mac App Store integration, Homebrew is still the right choice. nanobrew covers the fast path: bottles, casks, and bundles.\n\n| Package | Homebrew | zerobrew (cold) | zerobrew (warm) | nanobrew (cold) | nanobrew (warm) |\n|---------|----------|-----------------|-----------------|-----------------|-----------------|\n| **tree** (0 deps) | 4.070s | 1.254s | 0.242s | **0.507s** | **0.009s** |\n| **ffmpeg** (11 deps) | 14.252s | 3.986s | 2.147s | **1.624s** | **0.287s** |\n| **wget** (6 deps) | 3.935s | 5.502s | 0.587s | **3.211s** | **0.027s** |\n\n> Benchmarks on Apple Silicon (GitHub Actions macos-14), 2026-03-23. Auto-updated weekly.\n\n| | nanobrew | zerobrew | Homebrew |\n|---|---------|----------|----------|\n| **Binary size** | **1.2 MB** | 7.9 MB | 57 MB (Ruby runtime) |\n\n> nanobrew is **6.8x smaller** than zerobrew and **47x smaller** than Homebrew. See how these are measured in the [benchmark workflow](.github\u002Fworkflows\u002Fbenchmark.yml).\n\n### Linux \u002F Docker — nanobrew vs apt-get\n\nnanobrew's `--deb` mode is a full apt-get replacement: fetches APT package indices, resolves dependencies, downloads and extracts `.deb` files — all in pure Zig with no subprocess calls.\n\n| Package set | Deps | apt-get | nanobrew (warm) | Speedup |\n|-------------|------|---------|-----------------|---------|\n| **curl wget** | 35 | 3,426ms | **448ms** | **7.6x** |\n| **curl wget tree jq htop tmux** | 53 | 3,584ms | **521ms** | **6.9x** |\n| **git vim build-essential** | 116 | 43,833ms | **3,402ms** | **12.9x** |\n| **nginx redis-server postgresql-client** | 78 | 5,501ms | **1,402ms** | **3.9x** |\n\n> Verified benchmarks on Ubuntu 24.04.4 LTS (aarch64, Docker\u002FColima), median of 3 runs. Warm = NBIX binary index cache + cached .deb blobs, `--skip-postinst`. See `bench\u002F` for reproduction.\n\n**What makes it fast:**\n- **NBIX binary index cache** — 70K packages deserialized in 32ms (vs 3s HTTP + 72MB gzip decompress + text parse)\n- **8-thread parallel .deb downloads** with HTTP connection reuse\n- **8-thread parallel extraction** — concurrent ar\u002Fgzip\u002Ftar parsing via native Zig tar\n- **Arena allocator** — single `deinit()` frees all 70K parsed packages\n\n## Install\n\n```bash\n# One-liner\ncurl -fsSL https:\u002F\u002Fnanobrew.trilok.ai\u002Finstall | bash\n\n# Or via Homebrew\nbrew tap justrach\u002Fnanobrew https:\u002F\u002Fgithub.com\u002Fjustrach\u002Fnanobrew\nbrew install nanobrew\n\n# Or build from source (needs Zig 0.16.0+)\ngit clone https:\u002F\u002Fgithub.com\u002Fjustrach\u002Fnanobrew.git\ncd nanobrew && .\u002Finstall.sh\n```\n\n### Upgrading\n\n```bash\n# v0.1.193 and later: self-update works in one call\nnb update\n```\n\nIf you're on **v0.1.192 or older** and `nb update` errors with\n`could not download SHA256 checksum`, the self-updater on your installed\nbinary can't reach past a redirect-chain bug in its native HTTP client\n(fixed in v0.1.193). Re-run the installer once to get unstuck, then\n`nb update` will work for all future releases:\n\n```bash\ncurl -fsSL https:\u002F\u002Fnanobrew.trilok.ai\u002Finstall | bash\n```\n\nThe same bug also affected exactly v0.1.190 via a different code path\n(file-naming bug in the extract step); the same one-liner unsticks it.\n\n## Usage\n\n### Basics\n\n```bash\nnb install tree               # install a package\nnb install ffmpeg wget curl   # install multiple at once\nnb install --shims yt-dlp     # expose yt-dlp, keep dependency tools private\nnb remove tree                # uninstall\nnb list                       # see what's installed\nnb info jq                    # show package details\nnb search ripgrep             # search formulas and casks\n```\n\n### Shimmed Installs\n\n```bash\nnb install --shims yt-dlp\n```\n\nShimmed installs are an experimental link mode for packages whose dependencies ship command-line tools you do not want exposed globally. The requested formula gets wrapper shims in `\u002Fopt\u002Fnanobrew\u002Fprefix\u002Fbin`; dependency executables are kept out of `prefix\u002Fbin` and are only added to that wrapper's private `PATH`. This keeps commands like `deno` or `python` available to the requested tool without making those dependency executables first-class shell commands. You can also enable this mode for formula installs with `NANOBREW_SHIMS=1`.\n\n### Third-Party Taps\n\n```bash\nnb install steipete\u002Ftap\u002Fsag   # install from a third-party tap\nnb install indirect\u002Ftap\u002Fbpb   # taps with bottles work too\n```\n\nnanobrew fetches the Ruby formula directly from GitHub, parses it, and installs — no `brew tap` step needed. Supports bottles, source builds, and pre-built binaries.\n\n### macOS Apps (Casks)\n\n```bash\nnb install --cask firefox     # install a .dmg\u002F.pkg\u002F.zip app\nnb remove --cask firefox      # uninstall it\nnb upgrade --cask             # upgrade all casks\n```\n\nAs of v0.1.192, the top 100 casks install through nanobrew's native pipeline — no `brew` subprocess, no Homebrew prefix, no Ruby. Native cask support covers apps, `.pkg`, fonts, binaries, suites, copied artifacts, installer scripts, `.tar.xz`, and extensionless vendor URLs. Casks outside the top 100 still fall back to the verified Homebrew path.\n\n### Linux \u002F Docker (deb packages)\n\n```bash\nnb install --deb curl wget git    # install from Ubuntu\u002FDebian repos\nnb remove --deb curl              # remove a deb package\nnb upgrade --deb                  # upgrade all installed deb packages\nnb list                           # shows deb packages alongside brew packages\nnb outdated                       # checks deb packages for newer versions too\n```\n\n```dockerfile\n# Replace slow apt-get in Dockerfiles\nCOPY --from=nanobrew\u002Fnb \u002Fnb \u002Fusr\u002Flocal\u002Fbin\u002Fnb\nRUN nb init && nb install --deb curl wget git\n```\n\n- Auto-detects distro and architecture (Ubuntu\u002FDebian, amd64\u002Farm64)\n- Resolves virtual packages via `Provides:` field (e.g. `build-essential` works)\n- Picks the best alternative when multiple packages satisfy a dependency\n- Runs `postinst` scripts and `ldconfig` so shared libraries work out of the box\n- Tracks installed files in `state.json` for clean removal\n- Content-addressable cache — warm installs are instant\n\n### Keep packages up to date\n\n```bash\nnb outdated                   # see what's behind\nnb upgrade                    # upgrade everything\nnb upgrade tree               # upgrade one package\nnb pin tree                   # prevent a package from upgrading\nnb unpin tree                 # allow upgrades again\n```\n\n### Undo and backup\n\n```bash\nnb rollback tree              # revert to the previous version\nnb bundle dump                # export installed packages to a Nanobrew file\nnb bundle install             # reinstall everything from a Nanobrew file\n```\n\n### Diagnostics\n\n```bash\nnb doctor                     # check for common problems\nnb cleanup                    # remove old caches and orphaned files\nnb cleanup --dry-run          # see what would be removed first\n```\n\n### Download Telemetry\n\n```bash\nnb telemetry status\nnb telemetry off\nnb telemetry on\n```\n\nnanobrew sends anonymized, best-effort download timing events to `https:\u002F\u002Fbackend.trilok.ai\u002Fv1\u002Ftelemetry\u002Fsystem`. This helps prioritize which packages and casks should get native nanobrew support first, based on real download\u002Finstall demand and slow paths.\n\nThe exact event shape is:\n\n```json\n{\n  \"schema\": 1,\n  \"source\": \"nanobrew\",\n  \"event\": \"download\",\n  \"os\": \"macos\",\n  \"arch\": \"arm64\",\n  \"ram_gb\": 128,\n  \"cpu_count\": 10,\n  \"operation\": \"download\",\n  \"target_kind\": \"formula\",\n  \"target_name\": \"uv\",\n  \"duration_ms\": 120,\n  \"download_bytes\": 33000000,\n  \"success\": true\n}\n```\n\nIt does not send URLs, paths, hostnames, usernames, IPs, user IDs, full package lists, or command history. `target_name` is only a package-like token such as `uv`, `firefox`, or `owner\u002Ftap\u002Fpkg`. You can opt out with `nb telemetry off`, `NANOBREW_NO_TELEMETRY=1`, or `NANOBREW_TELEMETRY=0`.\n\n### Dependencies and services\n\n```bash\nnb deps ffmpeg                # list all dependencies\nnb deps --tree ffmpeg         # show dependency tree\nnb services list              # show launchctl services from installed packages\nnb services start postgresql  # start a service\nnb services stop postgresql   # stop a service\n```\n\n### Shell completions\n\n```bash\nnb completions zsh >> ~\u002F.zshrc\nnb completions bash >> ~\u002F.bashrc\nnb completions fish > ~\u002F.config\u002Ffish\u002Fcompletions\u002Fnb.fish\n```\n\n### Other\n\n```bash\nnb update                     # self-update nanobrew\nnb init                       # create directory structure (run once)\nnb help                       # show all commands\n```\n\n## How it works\n\n```\nnb install ffmpeg                        # macOS: Homebrew bottles\n  │\n  ├─ 1. Resolve dependencies (BFS, parallel API calls)\n  ├─ 2. Skip anything already installed (warm path: ~3.5ms)\n  ├─ 3. Download bottles in parallel (native HTTP, streaming SHA256)\n  ├─ 4. Extract into content-addressable store (\u002Fopt\u002Fnanobrew\u002Fstore\u002F\u003Csha>)\n  ├─ 5. Clone into Cellar via APFS clonefile (zero-copy, instant)\n  ├─ 6. Relocate Mach-O headers + batch codesign\n  └─ 7. Symlink binaries into \u002Fopt\u002Fnanobrew\u002Fprefix\u002Fbin\u002F\n\nnb install --deb curl                    # Linux: .deb packages\n  │\n  ├─ 1. Detect distro from \u002Fetc\u002Fos-release (Ubuntu\u002FDebian, amd64\u002Farm64)\n  ├─ 2. Fetch + decompress package index (main + universe components)\n  ├─ 3. Build provides map for virtual package resolution\n  ├─ 4. Resolve dependencies (topological sort, index-aware alternatives)\n  ├─ 5. Download .debs with streaming SHA256 verification\n  ├─ 6. Parse ar archive, decompress data.tar natively (zstd\u002Fgzip)\n  ├─ 7. Extract to \u002F and track installed files in state.json\n  ├─ 8. Run postinst scripts (ca-certificates, ldconfig, etc.)\n  └─ 9. Run ldconfig for shared library registration\n\nnb install steipete\u002Ftap\u002Fsag              # Third-party taps\n  │\n  ├─ 1. Detect tap syntax (user\u002Ftap\u002Fformula)\n  ├─ 2. Fetch Ruby formula from GitHub (raw.githubusercontent.com)\n  ├─ 3. Parse .rb file (version, url, sha256, deps, bottle blocks)\n  ├─ 4. Resolve dependencies normally (they're homebrew-core names)\n  └─ 5. Install via bottle or source path (same pipeline as above)\n```\n\nDependency ordering walks the explicit formula graph and topologically sorts it in `O(V+E)`. The `O(1)` resolver improvement in v0.1.190 refers to queue dequeue during that sort, not solving arbitrary version constraints.\n\nKey design choices:\n- **Content-addressable store** — deduplicates bottles by SHA256. Reinstalls are instant because the data is already there.\n- **APFS clonefile** — copy-on-write on macOS means no extra disk space when materializing from the store.\n- **Streaming SHA256** — hash is verified during download, no second pass over the file.\n- **Native binary parsing** — reads Mach-O (macOS) and ELF (Linux) headers directly instead of spawning `otool`\u002F`patchelf`.\n- **Native ar + decompression** — .deb extraction without `dpkg`, `ar`, or `zstd` binaries. Only needs `tar`.\n- **Single static binary** — no runtime dependencies. 1.2 MB.\n\n## Testing\n\n```bash\n# Run all tests (macOS — native)\nzig build test\n\n# Run individual module tests with verbose output\nzig test src\u002Fdeb\u002Findex.zig         # 7 tests: package parsing, provides map\nzig test src\u002Fdeb\u002Fresolver.zig      # 17 tests: dependency resolution, virtual packages\n\n# Cross-compile and run on Linux via Colima\u002FDocker\nzig build test -Dtarget=aarch64-linux   # cross-compile to static ELF\ndocker run --rm -v .zig-cache\u002Fo\u002F\u003Chash>\u002Ftest:\u002Ftest alpine \u002Ftest\n\n# Or as a one-liner (find the binary automatically)\ndocker run --rm -v \"$(find .zig-cache -name test -newer build.zig | head -1):\u002Ft:ro\" alpine \u002Ft\n```\n\nZig's cross-compilation produces a statically-linked binary that runs directly in any Linux container — no need to install Zig or any toolchain inside Docker.\n\n## Contributing\n\nFollow [CONTRIBUTING.md](.\u002FCONTRIBUTING.md) for all future issues and PRs.\n\nThe short version:\n\n- every PR must be tied to an issue\n- every fix must show red-to-green proof\n- every non-trivial branch must be rebased onto current `main`\n- PRs over 500 changed lines will usually be rejected unless they are clearly justified, tightly scoped, and good enough to survive strict review\n\n\n## Directory layout\n\n```\n\u002Fopt\u002Fnanobrew\u002F\n  cache\u002F\n    blobs\u002F      # downloaded bottles (by SHA256)\n    api\u002F        # cached formula metadata (5-min TTL)\n    tokens\u002F     # GHCR auth tokens (4-min TTL)\n    tmp\u002F        # partial downloads\n  store\u002F        # extracted bottles (by SHA256)\n  prefix\u002F\n    Cellar\u002F     # installed packages\n    Caskroom\u002F   # installed casks\n    bin\u002F        # symlinks to binaries\n    opt\u002F        # symlinks to keg dirs\n  db\u002F\n    state.json  # installed package state\n```\n\n## Homebrew Compatibility\n\nnanobrew uses Homebrew's formulas, bottles, and cask definitions. It's a faster client for the same ecosystem — not a fork.\n\n### What works\n\n- **Bottle installs** — all pre-built Homebrew bottles install correctly\n- **Cask installs** — `.dmg`, `.zip`, `.pkg`, and `.tar.gz` casks\n- **Dependency resolution** — same transitive deps as Homebrew\n- **Third-party taps** — `nb install user\u002Ftap\u002Fformula` fetches from GitHub\n- **Shared Cellar** — packages install to `\u002Fopt\u002Fnanobrew\u002Fprefix\u002FCellar\u002F` (same layout as Homebrew)\n- **Bundle\u002FBrewfile** — `nb bundle dump` and `nb bundle install` for common `brew \"pkg\"` and `cask \"pkg\"` lines\n\n### What doesn't work (yet)\n\n- **Ruby `post_install` hooks** — Homebrew formulae with Ruby `post_install` blocks won't run those hooks. Most bottles don't need them.\n- **Build from source with custom options** — `args: [\"with-feature\"]` in Brewfiles is ignored\n- **`tap` command** — nanobrew auto-fetches taps inline; standalone `brew tap` is not needed\n- **Mac App Store (`mas`)** — not supported\n- **Complex Ruby DSL in Brewfiles** — conditional blocks, custom Ruby code\n\n### Migration from Homebrew\n\n```bash\nnb migrate    # scan \u002Fopt\u002Fhomebrew\u002FCellar and Caskroom, import into nanobrew's DB\n```\n\nAfter migration, `nb list`, `nb outdated`, and `nb upgrade` will see your existing packages.\n\n### Switching back to Homebrew\n\nPackages installed by nanobrew live in `\u002Fopt\u002Fnanobrew\u002Fprefix\u002FCellar\u002F` — they don't interfere with Homebrew's `\u002Fopt\u002Fhomebrew\u002FCellar\u002F`. You can safely remove nanobrew with `nb nuke` without affecting Homebrew.\n\n## Project status\n\n**Experimental** — works well for common packages. If something breaks, [open an issue](https:\u002F\u002Fgithub.com\u002Fjustrach\u002Fnanobrew\u002Fissues).\n\nLicense: [Apache 2.0](.\u002FLICENSE)\n\n## All commands\n\n| Command | Short | What it does |\n|---------|-------|-------------|\n| `nb install \u003Cpkg>` | `nb i` | Install packages |\n| `nb install --cask \u003Capp>` | | Install macOS apps |\n| `nb install --deb \u003Cpkg>` | | Install .deb packages (Linux\u002FDocker) |\n| `nb install user\u002Ftap\u002Fformula` | | Install from a third-party tap |\n| `nb remove \u003Cpkg>` | `nb ui` | Uninstall packages |\n| `nb remove --deb \u003Cpkg>` | | Remove a .deb package (Linux\u002FDocker) |\n| `nb list` | `nb ls` | List installed packages (brew + deb) |\n| `nb leaves [--tree]` | | List installed formulae with no dependents |\n| `nb where \u003Cpattern>` | `nb wh` | Show installed kegs, prefix files, and index hits matching pattern |\n| `nb info \u003Cpkg>` | | Show package details |\n| `nb info --cask \u003Capp>` | | Show cask details |\n| `nb search \u003Cquery>` | `nb s` | Search formulas and casks |\n| `nb upgrade [pkg]` | | Upgrade packages |\n| `nb upgrade --deb` | | Upgrade all installed .deb packages |\n| `nb outdated` | | List outdated packages (brew + deb) |\n| `nb pin \u003Cpkg>` | | Prevent upgrades |\n| `nb unpin \u003Cpkg>` | | Allow upgrades |\n| `nb rollback \u003Cpkg>` | `nb rb` | Revert to previous version |\n| `nb bundle dump` | | Export installed packages |\n| `nb bundle install` | | Import from bundle file |\n| `nb doctor` | `nb dr` | Health check |\n| `nb cleanup` | `nb clean` | Remove old caches |\n| `nb deps [--tree] \u003Cpkg>` | | Show dependencies |\n| `nb services` | | Manage services (launchctl\u002Fsystemd) |\n| `nb completions \u003Cshell>` | | Print shell completions |\n| `nb telemetry [status\\|on\\|off]` | | View or change telemetry opt-in |\n| `nb nuke` | | Remove all of nanobrew's state |\n| `nb migrate` | | Import packages from Homebrew |\n| `nb update` | | Self-update nanobrew |\n| `nb init` | | Create directory structure |\n| `nb help` | | Show help |\n\nSee [CHANGELOG.md](.\u002FCHANGELOG.md) for version history.\n","nanobrew 是一个为 macOS 和 Linux 设计的快速包管理器，使用 Zig 语言编写。其核心功能包括毫秒级的已安装包检测、并行下载依赖项、无需 Ruby 运行环境、明确的自我更新机制以及在 Linux 和 Docker 上对 `.deb` 包的原生支持。特别适用于需要快速安装和更新软件包的开发环境，尤其对于频繁使用的 Homebrew 公式和 cask 来说，nanobrew 提供了显著的速度优势。此外，它还支持第三方仓库，并且可以无缝替换现有的 Homebrew 安装。","2026-06-11 03:51:12","high_star"]