Skill Gog

Split from aloycwl/OpenClaw: skill-gog

A-I-M-S
作者 A-I-M-S
其他 · 更新时间: 5 months ago
0
星标
0
Forks
社区
BB
安全:
中等
BBB
质量:

name: skill-gog description: "Enable Google product"

GOG - Google Workspace CLI Skill

Overview

This skill provides Google Drive manipulation capabilities using the gog CLI tool. It includes authentication methods, file upload/download operations, and Drive management.

Configuration

Environment Setup

# Keyring password for gog authentication
export GOG_KEYRING_PASSWORD="<YOUR_KEYRING_PASSWORD>"

# Default account (optional)
export GOG_ACCOUNT="<YOUR_EMAIL>"

Configuration File

{
  "keyring_backend": "file"
}

Location: /home/openclaw/.config/gogcli/config.json

Authentication Methods

1. Login (Initial Setup)

gog auth login <email>

2. Status Check

gog auth status

3. Account Management

gog auth list
gog auth manage

Google Drive Operations

File Upload

# Basic upload
gog drive upload <local_path> --name "<file_name>" --parent "root"

# With account specification
gog drive upload <local_path> --name "<file_name>" --parent "root" --account <email>

# With keyring password
gog drive upload <local_path> --name "<file_name>" --parent "root" --account <email> --keyring-password <password>

File Download

gog drive download <file_id> --output <local_path>

File Search

gog drive search "<query>"
gog drive ls

File Management

gog drive move <file_id> --parent <folder_id>
gog drive delete <file_id>

Common Operations

Upload Bug Bounty Reports

GOG_KEYRING_PASSWORD="123456" gog drive upload bug-bounty-reports.tar.gz --name "Bug Bounty Reports - insightginie.com" --parent "root" --account aloycwl@gmail.com

Upload Individual Files

GOG_KEYRING_PASSWORD="123456" gog drive upload <file_name> --name "<display_name>" --parent "root" --account aloycwl@gmail.com

Error Handling

Common Errors

  1. 403 Access Not Configured: Google Drive API not enabled

    • Solution: Enable API in Google Cloud Console
  2. Authentication Required: Missing credentials

    • Solution: Run gog auth login
  3. Keyring Password Required: Missing password

    • Solution: Set GOG_KEYRING_PASSWORD environment variable

Troubleshooting

# Check configuration
gog config status

# Check authentication
gog auth status

# Check Drive API
gog drive status

Best Practices

  1. Always set keyring password for automated operations
  2. Use specific accounts for different tasks
  3. Enable Drive API in Google Cloud Console
  4. Test authentication before critical operations
  5. Use parent folders for organization

Example Workflow

Bug Bounty Report Upload

# Step 1: Prepare files
# (Assume files are already created)

# Step 2: Archive files
tar -czf bug-bounty-reports.tar.gz *.md

# Step 3: Upload to Drive
GOG_KEYRING_PASSWORD="123456" gog drive upload bug-bounty-reports.tar.gz --name "Bug Bounty Reports - insightginie.com" --parent "root" --account aloycwl@gmail.com

# Step 4: Verify upload
gog drive search "Bug Bounty Reports"

Notes

Troubleshooting Guide

Issue: Authentication Fails

# Solution 1: Check keyring password
gog auth status

# Solution 2: Re-authenticate
gog auth login aloycwl@gmail.com

# Solution 3: Check configuration
gog config status

Issue: API Not Enabled

# Solution: Enable Drive API
# Visit: https://console.developers.google.com/apis/api/drive.googleapis.com/overview?project=674660835109

Issue: File Not Found

# Solution: Check file path
gog drive ls

# Solution: Check permissions
gog drive status

Maintenance

Regular Tasks

  1. Update credentials when password changes
  2. Monitor API usage in Google Cloud Console
  3. Clean up old files in Drive
  4. Backup configuration files

Configuration Updates

# Update keyring password
GOG_KEYRING_PASSWORD="new_password" gog config set keyring_password new_password

# Update default account
gog config set default_account new_email@gmail.com

Security Considerations

  1. Protect keyring password - it provides access to all Google services
  2. Use service accounts for automated tasks when possible
  3. Limit API permissions to only necessary scopes
  4. Monitor account activity for unauthorized access
  5. Use environment variables for sensitive data in scripts

Skill created for Google Drive manipulation using gog CLI with authentication.

🔓 登录解锁更多
使用 GitHub 登录