Catalog npm
PACKAGE EXPLORERView in registry

2famsg

npm

Retrieves 2FA codes from Apple Messages

Versions collected8
Direct dependencies18From release 0.2.5
Last observed20 Oct, 19:13 UTC

README

Current package documentation

2famsg

npm npm License: MIT Twitter: @selfagency_llc

Retrieve 2FA codes from Apple Messages on MacOS as JSON output with CLI or API

Installation

npm install -g 2famsg || yarn global add 2famsg

CLI Usage

2famsg [-a | --alfred] [-d | --database DATABASE_PATH] [-q | --query QUERY_TERM]

Also available via npx but loads much more slowly.

CLI Options

  • -a or --alfred [Boolean]: Format output for Alfred
  • -d or --database [String]: Specify database path (Default: ~/Library/Messages/chat.db)
  • -q or --query [String]: Term by which to filter results (eg., facebook or amazon)

Node Module Usage

const twoFactorMsg = require('2famsg')
const codes = async () =>
  await twoFactorMsg({
    query: 'facebook'
  })

Module Options

  • alfred [Boolean]: Format output for Alfred
  • database [String]: Specify database path (Default: ~/Library/Messages/chat.db)
  • query [String]: Term by which to filter results (eg., facebook or amazon)

Build Binaries

npm run build:sqlite
npm run build:bin

Author

👤 Daniel Sieradski hello@self.agency

Acknowledgements

The SQLite query was lifted from Scott Carpenter's alfred-imessage-2fa Alfred workflow, which I modified somewhat. Scott's project was a great start but I was looking for a more robust solution and decided to build one in a language in which I felt more comfortable jamming on the code.

Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 8

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.5Registry latest27 May 202018
0.2.427 May 202018
0.2.326 May 202018
0.2.26 May 202018
0.2.16 May 202018
0.2.06 May 202018
0.1.15 May 202015
0.1.05 May 202015

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

ACCESSIBLE
selfagency/2famsg

Shared repository data · GitLab

License detected in repository
Not collected
Contributor identities
1 · complete API traversal
Contributors · showing 1 of 1 collected
ContributorContributions
Daniel Sieradski21

Default-branch author identities; GitLab commit counts exclude merge commits.

Public sponsor counts have not been collected. These signals belong to the repository owner.

Downloads & popularity

1identities
Gauge · observed snapshots22 Oct 2026
10.50
2026-10-20: 1 · observed 2026-10-20T19:27:02.0182837Z2026-10-21: 1 · observed 2026-10-21T19:27:40.2277210Z2026-10-22: 1 · observed 2026-10-22T19:28:38.4246554Z
20 Oct22 Oct

gitlab · 3 observations shown. Missing days are unknown.

View observed values
Date / source periodValueObserved at
2026-10-2212026-10-22T19:28:38.4246554Z
2026-10-2112026-10-21T19:27:40.2277210Z
2026-10-2012026-10-20T19:27:02.0182837Z

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ea467a3a509bc494a0c9523045b307bc06d69e190be4b923d9490599b068141f