@embeddables/cli
v0.16.12
Published
This repo is the source for **@embeddables/cli** — the CLI for authoring and managing Embeddables locally with TypeScript/TSX. If you only want to _use_ the CLI, see the [package on npm](https://www.npmjs.com/package/@embeddables/cli) or the [user-facing
Keywords
Readme
Embeddables CLI (development)
This repo is the source for @embeddables/cli — the CLI for authoring and managing Embeddables locally with TypeScript/TSX. If you only want to use the CLI, see the package on npm or the user-facing README (same content as the npm package page).
Prerequisites
- Node.js >= 18.0.0
Setup
git clone <this-repo>
cd embeddables-cli
npm installScripts
| Script | Description |
| ----------------------- | ----------------------------- |
| npm run build | Compile TypeScript to dist/ |
| npm run build:watch | Watch and recompile on change |
| npm test | Run tests (Vitest) |
| npm run test:watch | Run tests in watch mode |
| npm run test:coverage | Coverage report |
| npm run lint | ESLint |
| npm run format | Prettier (write) |
| npm run format:check | Prettier (check only) |
| npm run build-workbench | Build Workbench bundle for CDN (e.g. -- --out workbench-worker) |
Local testing
After building, link the CLI so you can run embeddables from another project:
npm run build
npm linkThen in a project that uses the CLI (e.g. an embeddables app), run embeddables <command> — it will use your linked build. Unlink with npm unlink -g @embeddables/cli when done.
You can also run the CLI without installing, from this repo:
npx tsx src/cli.ts dev
# or
npx tsx src/cli.ts build -i <embeddable-id>Project structure
src/cli.ts— Commander setup and command registrationsrc/commands/— Implementations forinit,login,logout,pull,branch,build,save,devsrc/compiler/— TSX → JSON compile and JSON → TSX reverse-compilesrc/config/—embeddables.jsonand project configsrc/auth/— Login/logout and token storagesrc/prompts/— Interactive prompts (projects, embeddables, branches)src/proxy/— Dev server and engine proxysrc/workbench/— Visual debugging UI and CDN build script (build.ts)src/components/— React primitives exported as@embeddables/cli/componentsbin/embeddables.mjs— Entry script that runsdist/cli.jsscripts/run-build-workbench.ts— Entry fornpm run build-workbench(invokessrc/workbench/build.tsfor CDN deploy)tests/— Unit and integration tests (Vitest)
Publishing
The user-facing README is in package-readme.md. It is swapped in as README.md during npm pack / npm publish via prepack/postpack scripts so the npm package shows the right docs. Do not remove those scripts.
User documentation
Full command reference, installation, and usage for people who install the package: package-readme.md.
