# 使用 Homebrew 安装 batt

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

## 安装

```sh
sudo av install brew:batt
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install batt
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:batt
- **软件包管理器:** Homebrew
- **版本:** 0.8.0
- **来源摘要:** Control and limit battery charging on Apple Silicon MacBooks
- **主页:** <https://github.com/charlie0129/batt>
- **仓库:** <https://github.com/charlie0129/batt>
- **最后更新:** 2026-07-21T07:10:34Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- batt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

batt is a macOS utility for controlling and limiting battery charging on Apple Silicon MacBooks, available as a command-line daemon/client and a native menu-bar app.

### 项目历史

The README states the maintainer created batt because existing tools were unsatisfactory. It focuses on predictable charge limiting, with the common use case of stopping charge around a configured maximum such as 80 percent.

batt's design is intentionally daemon-based: the README compares it to docker, with a client sending requirements to a background daemon that performs the charging control.

By 2026, the README notes a changed platform landscape: macOS 26.4 and later supports native charge limiting from 80 to 100 percent, while batt remains useful on older macOS versions or when users want limits below 80 percent.

### 采用历史

batt is Homebrew-packaged and its README documents `brew install batt` followed by running it as a brew service. It also offers an installation script and release binaries.

The repository page showed about 1.6k stars at enrichment time, reflecting a niche but visible Apple Silicon power-user audience.

### 使用方式

Typical CLI usage is to install the daemon, check status with `sudo batt status`, set an upper charge limit with commands such as `sudo batt limit 80`, disable the limit with `batt disable` or `batt limit 100`, and optionally control adapter power.

Advanced usage includes lower and upper charge bands, MagSafe LED control, idle/sleep handling, automatic calibration, scheduled calibration, and logs under `/tmp/batt.log`.

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

batt is interesting because it is a package-manager-distributed hardware-control tool that depends on private-feeling macOS power behavior and firmware compatibility rather than a stable cross-platform Unix API.

It also captures a packaging moment: before native macOS charge limits became broader, power users installed a daemon through Homebrew to get ThinkPad-style charge thresholds on Apple Silicon MacBooks.

### 时间线

- 2025: v0.4.1 release highlights an experimental GUI and macOS Tahoe compatibility work.
- 2026: README update says macOS 26.4 adds native charge limiting, reducing batt's necessity for some users.
- 2026: v0.7.x releases include auto-calibration and scheduling work.

### Related projects

- The README links third-party GUI projects BattGUI and batt-helper.
- macOS Optimized Battery Charging and macOS 26.4 native charge limiting are the platform features batt complements or replaces depending on OS version.

### 来源

- <https://github.com/charlie0129/batt>
- <https://github.com/charlie0129/batt/releases>
- source_facts.package-manager


## 安全说明

formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- formula declares a Homebrew service


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

- macOS: /opt/homebrew/etc/batt.json, /etc/batt*

## Combined YAML source

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


## 来源

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