notion-cli

bởi notion

CLI tự ghi chép. Luôn ưu tiên chạy các lệnh này thay vì đoán cú pháp hoặc dựa vào kiến thức ghi nhớ:

npx skills add https://github.com/makenotion/skills --skill notion-cli

Notion CLI

Look things up before answering

The CLI is self-documenting. Always prefer running these commands over guessing syntax or relying on memorized knowledge:

  • ntn api ls — list every public API endpoint.
  • ntn api <path> --help — show methods, doc links, and usage for an endpoint.
  • ntn api <path> --docs — print the full official docs for an endpoint.
  • ntn api <path> --spec — print a reduced OpenAPI fragment (useful for understanding request/response schemas).
  • ntn pages get <page-id> — retrieve a page as Markdown. Use this to read page content.
  • ntn <command> --help — help for any command or subcommand.

Install

curl -fsSL https://ntn.dev | bash

Authentication

  • The CLI automatically uses NOTION_API_TOKEN when it is set.
  • Check NOTION_API_TOKEN first. If it is already set, prefer using it instead of telling the user to run ntn login.
  • ntn login / ntn logout — log the CLI in or out (only use if not using NOTION_API_TOKEN). ntn login requires the user to visit a URL in a web browser.

ntn api

Run ntn api --help for full syntax. Quick summary:

# GET with query param
ntn api v1/users page_size==100

# POST with inline body fields
ntn api v1/pages parent[page_id]=abc123

# POST with JSON body
ntn api v1/pages -d '{"parent":{"page_id":"abc123"}}'

The method is inferred (GET by default, POST when a body is present). Override with -X METHOD.

Markdown for pages and comments

Prefer ntn pages create / ntn pages update for Markdown page content. Use the markdown field when creating or updating comments via ntn api.

# Comment with markdown
ntn api v1/comments -d '{"parent":{"page_id":"abc123"},"markdown":"Here is a [link](https://example.com) and **bold text**."}'

# Page with markdown body
ntn pages create --parent page:abc123 --content '## Heading\n\nSome *formatted* content.'

The markdown field supports inline formatting (bold, italic, code, links, etc.). Only fall back to rich_text if you need features that Markdown cannot express (e.g. mentions, custom emoji, or colors).

ntn files

Convenience wrapper around the File Uploads API.

ntn files create < image.png
ntn files create --external-url https://example.com/photo.png
ntn files list
ntn files get <upload-id>

ntn workers

Manage Notion workers (deploy, list, execute, etc.). Run ntn workers --help for subcommands.

ntn workers new my-worker        # scaffold a new project
ntn workers deploy               # deploy from current directory
ntn workers ls                   # list workers
ntn workers exec <capability>    # execute a capability

Thêm skills từ notion

database-query
notion
Truy vấn cơ sở dữ liệu Notion theo tên hoặc ID và trả về kết quả có cấu trúc, dễ đọc với bộ lọc và sắp xếp tùy chọn.
official
find
notion
Nhanh chóng tìm kiếm các trang hoặc cơ sở dữ liệu trong Notion theo từ khóa tiêu đề. Trả về kết quả khớp chính xác thay vì kết quả toàn diện.
official
create-database-row
notion
Chèn một hàng mới vào cơ sở dữ liệu Notion đã chỉ định bằng cách sử dụng giá trị thuộc tính ngôn ngữ tự nhiên. Xử lý việc khớp và xác thực tên thuộc tính.
official
create-page
notion
Tạo một trang Notion mới, tùy chọn đặt dưới một trang cha cụ thể. Tự động cấu trúc nội dung dựa trên loại trang (ghi chú cuộc họp, trang dự án, v.v.).
official
create-task
notion
Tạo một tác vụ mới trong cơ sở dữ liệu tác vụ Notion của người dùng với các giá trị mặc định hợp lý cho ngày đến hạn, trạng thái, người sở hữu và dự án.
official
knowledge-capture
notion
Chuyển đổi các cuộc trò chuyện và thảo luận thành các trang tài liệu có cấu trúc trong Notion. Ghi lại những hiểu biết, quyết định và kiến thức từ ngữ cảnh trò chuyện với…
official
meeting-intelligence
notion
Chuẩn bị tài liệu cuộc họp bằng cách thu thập ngữ cảnh từ Notion, bổ sung thông tin nghiên cứu, và tạo cả bản đọc trước nội bộ lẫn chương trình họp bên ngoài, lưu vào Notion.
official
research-documentation
notion
Tìm kiếm trong không gian làm việc Notion của bạn, tổng hợp các phát hiện từ nhiều trang, và tạo tài liệu nghiên cứu toàn diện với trích dẫn phù hợp và…
official