必须安装受支持的浏览器(Chrome、Brave、Edge 或 Ungoogled Chromium)并装好 iCloud Passwords 扩展,否则无法工作;守护进程每次启动(如开机)都要重新执行 apw auth 配对;浏览器以无头模式在后台运行,运行期间基本无法用它正常上网,建议单独装一个专用浏览器。
brew install bendews/homebrew-tap/apw
brew services start apw
apw auth需要 macOS 14 及以上系统;README 未提及 GPU 或显存要求,与硬件无关。
在 macOS 上通过命令行读取 iCloud 钥匙串密码和 OTP 验证码,方便脚本集成与自动化
在终端里直接读写 Apple 密码(iCloud 钥匙串)的命令行工具,适合脚本化查询和导出密码,省去手动打开图形界面的麻烦。
核心能力
- 借助 macOS 14 及以上内置的辅助工具访问 iCloud 密码
- 以守护进程方式常驻,支持 brew services 开机自启
- 支持交互式查询、JSON 输出、保存密码和获取 OTP
- 自动检测浏览器与 iCloud Passwords 扩展并后台无头启动
- 提供 Raycast 扩展和 LaunchBar action 等现成集成
容易踩的坑
- v1.1.1最新正式版2026-07-30 · 2026-07-30 10:48 UTC
这个版本没有写更新说明。
- v1.1.02026-07-28 · 2026-07-28 08:57 UTC
查看更新说明
New
- Now works again in all MacOS versions 14 and newer 🥳🎉
- Browser requirement - apw now requires a chromium-based browser with the iCloud Passwords extenstion to be installed prior to running.
- Save passwords - apw pw save creates or updates a password entry; accepts password via stdin (--stdin) for scripting and integration use
- Table & JSON output - table view is default for interactive usage, JSON is default for programmatic. Either can be used via cmdline options.
- v1.0.22025-10-16 · 2025-10-16 07:19 UTC
查看更新说明
What's Changed
- Fix TS2345 error on deno compile by @younggglcy in https://github.com/bendews/apw/pull/11
New Contributors
- @younggglcy made their first contribution in https://github.com/bendews/apw/pull/11
Full Changelog: https://github.com/bendews/apw/compare/v1.0.1...v1.0.2
- v1.0.12024-10-14 · 2024-10-14 11:07 UTC
这个版本没有写更新说明。
- v1.0.02024-09-30 · 2024-09-30 09:11 UTC
这个版本没有写更新说明。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
About The Project
This project introduces a CLI interface designed to access iCloud passwords and OTP tokens. The core objective is to provide a secure and straightforward way to retrieve iCloud passwords, facilitating integration with other systems or for personal convenience.
It utilises a built in helper tool in macOS 14 and above to facilitate this functionality.
https://github.com/user-attachments/assets/8cb45571-d164-4e28-aa6e-64d27705d6d2
Getting Started
APW requires a supported browser with the iCloud Passwords extension installed:
- Ungoogled Chromium:
brew install --cask ungoogled-chromium - or Google Chrome:
brew install --cask google-chrome - or Brave Browser:
brew install --cask brave-browser - or Microsoft Edge:
brew install --cask microsoft-edge
Link to iCloud Passwords Extension: Link
Note: The browser is launched headlessly in the background. It will generally not be usable for regular browsing while
apwis running. Installing one of the above as a dedicated secondary browser is recommended.
Quick Start
1. Install APW
brew install bendews/homebrew-tap/apw
2. Start the daemon
APW will detect the browser and extension automatically. To start at login:
brew services start apw
3. Authenticate
This step is required every time the daemon starts (e.g. on boot):
apw auth
A native macOS popup with a PIN will appear. Enter it when prompted to complete pairing.
APW is now running and ready to use.
Integrations
The following integrations provide quick access to passwords and OTP tokens:
- Raycast extension automatically retrieves entries for the currently active webpage and enters them.
- LaunchBar action finds entries for a typed domain and pastes the selected entry.
The following are some future integration ideas:
- SSH Agent to allow storing and using SSH keys/passwords
- Additional wrappers for CLI tools and services
Usage
Ensure the daemon is running (apw start or brew services start apw) and authenticated (apw auth).
Start with a specific browser without the interactive prompt, selections will be persisted:
apw start --browser chrome
Query for available passwords (Interactive):
apw pw
Query for available passwords (JSON output):
apw pw list google.com
Create or update a password (the command prompts for the password):
apw pw save google.com username
Retrieve a one-time code:
apw otp get google.com
View more commands & help:
apw --help
Options:
-h, --help - Show this help.
-V, --version - Show the version number for this program.
Commands:
auth - Authenticate CLI with daemon.
pw - Interactively list or save accounts/passwords.
otp - Interactively list accounts/OTPs.
start - Start the daemon.
Building
This project uses Deno for development and compilation. Make sure you have Deno installed on your system before proceeding.
Running the Project
To run the project whilst developing:
deno task dev <OPTIONS>
Building a release version
To build a statically compiled binary:
deno task compile
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the GPL V3.0 License. See LICENSE for more information.