FBCMD: Command Line for Facebook

What's better than the command line and Facebook? How about combining the two?

Just because you’re stuck at the command line all day long doesn’t mean that you can’t participate in the awesomeness of social networking. You can enjoy both with FBCMD, the command line Facebook applications. Back in February, I wrote Tweeting from the Command Line with Twyt, which, as you remember, was an article covering the command line Twitter client, Tywt. Now, you can have your Facebook and the convenience of the command line to satisfy your social networking addiction. And, better still is that at the command line, no one will ever suspect that you’re Facebooking. Power to the people! The command line-using people, that is.

The Basics

There are a few prerequisites for installing the command line Facebook application, FBCMD. PHP 5.x is a requirement, since the application is a single PHP file. You can install php5 via any method you wish but, in my experience, I had to install php5-cli, php5-gd, and php5-mysql to use this application. Your experience and mileage may vary.

Connect to the FBCMD and download the PHP file or grab it easily via curl.

$ curl -O https://github.com/dtompkins/fbcmd/raw/master/fbcmd_update.php

And, run the following two commands to complete this very simple installation.

$ sudo php fbcmd_update.php sudo

fbcmd update utility [version 2.91]


php fbcmd_update.php install

fbcmd update utility [version 2.91]




fbcmd version: [none] --> [1.0-beta5-dev1]

Note: fbcmd_update.php is now at [/usr/local/lib/fbcmd/fbcmd_update.php]
so you can remove the old one at [/home/khess/fbcmd_update.php]

type fbcmd to begin

As the prompt suggests, type fbcmd and see what happens.

$ fbcmd

Welcome to fbcmd! [version 1.0-beta5-dev1]

This application needs to be authorized to access your facebook account.

Step 1: Allow basic (initial) access to your acount via this url:


to launch this page, execute: fbcmd go access

Step 2: Generate an offline authorization code at this url:


to launch this page, execute: fbcmd go auth

obtain your authorization code (XXXXXX) and then execute: fbcmd auth XXXXXX

These messages explain the steps you need to take next to grant FBCMD access to your Facebook information.

Making the Facebook Connection

Perform the following connections from a Linux desktop system because some of these commands use Firefox (or your default browser) to initiate the connections and setup the application. Open a Terminal and type in the following commands.

fbcmd go access

Your Internet browser will open to Facebook and prompt you for login. If you see a link that reads, “Login with Command Line” or something similar, select that link and login to Facebook. If you don’t see that link, login to Facebook the way you normally do. Return to your Terminal window and issue the following command:

$ fbcmd go access

This command prompts another connection to Facebook, where you should see a six character code that you’ll need for the next step.

fbcmd auth XXXXXX

fbcmd [v1.0-beta5-dev1] AUTH Code accepted.
Welcome to FBCMD, Kenneth Hess!

most FBCMD commands require additional permissions.
to grant default permissions, execute: fbcmd addperm

As instructed, issue the command in the message.

$ fbcmd addperm

launching: https://www.facebook.com/dialog/oauth?client_id=42463270450&redirect_uri=http://www.facebook.com/connect/login_success.html&scope=create_event,friends_about_me,friends_activities,friends_birthday,friends_checkins,friends_education_history,friends_events,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_online_presence,friends_photo_video_tags,friends_photos,friends_relationship_details,friends_relationships,friends_religion_politics,friends_status,friends_videos,friends_website,friends_work_history,manage_friendlists,manage_pages,offline_access,publish_checkins,publish_stream,read_friendlists,read_mailbox,read_requests,read_stream,rsvp_event,user_about_me,user_activities,user_birthday,user_checkins,user_education_history,user_events,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_online_presence,user_photo_video_tags,user_photos,user_relationship_details,user_relationships,user_religion_politics,user_status,user_videos,user_website,user_work_history

Your FBCMD to Facebook connection is now complete and you’re ready to use FBCMD. To test that assertion, try the following command to see the permissions you granted the application.

$ fbcmd showperm
PERMISSION                    GRANTED?
ads_management                0
create_event                  1
email                         0
friends_about_me              1
friends_activities            1
friends_birthday              1
friends_checkins              1
friends_education_history     1
friends_events                1
friends_groups                1
user_videos                   1
user_website                  1
user_work_history             1
xmpp_login                    0

A ’1′ means permission granted and a ’0′ means permission denied. You can change permissions at any time by issuing the addperm keyword and a permission. See the FBCMD Command Documentation for a complete listing of command keywords and syntax.


