LN

lox/notion-cli

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

37 stars 16 forks 品質 68 トレンド 20MIT

CLI for Notion using the Model Context Protocol (MCP)

概要

A command-line interface for Notion using the remote MCP (Model Context Protocol). Inspired by linear-cli - stay in the terminal while managing your Notion workspace. — includes a skill that lets agents search, create, and manage your Notion workspace alongside your code. The argument accepts a URL, ID, or page name. page archive accepts a page URL or page ID and moves that page to trash via the official API. This requires an official API token configured through auth api setup or NOTION_API_TOKEN. page view shows open page-level comments and inline block discussions by default. Inline discussions are rendered in context, with the anchor text wrapped in [[...]] and the discussion shown immediately below it. Use --no-comments to suppress comments, --raw to inspect the original Notion markup, and --json to return the page plus a Comments array. The argument accepts a URL, ID, or name. Date properties use the expanded key format: date: :start, date: :end.

README

以下は原文 README の抜粋です。原文を見る。

notion-cli

A command-line interface for Notion using the remote MCP (Model Context Protocol).

Inspired by linear-cli - stay in the terminal while managing your Notion workspace.

Works great with AI agents — includes a skill that lets agents search, create, and manage your Notion workspace alongside your code.

Installation

From Source

go install github.com/lox/notion-cli@latest

Build Locally

git clone https://github.com/lox/notion-cli
cd notion-cli
mise run build

Quick Start

# Authenticate with Notion (opens browser for OAuth)
notion-cli auth login

# Search your workspace
notion-cli search "meeting notes"

# View a page with open comments inline by default
notion-cli page view "https://notion.so/My-Page-abc123"

# Hide page and block comments when you only want the body
notion-cli page view "Meeting Notes" --no-comments

# List your pages
notion-cli page list

# Create a page
notion-cli page create --title "New Page" --content "# Hello World"

Commands

Authentication

notion-cli auth login      # Authenticate with Notion via OAuth
notion-cli auth refresh    # Refresh the access token
notion-cli auth status     # Show authentication status
notion-cli auth logout     # Clear stored credentials

# Official API fallback auth for features MCP cannot handle directly
notion-cli auth api setup     # Opens the internal integrations page, prompts for token, warns if format looks wrong
notion-cli auth api status
notion-cli auth api verify
notion-cli auth api unset

Pages

notion-cli page list                           # List pages
notion-cli page list --limit 50                # Limit results
notion-cli page list --json                    # Output as JSON

notion-cli page view                     # View page content with comments
notion-cli page view  --no-comments      # Hide page and block comments
notion-cli page view  --raw              # View raw Notion markup
notion-cli page view  --json             # Output as JSON

notion-cli page create --title "Title"         # Create a page
notion-cli page create --title "T" --content "Body text"
notion-cli page create --title "T" --parent 
notion-cli page archive        # Archive a page via the official API

# Upload a markdown file as a new page
notion-cli page upload ./document.md                        # Title from # heading or filename
notion-cli page upload ./document.md --title "Custom Title" # Explicit title
notion-cli page upload ./document.md --parent "Engineering" # Parent by name or ID
notion-cli page upload ./document.md --parent-db     # Upload as database entry
notion-cli page upload ./document.md --icon "📄"             # Set emoji icon
GitHub で README 全文を見る

インストール

npx skills add lox/notion-cli
MCP 初心者?mcpskill.org のガイドから始めましょう →