apwcli-pair
Skill3 starsChanged yesterdayMITView on GitHub
Pair apwcli's daemon with Apple Passwords (iCloud Keychain) with nobody at the screen, by reading the macOS 6-digit PIN through Accessibility and submitting it. Use when apwcli says "session is not paired" or "pairing cancelled", after a Mac reboots or logs out, or to pair a fleet Mac over ssh.
In this repository31 other files it gives its agents.
- affix-domainsSkill
- apple-designSkill
- ask-always-on-agentSkill
- asus-esc8000-firmware-upgradeSkill
- asus-esc8000-gpu-bios-tuningSkill
- build-stealth-rustdeskSkill
- chrome-cdp-setupSkill
- cua-macos-lume-sandboxSkill
- deploy-kimi-k26-on-rtx-pro-6000Skill
- deploy-kimi-k3-on-rtx-pro-6000Skill
- deploy-stealth-rustdeskSkill
- ghostty-terminfoSkill
- herdr-rename-hookSkill
- imsg-permissionsSkill
- llm-inference-benchmarkSkill
- lxd-docker-firewall-conflictSkill
- mac-mini-as-headless-serverSkill
- macos-app-multi-instancesSkill
- macos-smb-serverSkill
- mac-smb-automountSkill
- openclaw-diagnoseSkill
- paseo-profilesSkill
- private-fork-syncSkill
- refresh-claude-accountSkill
- ssh-claude-authSkill
- sync-claude-accountsSkill
- to-featuresSkill
- trusted-publishSkill
- ubuntu-lxd-gpu-serverSkill
- ubuntu-nvidia-gpu-enablementSkill
- ubuntu-zfs-mirror-installSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
When exit 3 persists on an unlocked, granted host, read the PIN another way and submit it by hand: apwcli daemon pair --pin <digits> right …
- Very specific: line 62
If Apple moves it, dump the window with osascript -e 'tell application "System Events" to tell process …
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
apwcli-pair
apwcli's daemon pairs with Apple's password helper once per login session. Pairing shows a 6-digit PIN in a macOS window, "Verification Code", that a person normally reads and types. This script reads it through Accessibility and submits it, so no one needs to be at the screen.
Commands
# on the Mac itself
~/.agents/skills/apwcli-pair/scripts/apwcli-pair
# another fleet Mac, from anywhere
ssh -o BatchMode=yes -o ConnectTimeout=15 <host> 'zsh -lc ~/.agents/skills/apwcli-pair/scripts/apwcli-pair'A paired host prints already paired and exits 0, so the command is safe to repeat. Check the
result with apwcli pw get github.com, not with apwcli daemon status: its pairing line reads
"not paired" for a few seconds while a challenge is open even when the session works.
| Exit | Meaning | Do |
| 0 | paired or already paired | carry on |
| 1 | the helper rejected the PIN | run it again; a second failure means a stale window, so apwcli daemon restart first |
| 2 | apwcli error (no daemon, no browser) | run apwcli doctor on that host |
| 3 | no PIN visible within 15 s | see preconditions; then the fallback |
Preconditions
- apwcli installed: the
apwclirole of macbook-provision does it (uv tool install apwcli), with Google Chrome present for the daemon's headless browser. - The Mac is logged in and unlocked. A locked screen hides windows from Accessibility.
The process that runs the script has Accessibility. Over ssh that is
/usr/libexec/sshd-keygen-wrapper; in a terminal it is the terminal app. Check before blaming the script (query from~/.agents/docs/macos-tcc.md):sqlite3 -readonly '/Library/Application Support/com.apple.TCC/TCC.db' \ "select client, auth_value from access where service='kTCCServiceAccessibility' and client like '%sshd%'"2means allowed. Granting it needs a person once; on 2026-10-28 every fleet Mac with apwcli already had it (mac-mini-m6, mac-mini-m2, archs-mac-mini, dev-server-frank-lume, macbook-pro-m3).
Fallback
When exit 3 persists on an unlocked, granted host, read the PIN another way and submit it by
hand: apwcli daemon pair --pin <digits> right after the window appears, or ask Frank for the
digits. A screenshot over ssh needs Screen Recording for sshd, which only mac-mini-m2 has.
Notes
- Pairing lasts for the login session. Rerun after a reboot. The daemon needs no restart.
- The PIN is single-use and is printed only with
--verbose. scripts/apwcli-pair --selftestchecks the digit parser without touching apwcli.- Measured on macOS 26: the PIN is the one static text in
group 1of the window, as "123 456". If Apple moves it, dump the window withosascript -e 'tell application "System Events" to tell process "PasswordManagerBrowserExtensionHelper" to get entire contents of window 1'and fix_PIN_QUERYinscripts/pair.py.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

