
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@lpenguin/notion-cli
Advanced tools
CLI tool for reading and editing Notion entries through Markdown and CSV. AI agent friendly.
CLI tool for reading and editing Notion entries through Markdown and CSV. AI agent friendly.
# Run directly with npx
npx notion-cli page read <page-id>
# Or install globally
npm install -g notion-cli
notion-cli page read <page-id>
Set your Notion Integration Token:
export NOTION_TOKEN=ntn_xxx
# Or pass directly
notion-cli --token ntn_xxx page read <page-id>
You can also create a ~/.notion-cli.json config file:
{
"token": "ntn_xxx"
}
| Flag | Description |
|---|---|
--token <token> | Notion API integration token (overrides env/config) |
--json | Structured JSON output for machine consumption |
--dry-run | Preview changes without executing writes |
-v, --verbose | Enable debug output to stderr |
--no-color | Disable colored output |
page read — Read a Notion Page as MarkdownFetch a Notion page and output its content as Markdown. This command is idempotent and read-only.
notion-cli page read <page-id>
Examples:
# Read page content
notion-cli page read abc123def456
# Read as JSON (for scripting)
notion-cli page read abc123def456 --json
When --json is enabled, the output includes pageId, title, and markdown fields. Status messages are always written to stderr, and the markdown content goes to stdout, so you can pipe it safely: notion-cli page read <id> > page.md.
page create — Create a New PageCreate a new Notion page from Markdown content.
notion-cli page create --parent <page-id> --file content.md
notion-cli page create --parent <page-id> --title "My Page" --content "# Hello"
notion-cli page create --parent <db-id> --db --file entry.md
| Option | Description |
|---|---|
--parent <id> | Required. Parent page or database ID |
-f, --file <path> | Path to Markdown file |
--content <markdown> | Inline Markdown content |
--title <title> | Page title (overrides H1 in content) |
--db | Create as a database entry instead of a sub-page |
page write — Replace Page ContentReplace a Notion page's content with new Markdown content. This is a destructive operation that replaces ALL existing content on the page.
notion-cli page write <page-id> --file content.md
notion-cli page write <page-id> --content "# New Content"
cat content.md | notion-cli page write <page-id>
| Option | Description |
|---|---|
-f, --file <path> | Path to Markdown file |
--content <markdown> | Inline Markdown content |
Image Upload Support:
When using page write, images with file:// URLs will be automatically uploaded to Notion's file storage:
# My Page


file:// URLs are uploaded to NotionExamples:
# Replace page content from file
notion-cli page write abc123def456 --file mypage.md
# Replace with inline content
notion-cli page write abc123def456 --content "# Hello\n\nNew content"
# Replace from stdin
echo "# Updated\n\nNew content" | notion-cli page write abc123def456
# Dry run to preview changes
notion-cli page write abc123def456 --file mypage.md --dry-run
⚠️ Warning: This command replaces ALL existing content. For partial edits, use
page patchinstead.
page list — List PagesList or search Notion pages accessible to the integration.
notion-cli page list
notion-cli page list --query "search term" --limit 20
notion-cli page list --cursor <cursor>
Query, export, import, and inspect Notion databases.
db list — List databasesList accessible Notion databases.
notion-cli db list
notion-cli db list --query "Projects" --limit 10
db query — Query DatabaseQuery a Notion database. Outputs CSV by default, JSON with --json.
notion-cli db query <database-id>
notion-cli db query <database-id> --filter '{"property":"Status","select":{"equals":"Done"}}'
db export — Export to CSVExport full Notion database to CSV.
notion-cli db export <database-id> --out data.csv
db import — Import from CSVImport CSV rows into a Notion database.
notion-cli db import <database-id> --file data.csv
notion-cli db import <database-id> --file data.csv --sync
| Option | Description |
|---|---|
-f, --file <path> | Required. Path to CSV file |
--sync | Synchronize mode. Pages in Notion that are NOT in the CSV will be archived (sent to Trash). |
⚠️ Warning on --sync: This mode is destructive. It ensures the database in Notion exactly matches your CSV. If a row exists in Notion but its
_notion_idis missing from your CSV, it will be deleted from the database.
db create — Create DatabaseCreate a new Notion database in a parent page.
notion-cli db create --parent <page-id> --title "My Database"
notion-cli db create --parent <page-id> --title "Tasks" --schema '{"Status": {"select": {}}}'
| Option | Description |
|---|---|
-p, --parent <id> | Required. Parent page ID |
-t, --title <text> | Required. Database title |
-s, --schema <json> | Database schema (Notion properties JSON) |
db schema — Show SchemaShow database property schema.
notion-cli db schema <database-id>
notion-cli search "query"
notion-cli search "query" --type page
notion-cli search "query" --type database
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
2 | Validation error (bad arguments) |
3 | Authentication error |
4 | Not found |
5 | Rate limited |
MIT
FAQs
CLI tool for reading and editing Notion entries through Markdown and CSV. AI agent friendly.
We found that @lpenguin/notion-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.