@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
bunandbunx, notnpx.
--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.transcriptioncaptions speech on the glasses and the phone page.display.renderdraws 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.inputgestures: tap pauses, swipe scrolls back through the history, and hold reads the shown line aloud withsession.speaker.session.storagekeeps 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.