概要
pullコマンドは、NotionデータベースからTypeScriptスキーマを生成または更新します。
実行内容
- データベースの構造とプロパティを取得
- TypeScript型を生成
- スキーマファイルを更新
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
NotionデータベースからTypeScriptスキーマを生成
pullコマンドは、NotionデータベースからTypeScriptスキーマを生成または更新します。
npx notcms-kit pull
| オプション | 説明 | デフォルト |
|---|---|---|
--env | 環境ファイルのパス | [".env", ".env.local", ".dev.vars"] |
npx notcms-kit pull
npx notcms-kit pull --env .env.development
import { Schema } from 'notcms';
export const schema = {
// 例
blog: {
id: "abc123...",
properties: {
title: "title",
content: "rich_text",
published: "checkbox",
publishDate: "date",
author: "relation",
tags: "multi_select"
}
}
} satisfies Schema;
{
"scripts": {
"schema:pull": "notcms-kit pull",
}
}