gcalcli - Google Calendar CLI

Nid: 1403
  • Posted on: 5 May 2020
  • By: admin

環境

$ uname -a
CYGWIN_NT-10.0 WINDOWS-6RODFG9 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

pipを使用してインストール。

$ pip install gcalcli
$ pip install vobject

起動

$ gcalcli --noauth_local_webserver agenda
/usr/lib/python3.6/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access /home/username/.gcalcli_oauth: No such file or directory
  warnings.warn(_MISSING_FILE_MESSAGE.format(filename))

Go to the following link in your browser:

https://accounts.google.com/o/oauth2/v2/auth?client_id=...

指定されたページにアクセスするとエラーメッセージ。

Sign in with Google temporarily disabled for this app
This app has not been verified yet by Google in order to use Google Sign In.

カレンダーAPIを許可する。https://developers.google.com/calendar/quickstart/python
Enable the Google Calendar API
Client ID と Client Secret をコピー。
 

エラーメッセージのファイルを作成。

$ touch /home/username/.gcalcli_oauth

リトライ。

$ gcalcli --noauth_local_webserver --client-id=clientid_here --client-secret=clientsecret_here agenda
Go to the following link in your browser:

    https://accounts.google.com/o/oauth2/v2/auth?client_id=

ブラウザからサイトにアクセスし、Advancedをクリック。

This app isn't verified
This app hasn't been verified by Google yet. Only proceed if you know and trust the developer.

If you’re the developer, submit a verification request to remove this screen. Learn more

Hide Advanced
Google hasn't reviewed this app yet and can't confirm it's authentic. Unverified apps may pose a threat to your personal data. Learn more

Go to Quickstart (unsafe)

Sign in
Please copy this code, switch to your application and paste it there:

動作確認。

$ gcalcli --noauth_local_webserver --client-id=clientid_here --client-secret=clientsecret_here agenda
$ gcalcli  agenda

イベントを追加。

$ gcalcli quick 'Dinner with Octavia 7pm tomorrow'
You must only specify a single calendar

カレンダーのリスト。

$ gcalcli list
 Access  Title
 ------  -----
  owner  Lifeplan
  owner  Business
  owner  Trading
 reader  Contacts
 reader  Holidays in Japan
 reader  Phases of the Moon

カレンダーを指定してイベントを追加。

$ gcalcli quick 'Dinner with Octavia 7pm tomorrow' --calendar Business
$ gcalcli agenda
水 5月 06         
            19:00          Dinner with Octavia

イベント削除。

$ gcalcli delete 'Dinner with Octavia'
2020-05-06  19:00          Dinner with Octavia
Delete? [N]o [y]es [q]uit: y
Deleted!