# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix 安装 hstr

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

## 安装

```sh
sudo av install brew:hstr
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install hstr
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install hstr
```

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

### Linux

- apk (92%):

```sh
sudo apk add hstr
```

  证据: Alpine Linux edge package indexes: hstr from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install hstr
```

  证据: Debian stable package indexes: hstr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install hstr
```

  证据: Fedora Rawhide package metadata: hstr from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#hstr
```

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

## 软件包事实

- **软件包键:** brew:hstr
- **软件包管理器:** Homebrew
- **版本:** 3.2
- **来源摘要:** Bash and zsh history suggest box
- **主页:** <https://github.com/dvorka-oss/hstr>
- **仓库:** <https://github.com/dvorka-oss/hstr>
- **最后更新:** 2026-07-28T13:41:32+09:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- hh (别名)
- hstr (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

HSTR is a terminal user-interface for viewing, searching, curating, and reusing bash and zsh command history, with the hh command as a common shortcut.

### 项目历史

The README expands HSTR as HiSToRy and presents it as a more efficient alternative to Ctrl-r for shell history completion. It combines search, navigation, deletion of sensitive or obsolete commands, and bookmarking of favorite commands.

The project evolved into a broadly packaged shell productivity tool, with documentation for bash and zsh bindings, aliases, environment-driven configuration, blacklist behavior, color and layout settings, and shell-history tuning.

### 采用历史

The README lists installation documentation for many distributions and package systems, including Ubuntu, Debian, Fedora, CentOS, openSUSE, Gentoo, Alpine, Arch, FreeBSD, Slackware, Void, Haiku, macOS, Nix, Guix, and others. The input metadata also records packages in Alpine, Homebrew, Debian, Fedora, MacPorts, Nix, and Ubuntu.

The project page collects coverage from Linux Magazine, UbuntuGeek, DebianAdmin, Tuxdiary, Softpedia, OSTechNix, videos, and community posts, which fits its role as a discoverable shell workflow enhancer.

### 使用方式

Users typically add generated bash or zsh configuration to ~/.bashrc or ~/.zshrc, bind HSTR to a key such as Ctrl-r, and optionally define alias hh=hstr.

Configuration is intentionally shell-native: HSTR reads HISTFILE, HSTR_PROMPT, HSTR_IS_SUBSHELL, and HSTR_CONFIG, with options for color, prompt placement, matching mode, duplicate handling, favorites, and blacklists.

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

HSTR is significant in package-manager culture because it is a shell-history tool that crosses the boundary between a packaged executable and user dotfile integration. A package can install the binary, but value comes when the user wires it into readline or zsh keybindings.

It is also one of the better-known examples in the family of TUI shell-history searchers, alongside tools such as fzf-based history widgets and newer history managers.

### 时间线

- 0.2: Early upstream tag appears in the repository.
- 1.x: The project accumulated a long sequence of tagged releases.
- 2.x: Later tags continued the shell-history TUI series.
- 3.x: The v3.2 tag appears after the 3.0 and 3.1 tags.

### Related projects

- Related projects include bash, zsh, readline, fzf history bindings, shell history managers, and terminal bookmark or snippet workflows.

### 来源

- <https://github.com/dvorka-oss/hstr>
- <https://github.com/dvorka-oss/hstr/blob/master/CONFIGURATION.md>
- <https://github.com/dvorka-oss/hstr/blob/master/TIPS.md>
- <https://github.com/dvorka-oss/hstr/releases>


## 安全说明

narrow executable package without higher-risk signals.

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


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.bashrc, ~/.zshrc, ~/.hstr_blacklist
## 其他软件包管理器记录

- Debian apt - hstr - 3.1+ds-1+b1: normalized package name match | Debian stable package indexes: hstr from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Suggest box like shell history completion | https://github.com/dvorka/hstr
- Nix - hstr: normalized package name match | nixpkgs package indexes: pkgs/by-name/hs/hstr/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - hstr - 3.1+ds-1build2: normalized package name match | Ubuntu 24.04 LTS package indexes: hstr from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Suggest box like shell history completion | https://github.com/dvorka/hstr
- apk - hstr - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: hstr from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash and ZSH shell history suggest box | https://github.com/dvorka/hstr
- apk - hstr-bash-completion - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: hstr-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash completions for hstr | https://github.com/dvorka/hstr
- apk - hstr-doc - 3.2-r0: normalized package name match | Alpine Linux edge package indexes: hstr-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Bash and ZSH shell history suggest box (documentation) | https://github.com/dvorka/hstr
- dnf - hstr - 3.1-8.fc45: normalized package name match | Fedora Rawhide package metadata: hstr from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Suggest box like shell history completion | https://github.com/dvorka/hstr
- MacPorts - hstr: normalized package name match | MacPorts ports tree: shells/hstr/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/hstr.yml](https://github.com/mxcl/pkgdb/blob/main/combined/hstr.yml)


## 来源

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