notion-cli
ターミナルからNotionのページやデータベース、ブロックなどを読み書き・管理し、ワークスペースの自動化やAPI連携を効率化するSkill。
📜 元の英語説明(参考)
Work with Notion from the terminal using the `notion` CLI. Use when the user needs to read, create, update, query, or manage Notion pages, databases, blocks, comments, users, or files programmatically. Covers the entire Notion API with 44 commands. Triggers: Notion workspace automation, database queries, page creation, block manipulation, comment threads, file uploads, relation management, database export, multi-workspace management, or any Notion API interaction from the command line.
🇯🇵 日本人クリエイター向け解説
ターミナルからNotionのページやデータベース、ブロックなどを読み書き・管理し、ワークスペースの自動化やAPI連携を効率化するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o notion-cli.zip https://jpskill.com/download/6778.zip && unzip -o notion-cli.zip && rm notion-cli.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6778.zip -OutFile "$d\notion-cli.zip"; Expand-Archive "$d\notion-cli.zip" -DestinationPath $d -Force; ri "$d\notion-cli.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
notion-cli.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
notion-cliフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Notion CLI
notionはNotion API用のCLIです。単一のGoバイナリで、APIの全機能をカバーし、デュアル出力(人間向けのきれいなテーブル、エージェント向けのJSON)に対応しています。
インストール
# Homebrew
brew install 4ier/tap/notion-cli
# Go
go install github.com/4ier/notion-cli@latest
# npm
npm install -g notion-cli-go
# またはGitHub Releasesからバイナリをダウンロード
# https://github.com/4ier/notion-cli/releases
認証
notion auth login --with-token <<< "ntn_xxxxxxxxxxxxx" # またはインタラクティブ
notion auth login --with-token --profile work <<< "ntn_xxx" # 名前付きプロファイルとして保存
export NOTION_TOKEN=ntn_xxxxxxxxxxxxx # 環境変数による代替
notion auth status # 現在のプロファイルを表示
notion auth switch # インタラクティブなプロファイル選択
notion auth switch work # 名前付きプロファイルに切り替え
notion auth doctor # ヘルスチェック
コマンドリファレンス
検索
notion search "query" # すべてを検索
notion search "query" --type page # ページのみ
notion search "query" --type database # データベースのみ
ページ
notion page view <id|url> # ページコンテンツをレンダリング
notion page list # ワークスペースのページを一覧表示
notion page create <parent> --title "X" --body "content"
notion page create <db-id> --db "Name=Review" "Status=Todo" # データベースの行
notion page delete <id> # ページをアーカイブ
notion page restore <id> # ページのアーカイブを解除
notion page move <id> --to <parent>
notion page open <id> # ブラウザで開く
notion page edit <id|url> # $EDITORで編集(Markdownのラウンドトリップ)
notion page edit <id> --editor nano # エディタを指定
notion page set <id> Key=Value ... # プロパティを設定(型を自動認識)
notion page props <id> # すべてのプロパティを表示
notion page props <id> <prop-id> # 特定のプロパティを取得
notion page link <id> --prop "Rel" --to <target-id> # リレーションを追加
notion page unlink <id> --prop "Rel" --from <target-id> # リレーションを削除
データベース
notion db list # データベースを一覧表示
notion db view <id> # スキーマを表示
notion db query <id> # すべての行をクエリ
notion db query <id> -F 'Status=Done' -s 'Date:desc' # フィルター + ソート
notion db query <id> --filter-json '{"or":[...]}' # 複雑なJSONフィルター
notion db query <id> --all # すべてのページを取得
notion db create <parent> --title "X" --props "Status:select,Date:date"
notion db update <id> --title "New Name" --add-prop "Priority:select"
notion db add <id> "Name=Task" "Status=Todo" "Priority=High"
notion db add-bulk <id> --file items.json # JSONから一括作成
notion db export <id> # すべての行をCSVとしてエクスポート(デフォルト)
notion db export <id> --format json # JSONとしてエクスポート
notion db export <id> --format md -o report.md # Markdownテーブルとしてファイルにエクスポート
notion db open <id> # ブラウザで開く
フィルター演算子
| 構文 | 意味 |
|---|---|
= |
等しい |
!= |
等しくない |
> / >= |
より大きい(または等しい) |
< / <= |
より小さい(または等しい) |
~= |
含む |
複数の-FフラグはANDで結合されます。プロパティの型はスキーマから自動検出されます。
ソート: -s 'Date:desc' または -s 'Name:asc'
一括追加ファイルの形式
[{"Name": "Task A", "Status": "Todo"}, {"Name": "Task B", "Status": "Done"}]
ブロック
notion block list <parent-id> # 子ブロックを一覧表示
notion block list <parent-id> --all # すべてをページネーション
notion block list <parent-id> --depth 3 # 再帰的なネストされたブロック
notion block list <parent-id> --md # Markdownとして出力
notion block get <id> # 単一のブロックを取得
notion block append <parent> "text" # 段落を追加
notion block append <parent> "text" -t bullet # 箇条書き
notion block append <parent> "text" -t code --lang go # コードブロック
notion block append <parent> --file notes.md # ファイルから
notion block insert <parent> "text" --after <block-id> # 指定位置に挿入
notion block update <id> --text "new" # コンテンツを更新
notion block delete <id1> [id2] [id3] # 1つまたは複数を削除
notion block move <id> --after <target> # ターゲットブロックの後に再配置
notion block move <id> --before <target> # ターゲットブロックの前に再配置
notion block move <id> --parent <new-parent> # 別の親に移動
ブロックの種類: paragraph/p, h1, h2, h3, bullet, numbered, todo, quote, code, callout, divider
コメント
notion comment list <page-id>
notion comment add <page-id> "comment text"
notion comment get <comment-id>
notion comment reply <comment-id> "reply text" # 同じスレッドで返信
ユーザー
notion user me # 現在のボット情報
notion user list # すべてのワークスペースユーザー
notion user get <user-id>
ファイル
notion file list # アップロードを一覧表示
notion file upload ./path/to/file # アップロード(MIMEを自動検出)
Raw API (エスケープハッチ)
notion api GET /v1/users/me
notion api POST /v1/search '{"query":"test"}'
notion api PATCH /v1/pages/<id> '{"archived":true}'
出力モード
- ターミナル (TTY): 色付きのテーブル、読みやすいフォーマット
- パイプ/スクリプト: 自動的にJSON
- 明示的:
--format jsonまたは--format table --debug: HTTPリクエスト/レスポンスの詳細を表示
すべての出力には完全なNotion UUIDが含まれます。すべてのコマンドはNotionのURLまたはIDを受け入れます。
ヒント
notion db addとnotion page setはスキーマからプロパティの型を自動検出します- マルチセレクト:
Tags=tag1,tag2,tag3 - チェックボックス:
Done=true - jqへのパイプ:
notion db query <id> -F 'Status=Done' --format json | jq '.results[].id'
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Notion CLI
notion is a CLI for the Notion API. Single Go binary, full API coverage, dual output (pretty tables for humans, JSON for agents).
Install
# Homebrew
brew install 4ier/tap/notion-cli
# Go
go install github.com/4ier/notion-cli@latest
# npm
npm install -g notion-cli-go
# Or download binary from GitHub Releases
# https://github.com/4ier/notion-cli/releases
Auth
notion auth login --with-token <<< "ntn_xxxxxxxxxxxxx" # or interactive
notion auth login --with-token --profile work <<< "ntn_xxx" # save as named profile
export NOTION_TOKEN=ntn_xxxxxxxxxxxxx # env var alternative
notion auth status # show current profile
notion auth switch # interactive profile picker
notion auth switch work # switch to named profile
notion auth doctor # health check
Command Reference
Search
notion search "query" # search everything
notion search "query" --type page # pages only
notion search "query" --type database # databases only
Pages
notion page view <id|url> # render page content
notion page list # list workspace pages
notion page create <parent> --title "X" --body "content"
notion page create <db-id> --db "Name=Review" "Status=Todo" # database row
notion page delete <id> # archive page
notion page restore <id> # unarchive page
notion page move <id> --to <parent>
notion page open <id> # open in browser
notion page edit <id|url> # edit in $EDITOR (Markdown round-trip)
notion page edit <id> --editor nano # specify editor
notion page set <id> Key=Value ... # set properties (type-aware)
notion page props <id> # show all properties
notion page props <id> <prop-id> # get specific property
notion page link <id> --prop "Rel" --to <target-id> # add relation
notion page unlink <id> --prop "Rel" --from <target-id> # remove relation
Databases
notion db list # list databases
notion db view <id> # show schema
notion db query <id> # query all rows
notion db query <id> -F 'Status=Done' -s 'Date:desc' # filter + sort
notion db query <id> --filter-json '{"or":[...]}' # complex JSON filter
notion db query <id> --all # fetch all pages
notion db create <parent> --title "X" --props "Status:select,Date:date"
notion db update <id> --title "New Name" --add-prop "Priority:select"
notion db add <id> "Name=Task" "Status=Todo" "Priority=High"
notion db add-bulk <id> --file items.json # bulk create from JSON
notion db export <id> # export all rows as CSV (default)
notion db export <id> --format json # export as JSON
notion db export <id> --format md -o report.md # export as Markdown table to file
notion db open <id> # open in browser
Filter operators
| Syntax | Meaning |
|---|---|
= |
equals |
!= |
not equals |
> / >= |
greater than (or equal) |
< / <= |
less than (or equal) |
~= |
contains |
Multiple -F flags combine with AND. Property types are auto-detected from schema.
Sort: -s 'Date:desc' or -s 'Name:asc'
Bulk add file format
[{"Name": "Task A", "Status": "Todo"}, {"Name": "Task B", "Status": "Done"}]
Blocks
notion block list <parent-id> # list child blocks
notion block list <parent-id> --all # paginate through all
notion block list <parent-id> --depth 3 # recursive nested blocks
notion block list <parent-id> --md # output as Markdown
notion block get <id> # get single block
notion block append <parent> "text" # append paragraph
notion block append <parent> "text" -t bullet # bullet point
notion block append <parent> "text" -t code --lang go # code block
notion block append <parent> --file notes.md # from file
notion block insert <parent> "text" --after <block-id> # positional insert
notion block update <id> --text "new" # update content
notion block delete <id1> [id2] [id3] # delete one or more
notion block move <id> --after <target> # reposition after target block
notion block move <id> --before <target> # reposition before target block
notion block move <id> --parent <new-parent> # move to different parent
Block types: paragraph/p, h1, h2, h3, bullet, numbered, todo, quote, code, callout, divider
Comments
notion comment list <page-id>
notion comment add <page-id> "comment text"
notion comment get <comment-id>
notion comment reply <comment-id> "reply text" # reply in same thread
Users
notion user me # current bot info
notion user list # all workspace users
notion user get <user-id>
Files
notion file list # list uploads
notion file upload ./path/to/file # upload (auto MIME detection)
Raw API (escape hatch)
notion api GET /v1/users/me
notion api POST /v1/search '{"query":"test"}'
notion api PATCH /v1/pages/<id> '{"archived":true}'
Output Modes
- Terminal (TTY): colored tables, readable formatting
- Piped/scripted: JSON automatically
- Explicit:
--format jsonor--format table --debug: show HTTP request/response details
All output includes full Notion UUIDs. All commands accept Notion URLs or IDs.
Tips
notion db addandnotion page setauto-detect property types from schema- Multi-select:
Tags=tag1,tag2,tag3 - Checkbox:
Done=true - Pipe to jq:
notion db query <id> -F 'Status=Done' --format json | jq '.results[].id'