# 使用 Homebrew, MacPorts, Nix 安装 defaultbrowser

查看 defaultbrowser 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:defaultbrowser
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install defaultbrowser
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install defaultbrowser
```

  证据: MacPorts ports tree: sysutils/defaultbrowser/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#defaultbrowser
```

  证据: nixpkgs package indexes: pkgs/by-name/de/defaultbrowser/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:defaultbrowser
- **软件包管理器:** Homebrew
- **版本:** 1.1
- **来源摘要:** Command-line tool for getting & setting the default browser
- **主页:** <https://github.com/kerma/defaultbrowser>
- **仓库:** <https://github.com/kerma/defaultbrowser>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- defaultbrowser (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.1
## 项目历史与用法

defaultbrowser is a small macOS command-line utility for listing and changing the system default web browser, specifically the HTTP handler.

### 项目历史

The README presents defaultbrowser as a macOS X tool built around the macOS Launch Services API. Its scope is intentionally narrow: run without arguments to list browser handlers and run with a browser identifier to set the default.

The repository has tagged commits for v1.0 in 2017 and 1.1 in 2018, matching the tool's stable, low-churn nature.

### 采用历史

defaultbrowser is packaged by Homebrew, which fits its audience: Mac users and automation scripts that need a terminal-friendly way to change a desktop preference normally managed through system settings.

### 使用方式

The common usage is direct and scriptable: `defaultbrowser` shows available HTTP handlers and the current default, while commands such as `defaultbrowser chrome` set the default browser.

### 为什么软件包爱好者会关心

defaultbrowser is a classic package-manager utility because it wraps a platform preference in one tiny CLI. It is useful in dotfiles, setup scripts, and fleet/bootstrap workflows where opening a GUI preferences pane would be the wrong interface.

### 时间线

- 2017: v1.0 tagged commit.
- 2018: 1.1 tagged commit.
- 2026: Homebrew continues to publish the formula.

### Related projects

- The README points to the macOS Launch Services API as the underlying platform facility and to a separate bash-completion project for shell integration.

### 来源

- <https://github.com/kerma/defaultbrowser>
- <https://github.com/kerma/defaultbrowser/commit/8d77a3caf7ac52226608fa30a8ce02549782465d>
- <https://github.com/kerma/defaultbrowser/commit/dba87e7d8764ea24502d27da7a4c80c3475b4f25>
- <https://formulae.brew.sh/formula/defaultbrowser>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Nix - defaultbrowser: normalized package name match | nixpkgs package indexes: pkgs/by-name/de/defaultbrowser/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - defaultbrowser: normalized package name match | MacPorts ports tree: sysutils/defaultbrowser/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/defaultbrowser.yml](https://github.com/mxcl/pkgdb/blob/main/combined/defaultbrowser.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
