{"_id":"notion-agent-cli","_rev":"8-bb5fa700ebd0b927850c8417b5163aee","name":"notion-agent-cli","dist-tags":{"latest":"0.2.4"},"versions":{"0.1.0":{"name":"notion-agent-cli","version":"0.1.0","keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","_id":"notion-agent-cli@0.1.0","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"dist":{"shasum":"55a2a3a07852161e9c21433a496b16457defe100","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.1.0.tgz","fileCount":42,"integrity":"sha512-2/F4kc7iioypptz65V5FdpXksMnCmz9JWYzbaDeZGGRDgFgdmlaZHWIh6Qn31O1goIPCiDR9+yp2uTl4XBcJUA==","signatures":[{"sig":"MEYCIQDvcGajC8K0+uIrtzMy2p1ZYi9IFKGFdK9YUgrHqtPmEAIhAPeUyzr157MJON6UKdqZ+CxQvB6BOSVOxE42hPDc7tcE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104880},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"48532f0cb85ce27b1ca724e91e21382778401568","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc && chmod +x dist/cli.js","test:watch":"vitest","build:watch":"tsc --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"henryreith","email":"henry@henryreith.co"},"repository":{"url":"git+https://github.com/henryreith/notion-cli.git","type":"git"},"_npmVersion":"11.6.4","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","directories":{},"_nodeVersion":"25.2.1","dependencies":{"conf":"^13.0.0","open":"^10.1.0","chalk":"^5.3.0","commander":"^12.1.0","cli-table3":"^0.6.5","@notionhq/client":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","vitest":"^3.0.0","typescript":"^5.8.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/notion-agent-cli_0.1.0_1773374473245_0.8343835664223811","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"notion-agent-cli","version":"0.1.1","keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","_id":"notion-agent-cli@0.1.1","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"dist":{"shasum":"dc8a7393c45ea78b70f57758ffa8e381647eed6b","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.1.1.tgz","fileCount":46,"integrity":"sha512-i1GiLqgOLpXfQ0OiTacJJbDkNL/pSeZPQzBdLk6+btc5guedUSlRULRA4KbjQ8CZIMc3vPFGlA9qv2bkaX/Pgg==","signatures":[{"sig":"MEUCIQCdsjehuM5S+JYUmg9U8FzQGBj77VIUnv7YoitWjXeNZAIgfBRY2OKvTP83OWVIOALKrNX/KC74raaNU8ac0rZUUV4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130939},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"7b69c218f3dcaaa612713f8c4788f225157aadef","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc && chmod +x dist/cli.js","version":"node scripts/sync-version.js","test:watch":"vitest","build:watch":"tsc --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"henryreith","email":"henry@henryreith.co"},"repository":{"url":"git+https://github.com/henryreith/notion-cli.git","type":"git"},"_npmVersion":"11.6.4","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","directories":{},"_nodeVersion":"25.2.1","dependencies":{"conf":"^13.0.0","open":"^10.1.0","chalk":"^5.3.0","commander":"^12.1.0","cli-table3":"^0.6.5","@notionhq/client":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","vitest":"^3.0.0","typescript":"^5.8.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/notion-agent-cli_0.1.1_1773560984608_0.28567650074029327","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"notion-agent-cli","version":"0.2.1","keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","_id":"notion-agent-cli@0.2.1","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"dist":{"shasum":"7c152fd7ba325fe67e7f2417405de4fe60171954","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.2.1.tgz","fileCount":72,"integrity":"sha512-ELRlHJ1tWW1yXhN/6P0bGMwlOxTFc3qhYR+Z6U5nRt6Wp2GL7vGMil3qKwNyV+/FAxP7PZxMb9zbdCzlYA3nOg==","signatures":[{"sig":"MEUCIFLD0IIx5bD9mY5aL5YaJFMAjsIIpT3xcb1IewjuA8UzAiEAutvAtsoS+MTgiDc7LhQypzeSBKSpT/w9SHm0dzrPru0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/notion-agent-cli@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":195394},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"1e0b88a9637f70e1f4da3cae1e198b91c2942d2c","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc && chmod +x dist/cli.js","version":"node scripts/sync-version.js","test:watch":"vitest","build:watch":"tsc --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e3e7d5ce-98d1-44fa-86ba-f123876cf16e"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/henryreith/notion-cli.git","type":"git"},"_npmVersion":"11.18.0","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","directories":{},"_nodeVersion":"24.18.0","dependencies":{"open":"^10.1.0","commander":"^12.1.0","cli-table3":"^0.6.5","@notionhq/client":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","vitest":"^3.0.0","typescript":"^5.8.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/notion-agent-cli_0.2.1_1783070213601_0.3378216433156296","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"notion-agent-cli","version":"0.2.2","keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","_id":"notion-agent-cli@0.2.2","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"dist":{"shasum":"ecf883e3e65a3846063c4a024256e20c0438d6ce","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.2.2.tgz","fileCount":80,"integrity":"sha512-qh+rIZhLtWmtUZZLn9AXjFuy7XiMHHxmu8Pg8XF3k1k6DHv5jbP401QiInc6LhZGg0ylI1MLqtBD18bX0Rm4RQ==","signatures":[{"sig":"MEQCIB6uw1bHjZ3OMsxNaR1FYMnZYj9PTt60AQ7O5KiB3aaSAiBkPIs9obmFBer88E7a+1cpP8oPsC5wKJJIAWuAeaqa9A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/notion-agent-cli@0.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":224003},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"0bf3dfc4e9e0e9fa362b2b2fb9dd693c1db5dbf7","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc && chmod +x dist/cli.js","version":"node scripts/sync-version.js","test:watch":"vitest","build:watch":"tsc --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e3e7d5ce-98d1-44fa-86ba-f123876cf16e"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/henryreith/notion-cli.git","type":"git"},"_npmVersion":"11.18.0","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","directories":{},"_nodeVersion":"24.18.0","dependencies":{"open":"^10.1.0","commander":"^12.1.0","cli-table3":"^0.6.5","@notionhq/client":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","vitest":"^3.0.0","typescript":"^5.8.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/notion-agent-cli_0.2.2_1783137148723_0.38077843348856955","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"notion-agent-cli","version":"0.2.3","keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","_id":"notion-agent-cli@0.2.3","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"dist":{"shasum":"db687f1e36bbceb1aeaaa792301d1bc3356bfabd","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.2.3.tgz","fileCount":85,"integrity":"sha512-zGPHSlcoXjJoMBiq66ZwZj1h4Fc2q1nEOzOdgKACkBPo9ltdjn2hTuMT9giU+kxt3Tw/Py+Vx5KuV2RUOlAG4A==","signatures":[{"sig":"MEYCIQCN4uoWDo0Dd/90VhpIJFGpKE5RR/F6uhyUzoegC8XlEgIhANP4E80FkgWjITkhOY6l+w4p7kooEqblg1QyiKuhLHYN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/notion-agent-cli@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":241241},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"27e062d4194e2a91971fb6c094c0706b188ea9fb","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsc && chmod +x dist/cli.js","version":"node scripts/sync-version.js","test:watch":"vitest","build:watch":"tsc --watch","test:coverage":"vitest run --coverage","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e3e7d5ce-98d1-44fa-86ba-f123876cf16e"}},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/henryreith/notion-cli.git","type":"git"},"_npmVersion":"11.18.0","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","directories":{},"_nodeVersion":"24.18.0","dependencies":{"open":"^10.1.0","commander":"^12.1.0","cli-table3":"^0.6.5","@notionhq/client":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","vitest":"^3.0.0","typescript":"^5.8.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/notion-agent-cli_0.2.3_1783140443413_0.942491355915918","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"notion-agent-cli","version":"0.2.4","description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","type":"module","bin":{"notion":"dist/cli.js","notion-agent":"dist/cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc && chmod +x dist/cli.js","build:watch":"tsc --watch","dev":"tsx src/cli.ts","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","version":"node scripts/sync-version.js","prepublishOnly":"npm run build && npm test"},"keywords":["notion","cli","api","agent","automation"],"author":{"name":"Henry Reith"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/henryreith/notion-cli.git"},"homepage":"https://github.com/henryreith/notion-cli#readme","bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"engines":{"node":">=18.0.0"},"dependencies":{"@notionhq/client":"^5.0.0","cli-table3":"^0.6.5","commander":"^12.1.0","open":"^10.1.0"},"overrides":{"esbuild":"^0.28.1"},"devDependencies":{"@types/node":"^22.0.0","tsx":"^4.19.0","typescript":"^5.8.0","vitest":"^3.0.0","yaml":"^2.9.0"},"gitHead":"93c5a1ceef88697ccae80f0630d7992c8bb41c0e","_id":"notion-agent-cli@0.2.4","_nodeVersion":"24.18.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-GdfHkhG4OcLRlah/J243Z0j7N7Tfo8EfQoChEpe3oObMj1HCd9J8ETk0khV0YBWb9vEZxxe0CUbwX+g29gLfFA==","shasum":"448a436f4faf216ac6215a4bcfdb6908cdd57c2c","tarball":"https://registry.npmjs.org/notion-agent-cli/-/notion-agent-cli-0.2.4.tgz","fileCount":89,"unpackedSize":261158,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/notion-agent-cli@0.2.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCg/sTdeCHIu5+6oVQYJWeJtBMSkdNhGYRwROiBx3eoBwIgXShiBX9/WfMJdEG/QuLdxxnqVoHQxckn2HKj6mibS6o="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e3e7d5ce-98d1-44fa-86ba-f123876cf16e"}},"directories":{},"maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/notion-agent-cli_0.2.4_1783256170578_0.46089234646127886"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-13T04:01:13.072Z","modified":"2026-07-05T12:56:11.042Z","0.6.0":"2026-03-11T19:02:05.043Z","0.1.0":"2026-03-13T04:01:13.381Z","0.1.1":"2026-03-15T07:49:44.764Z","0.2.1":"2026-07-03T09:16:53.786Z","0.2.2":"2026-07-04T03:52:28.857Z","0.2.3":"2026-07-04T04:47:23.528Z","0.2.4":"2026-07-05T12:56:10.720Z"},"bugs":{"url":"https://github.com/henryreith/notion-cli/issues"},"author":{"name":"Henry Reith"},"license":"MIT","homepage":"https://github.com/henryreith/notion-cli#readme","keywords":["notion","cli","api","agent","automation"],"repository":{"type":"git","url":"git+https://github.com/henryreith/notion-cli.git"},"description":"Zero-overhead CLI for the Notion API — for AI agents, scripts, and automation","maintainers":[{"name":"henryreith","email":"henry@henryreith.co"}],"readme":"# notion-agent-cli\n\n[![npm version](https://img.shields.io/npm/v/notion-agent-cli)](https://www.npmjs.com/package/notion-agent-cli)\n[![npm downloads](https://img.shields.io/npm/dm/notion-agent-cli)](https://www.npmjs.com/package/notion-agent-cli)\n[![unpacked size](https://img.shields.io/npm/unpacked-size/notion-agent-cli)](https://www.npmjs.com/package/notion-agent-cli)\n[![types](https://img.shields.io/npm/types/notion-agent-cli)](https://www.npmjs.com/package/notion-agent-cli)\n[![Node.js >=18](https://img.shields.io/node/v/notion-agent-cli)](https://www.npmjs.com/package/notion-agent-cli)\n[![provenance](https://img.shields.io/badge/provenance-OIDC_signed-blue)](https://www.npmjs.com/package/notion-agent-cli#provenance)\n[![CI](https://github.com/henryreith/notion-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/henryreith/notion-cli/actions/workflows/ci.yml)\n[![Release](https://github.com/henryreith/notion-cli/actions/workflows/release.yml/badge.svg)](https://github.com/henryreith/notion-cli/actions/workflows/release.yml)\n[![Publish](https://github.com/henryreith/notion-cli/actions/workflows/publish.yml/badge.svg)](https://github.com/henryreith/notion-cli/actions/workflows/publish.yml)\n[![Agent Skills](https://img.shields.io/badge/Agent_Skills-11_skills-8A2BE2)](skills/README.md)\n[![Claude Code plugin](https://img.shields.io/badge/Claude_Code-plugin-D97757)](#claude-code-plugin)\n[![license](https://img.shields.io/github/license/henryreith/notion-cli)](LICENSE)\n[![last commit](https://img.shields.io/github/last-commit/henryreith/notion-cli)](https://github.com/henryreith/notion-cli/commits/main)\n[![stars](https://img.shields.io/github/stars/henryreith/notion-cli)](https://github.com/henryreith/notion-cli/stargazers)\n\n> Zero-overhead Notion CLI for AI agents, shell scripts, and automation.\n> Full parity with the Notion MCP server — without the token cost.\n\n## Why not MCP?\n\nThe Notion MCP server loads **3,000–6,000 tokens** of tool definitions into your context window every session, whether you call Notion once or never. `notion-agent-cli` uses subprocess calls instead — the skill only loads when invoked (~1,000 tokens, once), and costs zero tokens the rest of the session.\n\n**For an agent doing 10 Notion calls in a 50-step workflow:**\n\n| | MCP | notion-agent-cli |\n|---|---|---|\n| Token overhead | ~4,500 tokens (always) | ~1,000 tokens (once) |\n| Server process | Required | None |\n| Extra helpers | — | upsert, batch-add, schema cache, `--add-options`, dry-run |\n\n→ [Full comparison](docs/mcp-vs-cli.md)\n\n## Install\n\n```bash\nnpm install -g notion-agent-cli\nnotion auth setup\n```\n\nRequires Node.js ≥18.\n\n## Quick Start\n\n```bash\n# Interactive auth setup\nnotion auth setup\n\n# Query a database\nnotion db query <db-id> --filter \"Status:=:Active\" --output table\n\n# Add a row\nnotion db add <db-id> Name=\"My Item\" Status=\"Active\" --add-options\n\n# Upsert (insert or update)\nnotion db upsert <db-id> --match Name:\"My Item\" Status=\"Done\"\n\n# Search\nnotion search \"meeting notes\" --type page --output ids\n```\n\n## What's Included\n\nAll 22 Notion MCP tools as CLI commands, plus 10+ higher-level helpers:\n\n### MCP Parity\n\n| Operation | Command |\n|-----------|---------|\n| Query database | `notion db query` |\n| Create page | `notion page create` |\n| Update page | `notion page set` |\n| Get page | `notion page get` |\n| Append blocks | `notion page append` |\n| Delete page | `notion page delete` |\n| Search | `notion search` |\n| List users | `notion user list` |\n| Add comment | `notion comment add` |\n| List comments | `notion comment list` |\n| Get block | `notion block get` |\n| Update block | `notion block update` |\n| Delete block | `notion block delete` |\n\n### CLI-Only Extras\n\n| Feature | Command | Description |\n|---------|---------|-------------|\n| Upsert | `notion db upsert` | Insert or update based on match condition |\n| Bulk insert | `notion db batch-add` | Load JSON array of rows in one shot |\n| Schema cache | automatic | 15-min local cache, skip API round-trips |\n| Auto-create options | `--add-options` | Create missing select options on the fly |\n| Markdown I/O | `notion page append` | Write Markdown, auto-converted to Notion blocks |\n| Dry run | `--dry-run` | Validate without writing (exits 7) |\n| Pagination | `--page-all` | Fetch all pages automatically |\n| IDs output | `--output ids` | One ID per line, perfect for xargs piping |\n\n## Agent Skills (Claude, and any other agent)\n\nEleven ready-made skills live in [`skills/`](skills/) ([index](skills/README.md)),\nfollowing the [Agent Skills](https://agentskills.io) open standard\n(`skills/<name>/SKILL.md`, validated with the official `skills-ref` tool). They\ncost ~0 tokens when idle and only load when the agent decides to call Notion —\nunlike MCP, which loads unconditionally every session. Every documented command\nand flag is CI-validated against the actual CLI, so the skills can't drift from\nthe implementation. Want a workflow we don't ship? See\n[Build your own skill](skills/README.md#build-your-own-skill).\n\n### Claude Code (plugin)\n\n```\n/plugin marketplace add henryreith/notion-cli\n/plugin install notion-agent@notion-cli\n```\n\nThat's it — the skills (`notion-shared`, `notion-db`, `notion-page`, `notion-search`,\n`notion-schema-design`, `notion-reporting`, `notion-capture`, plus the\n`backup-sync`, `crm-pipeline`, `knowledge-base`, and `task-tracker` recipes)\nbecome available in every session.\n\n### Any other agent\n\nThe skills are plain markdown with spec-standard frontmatter (`name`,\n`description`, `compatibility`) — no Claude-specific features. Any agent that\ncan run shell commands can use them: Codex, Cursor, or a personal/home agent\nlike Hermes. To wire one up:\n\n1. `npm install -g notion-agent-cli` and set `NOTION_API_KEY`\n2. Point your agent at the skills, whichever way it ingests context:\n   - copy `skills/` into your agent's skill directory (Agent Skills-compatible tools pick them up as-is)\n   - or drop the SKILL.md contents into its system prompt / knowledge base\n   - the npm package also ships the skills: `node_modules/notion-agent-cli/skills/`\n3. Start with `notion-shared` (auth, IDs, exit codes), add command-group skills as needed\n\nSince the CLI is just a subprocess with JSON output and stable exit codes, any agent\nframework that can execute shell commands gets full Notion access from these docs alone.\n\n## Command Reference\n\n### Auth\n```\nnotion auth setup              # Interactive wizard\nnotion auth set-token <token>  # Store token directly\nnotion auth test               # Verify connection\nnotion auth status             # Show token + workspace\n```\n\n### Database\n```\nnotion db schema <db-id> [--refresh] [--output json|properties|options]\nnotion db query <db-id> [--filter PROP:OP:VALUE]... [--sort PROP] [--limit N] [--page-all] [--output json|table|ids]\nnotion db info <db-id>\nnotion db add <db-id> [KEY=VALUE]... [--data JSON|@file|-] [--add-options] [--output json|id]\nnotion db upsert <db-id> --match PROP:VALUE [--match PROP:VALUE]... [KEY=VALUE]... [--add-options]\nnotion db update-row <page-id> [KEY=VALUE]... [--data JSON]\nnotion db add-option <db-id> <prop> --option NAME [--color COLOR]\nnotion db batch-add <db-id> --data @file|- [--dry-run] [--continue-on-error]\nnotion db create <parent-id> <title> [--data schema-json]\nnotion db delete <db-id> [--confirm]\nnotion db update-schema <db-id> --data JSON|@file\n```\n\n### Page\n```\nnotion page create <parent-id> --title TITLE [--output json|id]\nnotion page get <page-id> [--output json|properties]\nnotion page get-property <page-id> <property-name>\nnotion page set <page-id> [KEY=VALUE]... [--data JSON]\nnotion page append <page-id> --data MARKDOWN|JSON|@file|-\nnotion page delete <page-id> [--confirm]\nnotion page restore <page-id>\nnotion page move <page-id> <new-parent-id>\n```\n\n### Block / Comment / Search / User\n```\nnotion block list <block-id> [--output json|ids]\nnotion block get <block-id>\nnotion block append <block-id> --type TYPE --text TEXT\nnotion block update <block-id> --data JSON|@file\nnotion block delete <block-id> [--confirm]\n\nnotion comment add <page-id> <text>\nnotion comment list <page-id> [--output json|ids]\n\nnotion search [QUERY] [--type page|database] [--sort last_edited|relevance] [--limit N] [--page-all] [--output json|ids]\n\nnotion user list [--output json|ids]\nnotion user get <user-id>\nnotion user me\n```\n\n→ [Full command reference with examples](docs/commands.md)\n\n## For AI Agents\n\n```bash\n# Set env vars — no prompts, no config file needed\nexport NOTION_API_KEY=ntn_xxxx...\nexport NOTION_MODE=auto\n\n# All commands output JSON to stdout, errors as JSON to stderr\nnotion db query <db-id> --output json\nnotion db add <db-id> Name=\"Task\" Status=\"Active\" --output id\n\n# Pipe IDs through xargs\nnotion db query <db-id> --filter \"Status:=:Done\" --output ids \\\n  | xargs -I{} notion page delete {} --confirm\n```\n\n**Delete safety:** in non-interactive mode, `page delete`, `db delete`, and\n`block delete` refuse with exit 3 unless `--confirm` is passed — so a script or\nagent can never delete by accident. Set `NOTION_AUTO_CONFIRM=1` to skip the gate\nin trusted pipelines.\n\n**Exit codes** — machine-readable, always:\n\n| Code | Meaning |\n|------|---------|\n| 0 | Success |\n| 1 | Auth failed |\n| 2 | Not found |\n| 3 | Validation error |\n| 4 | API error |\n| 5 | Already exists |\n| 6 | Upsert ambiguous |\n| 7 | Dry run |\n\n→ [Agent patterns cookbook](docs/agent-patterns.md)\n\n## `--data` Input\n\nMany commands accept `--data` in three forms:\n- `--data '{\"key\": \"value\"}'` — inline JSON\n- `--data @path/to/file.json` — read from file\n- `--data -` — read from stdin\n\n## Contributing\n\n```bash\ngit clone https://github.com/henryreith/notion-cli\ncd notion-cli\nnpm install\nnpm run build\nnpm test\n```\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}