agent-notion

Notion CLI for humans and LLMs

Language
TypeScript
Version
0.3.1
License
MIT
Category
CLI Tool

A modern CLI for Notion that prioritizes structured JSON output and LLM-optimized interaction. It provides full CRUD access to pages, databases, blocks, and comments, plus AI chat integration — all as a zero-dependency single binary.

Features

01

Structured JSON output — all output to stdout, errors to stderr

02

LLM-optimized docs via agent-notion usage for agent consumption

03

Full CRUD — search, read, create, update, and archive pages and databases

04

Markdown conversion — page content rendered as markdown, append from markdown

05

Notion AI chat — send messages, list models and threads, stream responses

06

OAuth and integration token auth with multi-workspace management

07

Inline and page-level comments with text anchoring

08

Page export with recursive mode and workspace-wide export

09

Version history snapshots and activity log

10

macOS Keychain integration for secure credential storage

11

Zero runtime dependencies — single compiled binary

Install

Homebrew

>_
$ brew install shhac/tap/agent-notion

AI Agent Skill

>_
$ npx skills add shhac/agent-notion

GitHub Release (macOS)

>_
$ curl -L https://github.com/shhac/agent-notion/releases/latest/download/agent-notion-darwin-arm64.tar.gz | tar xz

Build from Source

>_
$ git clone https://github.com/shhac/agent-notion.git && cd agent-notion && bun install && bun run build

Getting Started

agent-notion requires authentication before any commands will work. The simplest option is an integration token; for access to advanced features like AI chat and export, import your desktop session.

01 · Option A: Use an integration token

>_
$ agent-notion auth login --token ntn_...

Create an internal integration at notion.so/profile/integrations and copy its token. Share pages/databases with the integration to grant access.

02 · Option B: Import your desktop session

>_
$ agent-notion auth import-desktop

macOS only. Reads the session token from the Notion desktop app. Grants access to v3 API features like AI chat, export, backlinks, and activity log.

03 · Verify authentication

>_
$ agent-notion auth status

Usage

>_ Search pages by title
$ agent-notion search "Meeting Notes"
>_ Query a database with filters
$ agent-notion database query DB_ID --filter status=Done
>_ Read a page as markdown
$ agent-notion page get PAGE_ID --content
>_ Append markdown to a page
$ agent-notion block append PAGE_ID --markdown "## New Section"
>_ Chat with Notion AI
$ agent-notion ai chat send "Summarize my recent notes"