Back to Skills

notion-image

verified

画像ファイルをNotionに直接アップロードする。Notionに画像を追加したい時やスクリーンショットを共有したい時に使用する。

View on GitHub

Marketplace

tk-plugins

tktm04/tk-claude-plugins

Plugin

notion-image

Repository

tktm04/tk-claude-plugins
1stars

plugins/notion-image/skills/notion-image/SKILL.md

Last Verified

January 25, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/tktm04/tk-claude-plugins/blob/main/plugins/notion-image/skills/notion-image/SKILL.md -a claude-code --skill notion-image

Installation paths:

Claude
.claude/skills/notion-image/
Powered by add-skill CLI

Instructions

# Notion Image Upload

画像ファイルをNotion File Uploads APIで直接アップロードし、指定ページに埋め込むスキル。
外部ストレージ(R2, S3等)は不要。

## 前提条件

- **設定ファイル** が存在すること
  - パス: `~/.config/notion-image/.env`
  - 必須変数: `NOTION_TOKEN`
  - オプション: `DEFAULT_PAGE_ID`

- **Notion Integration** が設定されていること
  - https://www.notion.so/my-integrations でIntegration作成
  - 対象ページで「接続」からIntegrationを追加

- **コマンド** がPATHに追加されていること
  - `notion-upload` コマンドが使用可能

## 実行コマンド

```bash
notion-upload <image_file_path> [page_id]
```

## パラメータ

| パラメータ | 必須 | 説明 |
|-----------|------|------|
| `<image_file_path>` | Yes | アップロードする画像ファイルのパス |
| `[page_id]` | No | 画像を追加するNotionページID(省略時はDEFAULT_PAGE_ID使用) |

## 出力形式

成功時:
```
Uploading: /path/to/image.png
  -> Content-Type: image/png
Step 1/3: Creating upload object...
  -> Upload ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Step 2/3: Sending file...
  -> File sent successfully
Step 3/3: Attaching to page...
  -> Attached to page: abc123...
Upload successful!
```

## 対応ファイル形式

| 形式 | MIME Type |
|------|-----------|
| `.png` | image/png |
| `.jpg`, `.jpeg` | image/jpeg |
| `.gif` | image/gif |
| `.webp` | image/webp |
| `.svg` | image/svg+xml |

## 使用例

### 基本的な使用

```bash
# デフォルトページにアップロード
notion-upload /tmp/screenshot.png

# 特定ページにアップロード
notion-upload /tmp/screenshot.png abc123def456
```

### Claude Codeでの使用

ユーザー: 「この画像をNotionにアップロードして」
-> ページIDを確認し、スキルを実行

ユーザー: 「スクリーンショットをNotionページXXXに追加して」
-> ページIDとファイルパスを特定し、スキルを実行

## ページIDの取得方法

1. Notionでページを開く
2. URLをコピー(例: `https://www.notion.so/Page-Title-abc123def456...`)
3. 末尾32文字がページID(ハイフンなしで使用)

## エラーハンドリング

| エラー | 原因 | 対処法 |
|--------|------|--------|
| `Config file not found` | 設定ファイル未作成 | `~/.config/notion-image/.env` を作成 |
| `NOTION_TOKEN not set` | トークン未設定 | .envにNOTION_TOKENを追加 |
| `File not found` | 指定ファイルが存在しない | ファイルパスを確認 |
| `Unsupported file type` | 非対応の画像形式 | png/jpg/gif/webp/svgを使用 |
| `Failed to create file upload` | API認証エラー | トークンを確認 |
| `Failed to attach image` | ページ接続エラー | ページにIntegrationを接続 |

## 注意事項

- **1時間制限**: アッ

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
2297 chars