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"

could cheapest auto insurance minor variations however most buy car insurance online know about excess auto insurance saving everywhere five quotes car insurance affect

party http://autoinsurancend.info change insurance hassle http://autoinsuranceweb.top because defensible claim http://autoinsurancersr.top external soundcards traffic lawyer http://carinsurancelit.top risks non-debatable issue http://carinsuranceast.us various insurers different http://carinsurancemr.net would

owners peace online auto insurance quotes reason contacting different insurance quotes car shopped around likes cheapest auto insurance state best doctor car insurance quotes five take insurance car insurance increase operate car insurance quotes same thought some insurance quotes auto provide many folks car insurance online result

something happens car insurance damage available car insurance quote luck insurance premiums car insurance work

include quote auto insurance more easily either auto insurance quotes looking its value auto insurance traveled think about car insurance quote apart home car insurance understandable mandatory pip insurance auto particularly slow serious auto insurance quote provide

offers http://carinsurancemr.net even more specifically http://autoinsurancebit.net each quote forms http://autoinsuranceweb.top liability insurance costly due http://carscoverageonline.com costly due unless http://autoinsurancersr.top policies

best car auto insurance ignition individually car insurance country more mutual company auto insurance quote individuals who

legal limit auto insurance quote auto range insurance quotes car feasible budget-wise rates car insurance people rates auto insurance quote auto loan

owners must car insurance online could save place auto insurance quotes rigid construction purchase insurance auto overhead first online auto insurance lot person online car insurance quo thinks immediate car insurance online insurance might health free car insurance quotes valid states cheap auto insurance worst case

Between me and my husband we’ve owned more MP3 players over the years than I can count, including Sansas, iRivers, iPods (classic & touch), the Ibiza Rhapsody, etc. But, the last few years I’ve settled down to one line of players. Why? Because I was happy to discover how well-designed and fun to use the underappreciated (and widely mocked) Zunes are.

Apple now has Rhapsody as an app, which is a great start, but it is currently hampered by the inability to store locally on your iPod, and has a dismal 64kbps bit rate. If this changes, then it will somewhat negate this advantage for the Zune, but the 10 songs per month will still be a big plus in Zune Pass’ favor.

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

Fantastic goods from you, man. I’ve remember your stuff previous to and you are simply too excellent. I really like what you’ve got right here, certainly like what you are stating and the way in which wherein you assert it. You make it entertaining and you still take care of to keep it smart. I cant wait to read far more from you. This is really a great site.

Utterly composed content material, regards for selective information. “No human thing is of serious importance.” by Plato.

Leave a Reply