create-presmium

中文文档
1.0.0-rc.18发布于 2026/11/03Apache-2.0ES Module

presmium new, or pnpm create presmium: a new Presmium lecture, workspace or plugin

原始使用文档

create-presmium

Starts a new Presmium project: a lecture, a workspace, a themed site or a plugin. presmium new (from pnpm add -g @lincyaw/presmium) runs it; so does pnpm create presmium.

presmium new
presmium new my-lecture --type lecture --title "Tokenization"
presmium new my-course --type workspace --title "Data structures"
presmium new my-site --type site --theme course --title "My course"
presmium new presmium-plugin-greeting --type plugin --name presmium-plugin-greeting

Without arguments it asks for the kind of project, the directory and the title (or, for a plugin, the package name).

OptionWhat
--type <kind>lecture (one document), workspace (documents previewed with presmium serve), site (a themed workspace with a homepage and GitHub Pages workflow) or plugin
--theme <name>For site: course (default), docs or showcase
--title <text>The lecture's or the workspace's title (default: the directory's name)
--name <name>The plugin's package name (default: the directory's name)
--no-gitDo not run git init
-h, --helpShow the help
  • A lecture: lecture.json; presmium dev, presmium check, presmium build.
  • A workspace: presmium.workspace.yaml and a first document in intro/; presmium serve.
  • A site: presmium.workspace.yaml, an independent homepage in site/home.json, a teaching document in intro/lecture.json, and .github/workflows/pages.yml; pnpm install, pnpm serve, pnpm build.
  • A plugin: a directive, a React component shown in the web page and the slides, a server route, text in Chinese and English, an example document and integration tests; pnpm install, pnpm test, pnpm dev.

Lectures, workspaces and sites list presmium at create-presmium's own version as a dev dependency, so pnpm install pins it; without it the global presmium builds them. Each project gets an AGENTS.md (CLAUDE.md links to it) and copies of the Presmium skills for coding agents in .agents/skills. The text of the questions and of the new files follows the system's language (Chinese or English).

Themed site

presmium new my-site --type site --theme showcase --title 'My work'
cd my-site
pnpm install
pnpm serve

Edit site/home.json to design the homepage and intro/lecture.json for the first teaching document. site.landing.source selects the homepage file; homepage content has its own structure, while teaching documents retain lecture.json as their sole content authority. Change site.theme and site.params in presmium.workspace.yaml to personalize the site. pnpm build exports dist/web/.

For your own HTML, CSS and JavaScript, replace the landing configuration with site.landing: { template: './site/home.html' }. The HTML entry and its local assets are bundled for static hosting; script#presmium-site-data provides the site's public document links. Refresh the homepage to rebuild that template during pnpm serve; template hot updates are not provided.

Push the project to a GitHub repository, select GitHub Actions in Settings → Pages → Build and deployment → Source, then run the generated Pages workflow or push to its configured branch. It reads the repository's Pages base path, builds the site and deploys dist/web/. The build remains an ordinary static site that can be hosted elsewhere.

See the site theme guide for the three presets, supported parameters and page layouts.

License: Apache-2.0.

版本与发布记录

create-presmium 共发布 19 个版本,首次发布于 2026/10/20;过去 12 个月发布了 19 个版本。

版本发布日期距今
1.0.0-rc.18latest2026/11/03今天
1.0.0-rc.162026/11/021 天前
1.0.0-rc.152026/11/021 天前
1.0.0-rc.142026/11/012 天前
1.0.0-rc.132026/10/312 天前
1.0.0-rc.122026/10/312 天前

关于 create-presmium 的常见问题

create-presmium 是什么?

premium new,或pnpm创建premium:一个新的premium讲座,工作区或插件

如何安装 create-presmium?

在项目目录运行 npm install create-presmium,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 create-presmium,可以用 npx create-presmium 直接运行。

create-presmium 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/create-presmium 是否存在。

create-presmium 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

create-presmium 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.19。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

create-presmium 可以商用吗?

create-presmium 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

create-presmium 还在维护吗?

最新版本 1.0.0-rc.18 发布于 2026/11/03(今天);至今共发布 19 个版本,其中过去 12 个月发布了 19 个;首次发布于 2026/10/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。