💬 Command-line messaging for Facebook Messenger
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.



Command-line Messaging for Facebook Messenger

Downloads Version License


npm install -g messer

Quick Start

  1. Install messer
  2. Run messer
    $ messer
  3. Enter your details
  4. ...
  5. Profit

For a list of commands, jump to the Commands Reference


2-Factor Authentication

  1. Start Messer and wait for "Enter Code" prompt

  2. Enter a 2FA code generated from your 2FA app

    If at this point the login fails, go to Facebook and check for an "Unrecognised browser" notification

  3. Approve the browser/device (i.e. approve Messer)

  4. Retry from Step 1

After you've successfully logged in, an appstate.json file is created which should allow you to skip this process every time you log in. If you wish to "start over", just delete that file.

This should™ work! Please let us know if it doesn't: we've had a number of issues with it in the past.

Commands Reference


Sends a message to a given user

(message | m) "<user>" <message>


  • message "Matthew" hello world!
  • m "Matthew" hello world!

When sending a message, Messer picks the closest match to what you type in as user. For this reason, you should probably use last names if you want to avoid accidentally texting someone.


Replys to the last message you recevied i.e. Sends a message to the user of the most recently received message.

(reply | r) <message>


  • r "hey yo this is my reply"

Note: this will only work if you have received at least one message through Messer.


Lists all of your Facebook friends



Displays the last n messages in the conversation with a given user. The number of messages to retrieve are optional (default is 5).

(history | h] "<user>" [<numMessages>]


  • history "Matthew" 10
  • h "Matthew"


Displays the n most recent conversations. The number of threads is optional (default is 5).

recent [<numThreads>]


  • history "Matthew" 10
  • h "Matthew"


Clears the number of unread messages in the window title. Since we cannot listen on focus events, it has to be done manually.

(clear | c)


Logs you out


Non-interactive Mode

Messer can be run in non-interactive mode with command line arguments to execute a single command.

messer --command='[command]'

Login will be prompted if this is the first time logging in.


  • messer --command='m "John Smith" Hey, John'
  • messer --command='r Hey, John'


Group Chats

Messages from group chats appear like

(My cool friends) John Smith - hey guys!!$$@@

Send a message to a group by using the message command. The name is the name of the group chat! Reply works as normal


Take a look in Issues for things to contribute to. Only PR's that reference an issue will be considered. If you have a feature idea, submit an issue so it can be discussed!

Before you submit your PR, ask yourself...

  1. Does this PR resolve a particular issue? (if not, then why is this PR necessary)?

  2. Have I written tests? (where appropriate)

  3. Have I made sure the tests pass?

npm test