LinuxCommandLibrary

goobook

Synchronize Google Contacts with address book

TLDR

Allow goobook to access Google contacts using OAuth2

$ goobook authenticate
copy

Dump all contacts to XML (stdout)
$ goobook dump_contacts
copy

SYNOPSIS

goobook [OPTIONS] [QUERY]

PARAMETERS

-h, --help
    Show help message and exit

--version
    Display program version

--addressbook ADDRESSBOOK
    Query specific addressbook (default: all)

--fields FIELDS
    Comma-separated fields to display (default: name,email; use '*' for all)

--global
    Enable tab-completion for all users

--limit LIMIT
    Max results (default: 10)

--name NAME
    Addressbook name (default: Contacts)

--no-rc
    Skip loading .goobookrc config

--print
    Print results instead of clipboard copy

--shell
    Output shell-eval format

DESCRIPTION

Goobook is a command-line utility for querying Google Contacts directly from the shell. It enables fast contact lookups by name, email, or phone, ideal for email clients like mutt, scripting, or tab-completion in terminals.

Setup requires one-time authentication via goobook auth, which opens a browser for OAuth approval and stores credentials in ~/.config/goobook/credentials.json. Queries fetch real-time data from Google's servers, supporting customizable fields (name, email, phone), result limits, and output formats like clipboard copy, shell-eval, or plain print.

Key features include global tab-completion for shell integration and multi-addressbook support. However, due to API changes, functionality is limited post-2021.

CAVEATS

Uses deprecated Google Contacts API (v3, shutdown ~2021); no longer works reliably. Requires internet and initial goobook auth. Stores credentials insecurely.

SETUP

Run goobook auth to authorize Google account.
Config: ~/.config/goobook/config or ~/.goobookrc.

MUTT INTEGRATION

Hook into mutt for alias completion: set alias_query_command="goobook --shell '%s'".

HISTORY

Developed by Jörgen Scheibengruber (tula) in 2010 as Python tool. Last major release ~2017. Abandoned after Google API deprecation.

SEE ALSO

abook(1), khard(1), mutt(1), vdirsyncer(1)

Copied to clipboard