# Install defaultbrowser with Homebrew, MacPorts, Nix

Command-line tool for getting & setting the default browser. Version 1.1 via Homebrew; verified from local package data. Also installable with nix: nix profile install nixpkgs#defaultbrowser.

## Install

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

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install defaultbrowser
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install defaultbrowser
```

  Evidence: 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
```

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

## Package facts

- **Package key:** brew:defaultbrowser
- **Package manager:** Homebrew
- **Version:** 1.1
- **Source summary:** Command-line tool for getting & setting the default browser
- **Homepage:** <https://github.com/kerma/defaultbrowser>
- **Repository:** <https://github.com/kerma/defaultbrowser>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- defaultbrowser (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 1.1
## Project history and usage

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

### Project history

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.

### Adoption history

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.

### How it is used

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.

### Why package nerds care

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.

### Timeline

- 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.

### Sources

- <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>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Other Package-Manager Records

- 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)


## Sources

- 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
