| name | aside-apple-passwords |
| description | Use Apple Passwords on macOS when the user asks for Apple/iCloud passwords, OTPs, or autofill from Apple's Passwords app. |
| metadata | {"version":"0.1.0"} |
Apple Passwords
Use the applePasswords global in the REPL to read or autofill credentials from Apple's Passwords app on macOS.
Critical Touch ID Rule
Before calling getPasswords, getOtps, or autofillLogin, notify the user first with the notification tool.
These calls can trigger a macOS Touch ID / Apple Passwords auth prompt and will not return until the user approves or cancels it.
Never ask the user to reveal a password, OTP seed, recovery code, or Touch ID result. Prefer autofillLogin when signing in because it fills the secret without printing it.
Quick Reference
console.log(await applePasswords.capabilities());
await applePasswords.requestAuth();
await applePasswords.verifyAuth('<pin>');
console.log(await applePasswords.listLogins('https://example.com'));
const passwords = await applePasswords.getPasswords('https://example.com', 'me@example.com');
await applePasswords.autofillLogin(page, {
url: 'https://example.com',
username: 'me@example.com',
usernameField: 'e12',
passwordField: 'e13',
submit: true,
});
console.log(await applePasswords.getOtps('https://example.com'));
Method Contract
declare global {
const applePasswords: ApplePasswordsApi;
}
interface ApplePasswordsApi {
capabilities(): Promise<Record<string, unknown>>;
requestAuth(): Promise<{ status: 'auth-requested'; instruction: string }>;
verifyAuth(pin: string): Promise<{ status: 'authenticated' }>;
listLogins(url: string): Promise<Array<{ username: string; domains: string[] }>>;
getPasswords(url: string, username?: string): Promise<Array<{ username: string; domain: string; password: string }>>;
getOtps(url: string): Promise<Array<{ username: string; : ; : ; ?: }>>;
(: , ?: {
?: ;
?: ;
?: ;
?: ;
?: ;
}): <{ : ; : ; : ; : }>;
}
Selection Rules
- Use
listLogins(url) first when account choice is unclear.
- If multiple logins match, choose by visible site/account context; ask the user only when genuinely ambiguous.
- Do not print passwords unless the user explicitly asked to retrieve/show the password. For login tasks, call
autofillLogin.
- If
autofillLogin cannot find fields automatically, take a fresh snapshot() and pass usernameField / passwordField refs.