mcpField
G
google-calendar

google-calendar

github.com/dotneet生産性3450 回インストール40 週間前に更新
リポジトリ

google-calendar について

Google CalendarとTasksにアクセスするコマンドラインスキルです。予定やタスクリストを管理するユーザーやエージェント向けで、予定・タスク操作、空き状況の照会、Calendar APIの直接呼び出しに対応します。

主な機能

  1. 01カレンダー予定の一覧表示と検索
  2. 02予定の作成、更新、削除
  3. 03カレンダーの空き状況確認
  4. 04Google Tasksのリストとタスク管理
  5. 05Calendar APIエンドポイントの呼び出し

活用シーン

  1. 01指定期間内の予定を検索
  2. 02会議の設定や変更
  3. 03複数カレンダーの空き状況確認
  4. 04タスクリストの管理

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/dotneet/claude-code-marketplace --skill google-calendar

インストール後、Claude Code で/google-calendarを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

README.md
scripts/
gcal
gcal_api.py
gcal_auth.py
gcal-auth
requirements.txt

詳細

Google Calendar + Tasks へのアクセス

クイックスタート

  • Google Cloud OAuth クライアント(デスクトップアプリ)を作成し、認証情報の JSON を ~/.config/google-calendar/credentials.json に保存します。
  • 依存関係をインストールします(venv を推奨)。
    python3 -m venv ~/.config/google-calendar/venv
    ~/.config/google-calendar/venv/bin/pip install -r <skill_dir>/scripts/requirements.txt
    
  • 認証してトークンを保存します。
    • Calendar のみ:
      • <skill_dir>/scripts/gcal-auth
    • Tasks のみ:
      • <skill_dir>/scripts/gcal-auth --scopes https://www.googleapis.com/auth/tasks
    • Calendar + Tasks(単一のトークン):
      • <skill_dir>/scripts/gcal-auth --scopes https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/tasks
  • API を呼び出します。
    • <skill_dir>/scripts/gcal list-calendars

認証情報とトークン

  • 認証情報は、デフォルトで ~/.config/google-calendar/credentials.json に配置します。
  • トークンは、デフォルトで ~/.config/google-calendar/token.json に保存されます。
  • アカウントを切り替えたり、環境を分離したりするには、--token または GCAL_TOKEN_PATH を使用します。

日付と時刻のルール

  • 時刻指定のイベントには RFC3339 を使用します(例:2026-01-22T10:00:00-08:00)。
  • 終日イベントには YYYY-MM-DD を使用し、end には翌日を指定します(終端を含みません)。
  • 日時にオフセットがない場合は、--time-zone を設定します。

よく使うコマンド

  • カレンダーを一覧表示:
    • <skill_dir>/scripts/gcal list-calendars
  • イベントを一覧表示:
    • <skill_dir>/scripts/gcal list-events --calendar-id primary --time-min 2026-01-22T00:00:00-08:00 --time-max 2026-01-22T23:59:59-08:00
  • イベントを検索:
    • <skill_dir>/scripts/gcal list-events --calendar-id primary --q "standup" --time-min ... --time-max ...
  • イベントを作成(簡易):
    • <skill_dir>/scripts/gcal create-event --calendar-id primary --summary "Review" --start 2026-01-22T10:00:00-08:00 --end 2026-01-22T11:00:00-08:00
  • イベントを更新(簡易):
    • <skill_dir>/scripts/gcal update-event --calendar-id primary --event-id <id> --summary "New title"
  • イベントを削除:
    • <skill_dir>/scripts/gcal delete-event --calendar-id primary --event-id <id>
  • 空き時間/予定ありの状況:
    • <skill_dir>/scripts/gcal freebusy --calendars primary,[email protected] --time-min ... --time-max ...
  • タスクリストを一覧表示:
    • <skill_dir>/scripts/gcal list-tasklists
  • タスクを一覧表示:
    • <skill_dir>/scripts/gcal list-tasks --tasklist <tasklist_id>
  • タスクを作成:
    • <skill_dir>/scripts/gcal create-task --tasklist <tasklist_id> --title "Buy milk" --due 2026-01-22T10:00:00-08:00
  • タスクを更新:
    • <skill_dir>/scripts/gcal update-task --tasklist <tasklist_id> --task-id <id> --notes "Bring receipt"
  • タスクを削除:
    • <skill_dir>/scripts/gcal delete-task --tasklist <tasklist_id> --task-id <id>

高度な使い方

  • call を使うと、任意の Calendar API エンドポイントを呼び出せます。
    • <skill_dir>/scripts/gcal call GET /users/me/calendarList
    • <skill_dir>/scripts/gcal call POST /calendars/primary/events --body-file /path/to/event.json
  • 複雑なペイロード(参加者、繰り返し、conferenceData)には、--body-file または --body(JSON 文字列)を使用します。
  • --token で異なるトークンファイルを指定すると、複数のアカウントを利用できます。

安全性

  • イベントを作成、更新、削除する前に、実行する意図を確認します。
  • OAuth 認証情報とトークンファイルを git に含めないでください。

コメント