commit 8af648aba6e8d6e5764710b521aa2f9bf7db80c7 Author: Zhongwei Li Date: Sun Nov 30 09:05:22 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..87b05d2 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "gcal-plugin", + "description": "Google Calendar CLI integration for scheduling events with natural language", + "version": "1.0.0", + "author": { + "name": "Fucheng Warren Zhu", + "email": "wzhu@college.harvard.edu" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3bde097 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# gcal-plugin + +Google Calendar CLI integration for scheduling events with natural language diff --git a/commands/gcal.md b/commands/gcal.md new file mode 100644 index 0000000..1362595 --- /dev/null +++ b/commands/gcal.md @@ -0,0 +1,123 @@ +--- +description: Guide for using the gcallm CLI to add events to Google Calendar with natural language +--- + +# Google Calendar CLI Usage Guide + +Use the `gcallm` CLI to add events to Google Calendar using natural language. + +## Quick Reference + +### Add Events +```bash +# Direct text input +gcallm "Meeting with Sarah tomorrow at 3pm" +gcallm "Lunch next Tuesday 12-1pm at Cafe Nero" +gcallm add "Team standup Mon-Fri 9:30am" + +# Multiple events at once +gcallm "Team standup Mon-Fri 9:30am, Coffee with Alex Thursday 2pm" +``` + +### From Files (Preferred for Automation) +```bash +# Pipe from file +cat /tmp/gcal/events.txt | gcallm +cat schedule.txt | gcallm + +# Echo to stdin +echo "Doctor appointment Friday 10am" | gcallm +``` + +### From Clipboard +```bash +# Uses clipboard if no stdin/args provided +gcallm +``` + +### From Screenshots +```bash +# Parse latest screenshot on Desktop +gcallm -s "Add events from this screenshot" + +# Parse multiple screenshots +gcallm --screenshots 2 "Add from last 2 screenshots" +``` + +### Ask Questions +```bash +# General calendar questions +gcallm ask "What's on my calendar today?" +gcallm ask "When is my next meeting?" +gcallm ask "Am I free Thursday afternoon?" +``` + +### List Calendars +```bash +gcallm calendars +``` + +## Common Workflow + +**Recommended approach for scripts:** +```bash +# 1. Write event details to a temp file +cat > /tmp/gcal/events.txt << 'EOF' +Meeting with Prof. Smith Monday 2pm +Coffee with Alex Tuesday 10am +Team standup Wed-Fri 9:30am +EOF + +# 2. Pipe to gcallm +cat /tmp/gcal/events.txt | gcallm +``` + +## Natural Language Examples + +gcallm understands flexible date/time formats: +- "tomorrow at 3pm" +- "next Tuesday 12-1pm" +- "Monday through Friday at 9:30am" +- "December 15th 2pm for 2 hours" +- "Coffee with Alex 10am at Starbucks" +- "Team meeting every Monday 9am" + +## Configuration + +```bash +# Configure model (default: claude-sonnet-4-20250514) +gcallm config --model claude-sonnet-4-20250514 + +# Configure custom prompt +gcallm config --prompt "Custom extraction prompt" + +# Show current config +gcallm config --show +``` + +Config stored at: `~/.config/gcallm/config.json` + +## Verification + +```bash +# Verify setup +gcallm verify +``` + +## Troubleshooting + +### "MCP server not configured" Error +Ensure the Google Calendar MCP is configured in Claude Code: +```bash +claude mcp add gcal npx @anthropic/mcp-google-calendar -s local +``` + +### OAuth Issues +Re-run setup: +```bash +gcallm setup ~/path/to/oauth-keys.json +``` + +## Related Commands + +- `/gcal:setup` - Set up gcallm with OAuth credentials diff --git a/commands/setup.md b/commands/setup.md new file mode 100644 index 0000000..436f010 --- /dev/null +++ b/commands/setup.md @@ -0,0 +1,132 @@ +--- +description: Set up gcallm CLI with Google Calendar OAuth2 credentials +--- + +# Google Calendar CLI Setup + +This command guides you through setting up the `gcallm` CLI for adding events to Google Calendar. + +## Prerequisites + +You need: +1. OAuth2 credentials from Google Cloud Console +2. Google Calendar MCP server configured in Claude Code + +## Step 1: Get OAuth2 Credentials + +1. Go to [Google Cloud Console](https://console.cloud.google.com/apis/credentials) +2. Create a new project or select an existing one +3. Enable the **Google Calendar API**: + - Go to "APIs & Services" > "Enable APIs and Services" + - Search for "Google Calendar API" and enable it +4. Create OAuth2 credentials: + - Go to "Credentials" > "Create Credentials" > "OAuth client ID" + - Application type: **Desktop app** + - Name: "Calendar CLI" (or any name) + - Click "Create" +5. Download the credentials JSON file +6. Save it somewhere accessible (e.g., `~/gcp-oauth.keys.json`) + +## Step 2: Install gcallm + +```bash +# Install from PyPI +uv tool install gcallm + +# Or with pip +pip install gcallm +``` + +Verify installation: +```bash +which gcallm +# Should output: /Users/wz/.local/bin/gcallm +``` + +## Step 3: Configure OAuth Path + +Point gcallm to your OAuth credentials: +```bash +gcallm setup ~/gcp-oauth.keys.json +``` + +Or interactively: +```bash +gcallm setup +# Will prompt for path +``` + +## Step 4: Configure Google Calendar MCP + +gcallm requires the Google Calendar MCP server. Add it to Claude Code: + +```bash +claude mcp add gcal npx @anthropic/mcp-google-calendar -s local +``` + +This uses the OAuth credentials you configured. + +## Step 5: Verify Setup + +```bash +gcallm verify +``` + +Expected output: +``` +Google Calendar MCP: OK +OAuth credentials: Configured +``` + +Test with a simple query: +```bash +gcallm ask "What's on my calendar today?" +``` + +## Configuration Files + +``` +~/.config/gcallm/ +├── config.json # Settings (model, prompt) +└── oauth_path # Path to OAuth credentials + +# OAuth credentials (shared with other Google tools) +~/gcp-oauth.keys.json # Or wherever you saved it +``` + +## Troubleshooting + +### "MCP server not configured" Error + +The Google Calendar MCP server isn't set up: +```bash +# Add the MCP server +claude mcp add gcal npx @anthropic/mcp-google-calendar -s local + +# Verify it's configured +claude mcp list +``` + +### "OAuth credentials not found" Error + +Re-run setup with the correct path: +```bash +gcallm setup /correct/path/to/oauth-keys.json +``` + +### Authentication Failed + +Your OAuth token may have expired. Re-authenticate: +1. Delete existing credentials: `rm ~/.config/gcallm/*` +2. Re-run: `gcallm setup ~/gcp-oauth.keys.json` +3. Complete the browser authentication flow + +### Permission Denied + +Ensure the OAuth app has calendar scope: +1. Go to Google Cloud Console > APIs & Services > OAuth consent screen +2. Add scope: `https://www.googleapis.com/auth/calendar` + +## Related Commands + +- `/gcal` - Usage guide for gcallm CLI diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..620ab8f --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:WarrenZhu050413/Warren-Claude-Code-Plugin-Marketplace:gcal-plugin", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "2896b89440b51091b8a7df09be28d4be1744c8ac", + "treeHash": "d6ad792748d58e98a4ebca094eb1915daeabd114426beb31178265a11f91b77b", + "generatedAt": "2025-11-28T10:12:56.883988Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "gcal-plugin", + "description": "Google Calendar CLI integration for scheduling events with natural language", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "d6fcecb39c929cbf363d6186ee39baba79b4fedd4f1d61cca9cfa42e73d68cb0" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "5306a4e14c03b642666ccd119914cf1e53f6b862e4f3385d6ee4e5e3ea6efb3c" + }, + { + "path": "commands/setup.md", + "sha256": "dd2e8633cd20c5872bedfa449e191c24a2c27f075d03fd8fae8b6bd85b09c4dd" + }, + { + "path": "commands/gcal.md", + "sha256": "6692d27da1134896809b08722450393cd29bbe6ba815eb67775e9db2f72dd3e8" + } + ], + "dirSha256": "d6ad792748d58e98a4ebca094eb1915daeabd114426beb31178265a11f91b77b" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file