This simple node script watches for changes to the iMessage database, and if it detects a new 2-factor code, will copy it into your clipboard.
Usage:
git clone git@github.com:mikeyk/node-imessage-codes.git
npm install
node index.mjs
- If you hit an error with the script opening the SQLite file, please enable Full Disk Access for Terminal/iTerm in your Settings. Thanks to Julian Liederer for the pointer.