Skip to content
Back to skills

Google Drive

ASecurity

gogcli (gog) を使用してGoogle Driveを操作するスキル。ファイルの検索、アップロード、ダウンロード、共有、フォルダ管理などをCLI経由で実行。 Use when: (1) ドライブのファイルを検索したい、(2) ファイルをアップロードしたい、(3) ファイルをダウンロードしたい、(4) Google Driveを操作したい、(5) ファイルを共有したい、(6) フォルダを作成したい Trigger: drive, ドライブ, google drive, ファイル検索, アップロード, ダウンロード, 共有

  • 755 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added February 8, 2026
toolsgobash

Works with

  • cli

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill google-drive --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Google Drive?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Google Drive
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-google-drive/badge)](https://www.skillsdirectory.com/skills/majiayu000-google-drive)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: google-drive
description: |
  gogcli (gog) を使用してGoogle Driveを操作するスキル。ファイルの検索、アップロード、ダウンロード、共有、フォルダ管理などをCLI経由で実行。
  Use when: (1) ドライブのファイルを検索したい、(2) ファイルをアップロードしたい、(3) ファイルをダウンロードしたい、(4) Google Driveを操作したい、(5) ファイルを共有したい、(6) フォルダを作成したい
  Trigger: drive, ドライブ, google drive, ファイル検索, アップロード, ダウンロード, 共有
---

# Google Drive Operations with gogcli

`gog` CLIを使用してGoogle Driveを操作する。

## Prerequisites

```bash
# Installation
brew install gogcli

# Authentication (初回のみ)
gog auth login
```

## Commands Reference

### List Files

```bash
# ルートフォルダのファイル一覧
gog drive ls

# 特定フォルダの一覧
gog drive ls --parent="<folderId>"

# 最大件数指定
gog drive ls --max=50

# クエリフィルタ付き
gog drive ls --query="mimeType='application/vnd.google-apps.folder'"
```

### Search Files

```bash
# フルテキスト検索
gog drive search "検索キーワード"

# 複数キーワード
gog drive search "報告書 2024"

# JSON形式で出力
gog drive search "議事録" --json --max=20
```

### Download Files

```bash
# ファイルをダウンロード
gog drive download <fileId>

# 出力先を指定
gog drive download <fileId> --out="/path/to/output.pdf"

# Google Docsのエクスポート形式を指定
gog drive download <fileId> --format=pdf    # PDF形式
gog drive download <fileId> --format=docx   # Word形式
gog drive download <fileId> --format=xlsx   # Excel形式
gog drive download <fileId> --format=pptx   # PowerPoint形式
gog drive download <fileId> --format=csv    # CSV形式
gog drive download <fileId> --format=txt    # テキスト形式
```

### Upload Files

```bash
# ファイルをアップロード(ルートへ)
gog drive upload /path/to/file.pdf

# ファイル名を変更してアップロード
gog drive upload /path/to/file.pdf --name="新しいファイル名.pdf"

# 特定フォルダへアップロード
gog drive upload /path/to/file.pdf --parent="<folderId>"
```

### Create Folder

```bash
# ルートにフォルダ作成
gog drive mkdir "新しいフォルダ"

# 特定フォルダ内にサブフォルダ作成
gog drive mkdir "サブフォルダ" --parent="<parentFolderId>"
```

### File Operations

```bash
# ファイルのメタデータ取得
gog drive get <fileId>

# ファイルをコピー
gog drive copy <fileId> "コピー後の名前"

# ファイルを移動
gog drive move <fileId> --parent="<newParentFolderId>"

# ファイル名を変更
gog drive rename <fileId> "新しい名前"

# ファイルを削除(ゴミ箱へ)
gog drive delete <fileId>

# WebのURLを取得
gog drive url <fileId>
```

### Share Files

```bash
# 特定ユーザーと共有(閲覧権限)
gog drive share <fileId> --email="user@example.com" --role="reader"

# 特定ユーザーと共有(編集権限)
gog drive share <fileId> --email="user@example.com" --role="writer"

# 公開リンクを作成
gog drive share <fileId> --anyone --role="reader"

# 権限一覧を表示
gog drive permissions <fileId>

# 権限を削除
gog drive unshare <fileId> <permissionId>
```

### Shared Drives

```bash
# 共有ドライブ一覧
gog drive drives
```

### Comments

```bash
# ファイルのコメント一覧
gog drive comments list <fileId>

# コメントを追加
gog drive comments add <fileId> "コメント内容"
```

## Common Workflows

### 最近のファイルを確認

```bash
gog drive ls --max=10
```

### 特定の名前のファイルを検索

```bash
gog drive search "週報"
```

### Google Docsをローカルにダウンロード

```bash
# PDF形式でダウンロード
gog drive download <fileId> --format=pdf --out="./document.pdf"
```

### ローカルファイルを特定フォルダにアップロード

```bash
# まずフォルダIDを確認
gog drive search "プロジェクトフォルダ" --json

# フォルダにアップロード
gog drive upload ./report.pdf --parent="<folderId>"
```

## Output Formats

| Flag | Description |
|------|-------------|
| `--json` | JSON形式で出力(スクリプト向け) |
| `--plain` | TSV形式で出力(パース容易) |
| (default) | 人間が読みやすい形式 |

## Tips

- `--account=email@example.com` で複数アカウントを切り替え
- ファイルIDはURLから取得可能: `https://drive.google.com/file/d/<fileId>/view`
- フォルダIDもURLから取得可能: `https://drive.google.com/drive/folders/<folderId>`
- `--force` で確認をスキップ(削除時など注意して使用)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.