# 使用 Homebrew, MacPorts, Nix 安装 duti

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

## 安装

```sh
sudo av install brew:duti
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install duti
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install duti
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#duti
```

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

## 软件包事实

- **软件包键:** brew:duti
- **软件包管理器:** Homebrew
- **版本:** 1.5.4
- **来源摘要:** Select default apps for documents and URL schemes on macOS
- **主页:** <https://github.com/moretension/duti/>
- **仓库:** <https://github.com/moretension/duti>
- **最后更新:** 2026-08-02T15:56:45+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- duti (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

duti is a macOS command-line utility for setting default applications for document types, URL schemes, extensions, and MIME types. It is one of those small macOS plumbing tools that became package-manager-relevant because Apple exposes the concept through Launch Services and UTIs but not through a friendly shell command.

### 项目历史

The README says duti was originally released into the public domain by Andrew Mortensen in 2008. The current GitHub repository was created in September 2012 and hosts the README, man page, and tagged releases.

The tool is built around Apple's Uniform Type Identifiers and related handler metadata. It can read settings from stdin, a settings file, an XML plist, or command-line arguments, making it easy to script default-app policy on macOS.

### 采用历史

duti's adoption is mostly in macOS automation circles: users install it through package managers or build it from source, then use it in setup scripts to make browser, editor, document, and URL-scheme defaults reproducible. The README also labels the project unsupported, which makes its persistence in package managers part of its history.

### 使用方式

The man page documents `duti -s` for setting handlers, `duti -x` for printing the default app for an extension, and file/plist input for bulk settings. A settings file contains bundle ID, UTI or URL scheme, and role fields such as viewer, editor, shell, all, or none.

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

duti matters because macOS developer machines are often rebuilt from scripts, and default application bindings are otherwise awkward to automate. It gives Homebrew/MacPorts/Nix users a small, scriptable bridge into Apple's UTI and handler database.

### 时间线

- 2008: README says duti was originally released into the public domain.
- 2012-09-25: GitHub repository created.
- 2018-04: README license note dated April 2018.
- 2023-07-09: GitHub repository last pushed according to the GitHub API snapshot.

### Related projects

- The README links `dutis` as an interactive wrapper around duti. Conceptually, duti also sits next to macOS Launch Services tooling and Apple's UTI documentation.

### 来源

- <https://github.com/moretension/duti>
- <https://github.com/moretension/duti/blob/master/duti.1>
- <https://api.github.com/repos/moretension/duti>


## 安全说明

narrow executable package without higher-risk signals.

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

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

- Nix - duti: normalized package name match | nixpkgs package indexes: pkgs/by-name/du/duti/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - duti: normalized package name match | MacPorts ports tree: sysutils/duti/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/duti.yml](https://github.com/mxcl/pkgdb/blob/main/combined/duti.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
