homebrew-brm

1.2.5 • Public • Published

BRM (Homebrew Registry Manager)

NPM

license npm npm

brm can help you easy and fast switch between different Homebrew registries, now include: official, tsinghua, aliyun, ustc.

Install

$ npm install -g homebrew-brm

Or

$ yarn global add homebrew-brm

Usage

$ brm -h
Usage: brm [options] [command]

Homebrew registry manager for macOS

Options:
  -V, --version    output the version number
  -h, --help       output usage information

Commands:
  ls               List all the registries
  current          Show current registry and URL
  use <registry>   Change homebrew registry
  test [registry]  Show response time for specific or all registries

Example

List all the registries

$ brm ls
┌──────────┬──────────────────┬──────────────────┬──────────────────┬──────────────────┐
│          │       brew       │  homebrew/core   │  homebrew/cask   │ homebrew/bottles │
├──────────┼──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ official │        ✔         │        ✔         │        ✔         │        ✔         │
├──────────┼──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ tsinghua │        ✔         │        ✔         │       Use        │        ✔         │
├──────────┼──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ aliyun   │       Use        │       Use        │        ✘         │       Use        │
├──────────┼──────────────────┼──────────────────┼──────────────────┼──────────────────┤
│ ustc     │        ✔         │        ✔         │        ✔         │        ✔         │
└──────────┴──────────────────┴──────────────────┴──────────────────┴──────────────────┘

Change homebrew registry

$ brm use ustc
? Select registry (Press <space> to select, <a> to toggle all, <i> to invert selection)
❯◉ brew
 ◉ homebrew/core
 ◉ homebrew/cask
 ◉ homebrew/bottles
$ brm use ustc
? Select registry brew, homebrew/core, homebrew/bottles
[BRM] Set brew registry to https://mirrors.ustc.edu.cn/brew.git
[BRM] Set homebrew/core registry to https://mirrors.ustc.edu.cn/homebrew-core.git
[BRM] Set homebrew/cask registry to https://mirrors.ustc.edu.cn/homebrew-cask.git
[BRM] Set homebrew/bottles registry to https://mirrors.ustc.edu.cn/homebrew-bottles
[BRM] Executing brew cleanup
[BRM] Executing brew update
Already up-to-date.
[BRM] Done.

Show current registry and URL

$ brm current
┌──────────────────┬──────────┬─────────────────────────────────────────────────────────────────────┐
│ brew             │ aliyun   │ https://mirrors.aliyun.com/homebrew/brew.git                        │
├──────────────────┼──────────┼─────────────────────────────────────────────────────────────────────┤
│ homebrew/core    │ aliyun   │ https://mirrors.aliyun.com/homebrew/homebrew-core.git               │
├──────────────────┼──────────┼─────────────────────────────────────────────────────────────────────┤
│ homebrew/cask    │ tsinghua │ https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git │
├──────────────────┼──────────┼─────────────────────────────────────────────────────────────────────┤
│ homebrew/bottles │ aliyun   │ https://mirrors.aliyun.com/homebrew/homebrew-bottles                │
└──────────────────┴──────────┴─────────────────────────────────────────────────────────────────────┘

Auto install dependencies

$ brm
[BRM][WARN] Missing dependency - Homebrew
? Press <Enter> to install Homebrew? Yes

Test mirror speed

$ brm test aliyun
[BRM] Testing speed of aliyun...
aliyun ------------------------ 10 ms
$ brm test
[BRM] Testing speed of official, tsinghua, aliyun, ustc...
aliyun ------------------------ 18 ms
tsinghua ---------------------- 33 ms
ustc -------------------------- 45 ms
official ---------------------- timeout

Package Sidebar

Install

npm i homebrew-brm

Weekly Downloads

1

Version

1.2.5

License

MIT

Unpacked Size

421 kB

Total Files

17

Last publish

Collaborators

  • vincent0700