Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vincent0700/homebrew-brm

📦 Homebrew registry manager for macOS, fast switch between different registries: official, tsinghua, aliyun, ustc
https://github.com/vincent0700/homebrew-brm

homebrew manager registry

Last synced: about 1 month ago
JSON representation

📦 Homebrew registry manager for macOS, fast switch between different registries: official, tsinghua, aliyun, ustc

Awesome Lists containing this project

README

        

# BRM (Homebrew Registry Manager)

[![NPM](https://nodei.co/npm/homebrew-brm.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/homebrew-brm)

[![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/vincent0700/homebrew-brm/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/v/homebrew-brm.svg)](https://www.npmjs.com/package/homebrew-brm)
[![npm](https://img.shields.io/npm/dm/homebrew-brm.svg)](https://www.npmjs.com/package/homebrew-brm)

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

![](./assets/demo.gif)

## Install

```bash
$ 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 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 to select, to toggle all, 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 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
```