I can’t show you all of the FBCMD commands but I can show you a few of the fun ones. You can do almost anything with the command line interface that you can with the web interface. Your results may vary but generally speaking everything works pretty well. To see a list of your friends who are signed into Facebook, use fonline.

$ fbcmd fonline

Friend One		idle
Friend Two		idle
Friend Three	        idle
Friend Four		idle
Friend Five		active
Friend Six		active
Friend Seven	        active

To see a list of messages that your friends have posted to your wall, use mywall.

$ fbcmd mywall
[#]  NAME          MESSAGE

[1]  Friend One  Hi , Hope you are good

You can read your Facebook messages with the inbox keyword.

$ fbcmd inbox
[#]   FIELD     VALUE

[1]   subject   [Hello]
      :to/from  Friend Four
      :snippet  Hi, what's up?

To check those annoying event invitations that people send you, use events.

$ fbcmd events
[#]  START_TIME        RSVP         EVENT
[1]  Wed May 25 02:00  not_replied  Towel Day - Celebrating Douglas Adams
[2]  Sat Jul 16 10:00  declined     William Bernhardt Small-Group Seminar
									(Level 3)

And, last but not least, you can update your status. You wouldn’t want anyone to miss any aspect of your fascinating existence or your latest video game scores.

$ fbcmd post "This is a test post from FBCMD"

If you’re a PHP programmer, I suggest that you expand and extend this application by contacting the primary developer. See the Contribute page for more information.

For those of you who love to use Facebook, you’re sure to love an easy to install, easy to use command line Facebook application like FBCMD. FBCMD has a lot of potential as an evolving command line application that I hope someone incorporates into a repository so that it’s even easier to install for those who don’t like to install applications. Those of us who like a challenge are in the minority. Most people just want something that works and works without hassle or strain. Make it so, Linux fans.

Comments on "FBCMD: Command Line for Facebook"


This kind of stuff is so, so wrong. What a step back.

Facebook may not be the prettiest of websites but it’s functional. Switching back to some offline application, especially one in a bloomin’ terminal is a huge, huge step backwards. This will slow our Facebook “productivity” if anything. Enough said.

PS: No photos or videos are visible in a command line either, which is hilarious. Why would you take out so many important parts of Facebook to make yourself a massive geek who is actually less “productive” with the website? This just makes the experience less social. Disgusting.


Evropi, I think this may have been designed as an extension which allows FB access for an app you may be writing. Let FBCMD maintain the API interface and just give/take the text provided to do something with FB. I don’t think anyone would use this as their direct access to the FB experience.

I could see using this to monitor my FB feed and streaming a banner on my television or monitor when an update occurs. Or, as part of a aggregator which updates FB, Twitter, etc.


This looks a interesting.

I have been learning to respect the power behind command line but having trouble wrapping my mind around this idea.

I Guess:

1. It could be used as a fun command line project showing some other usage for the command line. (something just for fun)

2. Maybe some folks have no other choice but command line say during work and would like to update their facebook (but most of us have other devices with us to do that, and your at work and, should not be doing facebook anyways, but hey that just me)

3. I could see Glinder’s idea could be useful.

Mostly i would have to agree with Evropi facebook was never meant for command line usage – its a rich media environment – This app is like inviting people to a command line 3d movie makes no sense but hey i don’t know how to program something like this so i cant down the creativity of it.

maybe the creator can give some more ideas or reasoning behind it


sudo php : command not found…..now what


Not getting connected to fbcmd after running this command:
$ sudo php fbcmd_update.php sudo

Output it shows is:

You are being redirected.


But i think many peoples wont wish to browse in command line


This is awesome! I just got a pertelian (http://www.pertelian.com/ ) and this is exactly what I was looking for. I can use this to throw data to my pertelian, and watch my facebook feed while doing other things on my computer.
As for those with the comments about this being a waste, or a step backwards: what do you think happens in your browser to give you all those pretty pictures and text and ads? Those are commands being run by your browser. Some of us like to know what is going on in the background, and because of that, you get to just use your mouse, and only need our keyboard to post comments.


    Yep its good to know whats going on..there is also those of us that want to build web apps that contact customers automatically…to inform them there ordered stock has come in…or their rented inventory is due back. So many people think this stuff is all about what it appears to be. Like everything is supposed to work like the photo on a cereal box. I have a life..i have a business..i don’t have time to sit around and bs all day and night with people on facebook. But I sure do like the idea of getting info to my customers when and where they are paying attention. It just cracks me up that anyone would bad mouth something so transparent and simple. Go back to your cubical and farmvill it up. We on the other hand will be using the Command line to send you a bill. Bam!


I have been browsing online greater than 3 hours as of late, but I never found any attention-grabbing article like yours. It?s beautiful value enough for me. Personally, if all webmasters and bloggers made just right content material as you did, the web will likely be much more helpful than ever before.


This is the programm for make the facebook, or this is the programm for edit….. the command line of facebook….. you can send e-mail to me…. from khmerlinuxboy


You are a great teacher. By far more helpful and knowledgeable than most of my professors in college.wood pellet mill


I don’t even know the way I stopped up here, but I thought this put up used to be good. I do not understand who you are but definitely you are going to a well-known blogger if you are not already. Cheers!


advertising and *********** with Adwords. Well I am including this RSS to my e-mail and could look out for much more of your respective fascinating content. Ensure that you update this again very soon..


I like the valuable information you provide in your articles. I will bookmark your weblog and take a look at once more here frequently. I’m reasonably certain I?ll be informed many new stuff right right here! Good luck for the following!


I used to be recommended this web site by means of my cousin. I am not sure whether this post is written by him as nobody else recognise such certain approximately my problem. You are wonderful! Thank you!


My brother suggested I might like this website. He was once totally right. This publish actually made my day. You cann’t believe just how much time I had spent for this information! Thanks!


I have been browsing on-line more than three hours nowadays, yet I by no means discovered any fascinating article like yours. It’s pretty worth sufficient for me. In my view, if all webmasters and bloggers made good content material as you did, the web will be much more useful than ever before.


Hi, Neat post. There is a problem along with your site in internet explorer, could test this? IE still is the marketplace leader and a huge element of other folks will leave out your great writing because of this problem.


I thought I would give those struggling to install and run this AWESOME app a guideline to what I did on my Ubuntu 11.10 machine.

$ sudo aptitude install php5-cli
$ sudo wget https://github.com/dtompkins/fbcmd/raw/master/fbcmd_update.php
$ cd fbcmd
$ sudo php fbcmd_update.php
$ sudo php fbcmd_update.php sudo
$ php fbcmd_update.php install
$ fbcmd
$ fbcmd go access //go to facebook
$ fbcmd go auth


I thought I would give those struggling to install and run this AWESOME app a guideline to what I did on my Ubuntu 11.10 machine.

$ sudo aptitude install php5-cli
$ sudo apt-get install curl
$ sudo apt-get install curl //git and curl installed if you are working on //rails
$ sudo wget https://github.com/dtompkins/fbcmd/raw/master/fbcmd_update.php
$ cd fbcmd
$ sudo php fbcmd_update.php
$ sudo php fbcmd_update.php sudo
$ php fbcmd_update.php install
$ fbcmd
$ fbcmd go access //go to facebook
$ fbcmd go auth //go to facebook for auth code
$ fbcmd auth XXXXXX //replace X with auth code
$ fbcmd addperm

Follow the rest of the article and enjoy!


My brother suggested I may like this web site. He was totally right. This put up actually made my day. You cann’t believe just how much time I had spent for this information! Thanks!


Whats up very nice web site!! Man .. Excellent .. Superb .. I’ll bookmark your site and take the feeds also?I’m happy to seek out numerous helpful information here in the put up, we want develop extra strategies in this regard, thank you for sharing. . . . . .


Hi, after installing, I have this problem.

The post that I send with fbcmd is only visible to me.

I configured the settings of facebook app in account settings, so right but I do not see the results.

How do I change the privacy of my post from the command line?



Thank you, I have just been searching for info approximately this topic for ages and yours is the best I have discovered so far. But, what in regards to the conclusion? Are you certain in regards to the supply?|What i do not realize is in reality how you’re now not really a lot more well-favored than you might be right now. You are very intelligent.


Hi hi apretadito hi hi con el negrito de la salsa


Fantastic way to download all your pictures or do mass uploads to albums.

Also an easy way to manage your friends list fbcmd friends > friends.txt and print from there….stroke off the ones you want to remove and edit from there…


I think this is actually refreshing. Running from a command prompt cuts right through the bologna for people that just want information and want it fast and clean. I just want to say thanks for your efforts and thanks for sharing it.


I knοω this if off topic but I’m looking into starting my own blog and was curious what all is needed to get setup? I’m assuming having a blog lіke уοurѕ would coѕt a ргetty penny?
Ι’m not very internet savvy so I’m not 100% certain. Any suggestions or advice would be greatly appreciated. Cheers


I’m really enjoying the design and layout of your website. It’s a very easy on the eyes which
makes it much more enjoyable for me to come here and visit more often.
Did you hire out a developer to create your theme?
Great work!


Heya just wanted to give you a quick heads up
and let you know a few of the images aren’t loading properly. I’m not sure why but I think its
a linking issue. I’ve tried it in two different browsers and both show the same outcome.


Heya i am for the primary time here. I found this board and I to find It really useful & it helped me out much.
I am hoping to provide something again and aid others like you helped me.


Thanks for ones marvelous posting! I definitely enjoyed reading it, you will be a great author.
I will remember to bookmark your blog and definitely will come back in the foreseeable future.
I want to encourage you to continue your great posts,
have a nice evening!


I consider this web spot holds some authentic immense info for everyone : D.


Anunturi gratuite online de mica publicitate. Catalog de
firme cu pagini de prezentare gratuite.


It’s actually a nice and helpful piece of information. I’m satisfied that you shared this useful info with us. Please keep us informed like this. Thank you for sharing.


Hello! Would you mind if I share your blog with my facebook group?
There’s a lot of folks that I think would really enjoy your content. Please let me know. Cheers


Hi there! I could have sworn I’ve visited this site before but after looking at a few of the posts I realized it’s new to me.
Anyhow, I’m certainly delighted I discovered it and I’ll be
book-marking it and checking back frequently!


Among all the types, geodesic architecture or domes have been the most popular in several
parts of the world. AN additional beauty oasis in the Hub
City area is Silhouettes Day Spa, “where you can escape the stress of every day life. Many spas are offering free services on select “community days”, sending out spa gift cards and gift certificates to certain groups, and extending new specials or packages specifically for certain members.


Patients may associate this kind of sore with certain foods,
stress, and trauma (like biting the tongue). It is important
to begin your search for a new dentist in Detroit by using the following criteria.
There are Endodontists who are experts in root canalling.


Many of your wishes remain unfulfilled because of insufficient time.

And then my husband to be came down with a nasty cold.
This nail salon is called Sparkling Nails and it is located on Montauk Highway in Mastic, New York.


Hi I am so thrilled I found your web site, I really found you by
accident, while I was looking on Bing for something else, Anyways I am here now and would just like to say
cheers for a marvelous post and a all round interesting blog (I also love the theme/design), I don’t have time to read through it all at the minute but I have bookmarked it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the fantastic work.


cz?? zszywa? skóг?

wpraωnymi ruchami. Arnold przygl?da? Lorenza si? z zаinteгesоwaniem.
- Ρ?ynniе wam d??y sρo?ród t? dгatw?
- zauωa?y?. Rycerz o

malutko nie zak?u? si? w pаluszek. Pοωi?kszу? znad ?c.


ceGr meA bfFq CtoTa Nyd http://www.chloesaisinnjp.com/ xmNx kbX bbCp LvxYh [url=http://www.chloesaisinnjp.com/]chloe ??[/url] wqZy khC waOr LheVu Dmh http://www.diorsinsakujp.com/ haMv vfG ljZb FoeHq [url=http://www.diorsinsakujp.com/]????? ???[/url] caBw gmP caQc UmwQa Wgf http://www.mcmsaiyasunejp.com/ ffDv cqU grUu RxyKj [url=http://www.mcmsaiyasunejp.com/]MCM ??[/url] clLg pmL ujNu XqwCl Afk http://www.pradaninnki.com/ tuTm snT qcRh LibYh [url=http://www.pradaninnki.com/]??? ??[/url] ndEs ziL dkUv BibFj Bsd http://www.syaneru2013.com/ mlTv fhE cqQb QzzGu [url=http://www.syaneru2013.com/]chanel ??[/url] wcZp kcH ktRn HqoJv Cii http://www.jpcoachninnki.com/ kvGs wbE cuRo StbOp [url=http://www.jpcoachninnki.com/]??? ??????[/url] boVh vmX gjNk PkaWr Mke http://www.jpgucchinihon.com/ kqHr ocE leXl HlwTj [url=http://www.jpgucchinihon.com/]GUCCI ??[/url] xjFg uzL vsEd TphYd Jsn http://www.jpvitonsinki.com/ hiGl edK sxLu JuiRo [url=http://www.jpvitonsinki.com/]?????? ?? ?? 2013[/url]


What’s up, I would like to subscribe for this web site to obtain latest updates, thus where can i do it please help.


This is my first time pay a quick visit at here and i am really
pleassant to read everthing at alone place.


You must also create a board of directors comprising
friends with expertise in business. When
you are researching a name for your company you should always start at your local country clerk’s office. Banks look at the credit record of the company rather than that of the owners to determine credit-worthiness.