@glassly/create-miniapp

中文文档
0.1.16发布于 2026/11/16ES Module近 30 天下载 5586

Scaffold a new Glassly miniapp project

原始使用文档
文档目录4 节
  1. Usage
  2. --prefix
  3. The starter
  4. Part of Glassly

@glassly/create-miniapp

Scaffold a new Glassly miniapp project. This is the bun create starter for apps that run on Glassly smart glasses.

Usage

bunx @glassly/create-miniapp my-app
cd my-app
bun install
glassly dev    # load it on a phone (prints a QR)
glassly sim    # or run it on this computer, no phone or glasses

glassly comes from bun add -g @glassly/cli; inside a project it runs the project's own copy. glassly update moves the project to the newest SDK and tools.

The scaffolder and the generated project's tooling run under Bun only. Use bun and bunx, not npx.

--prefix

Every miniapp lives under its developer org's reverse-DNS package prefix (set when you create the org in the Developer Console, for example com.example). The scaffolder asks for it and writes <prefix>.<project_name> into miniapp.json as the packageName, with dashes in the project name turned into underscores so the name is valid. The Store rejects releases outside your org's prefix, so use the real one. Pass --prefix to skip the prompt:

bunx @glassly/create-miniapp my-app --prefix=com.example

Use the --prefix=value form; a space-separated --prefix value is not parsed.

The starter

The generated project is a small live-captions miniapp that touches the main parts of the API, each in a few lines:

  • session.transcription captions speech on the glasses and the phone page.
  • display.render draws a scene with text, a rule, a mic indicator, and a scroll bar that animates, plus a card that slides in over the captions.
  • session.input gestures: tap pauses, swipe scrolls back through the history, and hold reads the shown line aloud with session.speaker.
  • session.storage keeps the history across restarts.

The scene is built by a pure function in src/background/scene.ts, with tests beside it, so you can change the glasses layout and check it with bun test before you look at it in glassly sim.

The generated project comes wired with @glassly/miniapp (the SDK runtime) and @glassly/cli (the glassly command: dev, release, pack, publish), a miniapp.json manifest, and a TypeScript setup. Dependency pins are stamped at publish time to the exact SDK versions this scaffolder shipped with, so a generated project installs on any release channel.

To publish a finished miniapp to the Glassly Miniapp Store, run glassly login once and then glassly publish from the project folder.

Part of Glassly

Source lives in the Glassly monorepo under sdk/create-miniapp. Issues and contributions welcome there.

版本与发布记录

@glassly/create-miniapp 共发布 59 个版本,首次发布于 2026/08/30;过去 12 个月发布了 59 个版本。

版本发布日期距今
0.1.16latest2026/11/16今天
0.1.16-beta.0beta2026/11/16今天
0.1.16-dev.0dev2026/11/16今天
0.1.152026/11/16今天
0.1.15-beta.02026/11/16今天
0.1.15-dev.02026/11/16今天

关于 @glassly/create-miniapp 的常见问题

@glassly/create-miniapp 是什么?

Scaffold a new Glassly miniapp project

如何安装 @glassly/create-miniapp?

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

@glassly/create-miniapp 支持 TypeScript 吗?

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

@glassly/create-miniapp 支持 ESM 还是 CommonJS?

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

@glassly/create-miniapp 可以商用吗?

@glassly/create-miniapp 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@glassly/create-miniapp 的下载量有多少?

根据 npm 官方下载统计,@glassly/create-miniapp 在 2026/10/17 – 2026/11/15 这 30 天内被下载 5,586 次,日均约 186 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@glassly/create-miniapp 还在维护吗?

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