使用 Tiptap CLI
Tiptap CLI 帮助您快速搭建编辑器,安装 UI 组件或原件,并更快地配置 Tiptap。它消除了大量的手动工作,让您能够更快地开始构建编辑器功能。
它是为 Vite 或 Next.js 项目设计的。如果您使用其他框架,您需要从 开源代码库 手动集成 Tiptap。
使用方法
npx @tiptap/cli@latest [command] [options]命令
init
初始化您的项目并安装依赖项。此命令设置您的项目配置并添加任何指定的组件。
npx @tiptap/cli@latest init参数
- components: 要添加的组件
选项
Usage: @tiptap/cli@latest init [options] [components...]
Options:
-f, --framework <framework> 要使用的框架(例如:next, vite)
-c, --cwd <cwd> 工作目录(默认为当前目录)
-s, --silent 静默输出
--src-dir 创建新项目时使用 src 目录add
向您的项目添加一个或多个 Tiptap UI 组件或模板。
npx @tiptap/cli@latest add [components...]示例
npx @tiptap/cli@latest add button选项
Usage: @tiptap/cli@latest add [options] [components...]
Arguments:
components 要添加的组件
Options:
-o, --overwrite 覆盖已存在的文件
-c, --cwd <cwd> 工作目录(默认为当前目录)
-p, --path <path> 添加组件的路径
-s, --silent 静默输出info
获取有关您的项目配置和设置的信息。
npx @tiptap/cli@latest info选项
Usage: @tiptap/cli@latest info [options]
Options:
-c, --cwd <cwd> 工作目录(默认为当前目录)login
登录到您的 Tiptap Cloud 账户,以访问付费组件和模板。
npx @tiptap/cli@latest login选项
Usage: @tiptap/cli@latest login [options]
Options:
-e, --email <email> 您的账户邮箱
-p, --password <password> 您的账户密码
--write-config 将认证令牌写入包管理器配置
-c, --cwd <cwd> 工作目录(默认为当前目录)logout
登出您的 Tiptap Cloud 账户。
npx @tiptap/cli@latest logoutstatus
查看您的 Tiptap Cloud 身份验证状态和激活的计划。
npx @tiptap/cli@latest status选项
Usage: @tiptap/cli@latest status [options]
Options:
-c, --cwd <cwd> 工作目录(默认为当前目录)