npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

safe-notion

v0.2.0

Published

A safe Notion API wrapper CLI for AI agents with granular permission control

Readme

safe-notion

AIエージェント向けの安全なNotion APIラッパーCLI。きめ細かな権限制御により、AIエージェントとNotion API間のセキュリティレイヤーとして機能します。

特徴

  • きめ細かな権限制御: resource:operation 形式(例: page:read, database:query)で操作を制限
  • 階層認識: 子ページは親ページのルールを継承
  • 条件付きアクセス: Notionプロパティの値に基づいたアクセス制御
  • デフォルト拒否: 明示的に許可されない限り、すべての操作を拒否

インストール

npm install -g safe-notion

設定

環境変数

export NOTION_TOKEN="your-notion-integration-token"

設定ファイル

設定ファイルを初期化:

safe-notion config init

設定ファイルの場所: ~/.config/safe-notion/config.jsonc

設定例

{
  "rules": [
    {
      // 特定ページとその子孫に読み取り専用アクセス
      "name": "docs-readonly",
      "pageId": "12345678-1234-1234-1234-123456789abc",
      "permissions": ["page:read", "block:read"]
    },
    {
      // データベースへのクエリと新規作成のみ許可
      "name": "tasks-db",
      "databaseId": "87654321-4321-4321-4321-cba987654321",
      "permissions": ["database:read", "database:query", "database:create"]
    },
    {
      // 条件付きアクセス: 担当者が自分の場合のみ更新可能
      "name": "my-tasks-only",
      "databaseId": "87654321-4321-4321-4321-cba987654321",
      "permissions": ["page:update"],
      "condition": {
        "property": "担当者",
        "type": "people",
        "equals": "me"
      }
    }
  ],
  "defaultPermission": "deny"
}

使用可能な権限

| リソース | 権限 | 説明 | |---------|------|------| | Page | page:read | ページの読み取り | | Page | page:update | ページの更新 | | Page | page:create | ページの作成 | | Database | database:read | データベースの読み取り | | Database | database:query | データベースのクエリ | | Database | database:create | データベースへのページ作成 | | Block | block:read | ブロックの読み取り | | Block | block:append | ブロックの追加 | | Block | block:delete | ブロックの削除 |

CLIコマンド

ページ操作

safe-notion page get <page-id>
safe-notion page create --parent <parent-id> --title "タイトル"
safe-notion page update <page-id>

データベース操作

safe-notion db get <database-id>
safe-notion db query <database-id>
safe-notion db create-page <database-id>

ブロック操作

safe-notion block get <block-id>
safe-notion block children <block-id>
safe-notion block append <block-id> --children '<json>'
safe-notion block delete <block-id>

設定管理

safe-notion config init      # 設定ファイルを初期化
safe-notion config validate  # 設定を検証
safe-notion config path      # 設定ファイルのパスを表示

開発

依存関係のインストール

bun install

ビルド

bun run build

型チェック

bun run typecheck

ライセンス

MIT