Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I use my Gmail contacts within Alpine/pine?

share|improve this question

3 Answers 3

An alternate way of importing your Google contacts is using pull_contacts.py.

This script will:

  1. perform a GData query to retrieve all the contacts; and
  2. print them in alpine's addressbook format.

So, to add all of your Google contacts to the addressbook, simply:

  python pull_contacts.py aphacker@gmail.com >> .addressbook

The main advantage of this method over the one described by DaveParillo is the added support for non-latin1 characters. If you're like me and have a lot of people with accented letters in their names, this script is a God-send -- you won't have to go through the list manually replacing ? with the right latin1 letter.

Note that the script requires the GData libraries.

share|improve this answer
+1 For a nice and clean output –  Ayman Elmasry Feb 5 '12 at 23:06
Ah. I now use goobook, for what it's worth. It's an abook clone that uses Google contacts. –  scvalex Feb 8 '12 at 10:37
Doesn't work for me. It seems, since the last post made, gmail moved forward: gdata.service.RequestError: {'status': 301, 'body': '<HTML>\n<HEAD>\n<TITLE>Moved Permanently</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Moved Permanently</H1>\nThe document has moved <A HREF="https://www.google.com/m8/feeds/contacts/default/full?max-results=1000">he‌​re</A>.\n</BODY>\n</HTML>\n', 'reason': 'Moved Permanently'} –  Zhang Weiwu Jun 9 '14 at 6:20

I don't think you can just 'reach out' and use them on the fly, but you can append them to your existing ~/.addressbook

  1. in GMail, choose 'Contacts', then 'Export' in the upper right corner
  2. choose 'Outlook CSV' & save
  3. open it in a spreadsheet
  4. delete first line, insert a column before the others
  5. Save As -> Text export (configurable)
    • in the upcoming dialog choose:
    • Separator: Tab
    • Never Quote
  6. Save file
  7. append this file to your .addressbook-file.

    cat gmailfile.csv >> ~/.addressbook

share|improve this answer

I found a much easier method!

Go to your contacts in google, and copy the entire contacts (ie, two columns, with names in first, and address in second, leave the "Name" and "Details" row)

Now, go to your home folder, and unhide by Ctrl+h. Open the .addressbook file.

Simply paste and save.

Open your alpine, and check!

Most will not need the following step.

For formatting and aligning, you may first create one contact through alpine, and then open your addressbook file. you will see your entry. Then paste and separate through tab accordingly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.