git clone https://github.com/bitriddler/messenger-cli
cd messenger-cli
npm install
- Install
messenger-cli
- Copy
.env-sample
to.env
and setFB_EMAIL
your login emailFB_PASSWORD
your login passwordNICK_NAMES
comma separated nick names you go with in chats. This will be used to render "Me:" instead of your chat name.
- Run
npm start
to start the server - Open another terminal and go to the
messenger-cli
directory to have access to the following commands:
Show a list of the last ~20 users you have chatted with.
npm run cli -- --command=visible-users
This will show you a list of visible users then ask you to enter either the user id or the number of the user in the list
npm run cli -- --command=start-session
This will return the visible messages with the current user
npm run cli -- --command=get-session
This will send a message to the current chat
npm run cli -- --command=send-session "your message goes here"
- Start chat with a user
- Send a message
- Get chat messages
npm run cli -- --command=start-session
# When prompted, enter user id or number of user in the list
npm run cli -- --command=send-message "your message"
npm run cli -- --command=get-session
...
Copy and paste this in your terminal
alias fv="npm run cli -- --command=visible-users"
alias fss="npm run cli -- --command=start-session"
alias fs="npm run cli -- --command=send-session"
alias fg="npm run cli -- --command=get-session"
Now you can run the above scenario as follows:
fss
# When prompted, enter user id or number of user in the list
fs your message in here
fg
...
I created this repository just for fun and there are a lot of limitations you have to know:
- Only a few emojis will render, the rest will just show :unkown_emoji:
- Images or any other attachments are ignored