CLI tools for managing PIE Elements NG - synchronization, package generation, and verification.
From the root of the monorepo:
bun install
cd tools/cli
bun run buildFrom the root of the monorepo:
# Show help
bun run cli --help
# Show command help
bun run cli upstream:sync --helpStart a demo server for an element using apps/element-demo.
# Start demo for an element
bun run cli dev:demo hotspot
# Custom port, skip builds, and don't auto-open browser
bun run cli dev:demo multiple-choice --port 5180 --skip-build --no-openSynchronize code from upstream pie-elements repository.
# Dry run to preview changes
bun run cli upstream:sync --dry-run
# Sync specific element
bun run cli upstream:sync --element multiple-choice
# Sync all compatible elements (controllers + React UI + demos)
bun run cli upstream:sync
# Verbose output
bun run cli upstream:sync --verboseCheck for changes in upstream repositories.
# Check all elements
bun run cli upstream:check
# Check specific element
bun run cli upstream:check --element multiple-choice
# Verbose output
bun run cli upstream:check --verboseTrack upstream repository changes.
# Show new commits since last check
bun run cli upstream:track show
# Record current upstream state
bun run cli upstream:track record
# Compare with specific commit
bun run cli upstream:track compare <commit-sha>Compare dependencies with upstream repositories.
bun run cli upstream:depsAnalyze ESM compatibility of elements and packages.
# Analyze and generate report
bun run cli upstream:analyze-esm
# Verbose output
bun run cli upstream:analyze-esm --verbose
# Custom output path
bun run cli upstream:analyze-esm --output ./my-report.jsonRecommended wrapper that runs analyze + sync.
bun run cli upstream:updateEnable publishing for all @pie-element/* and @pie-lib/* packages (remove private flags and clear matching Changesets ignore entries).
# Dry run
bun run cli packages:enable-publishing --dry-run
# Enable publishing
bun run cli packages:enable-publishingGenerate package.json files for controller packages.
bun run cli packages:create-controllersGenerate configuration files for @pie-lib React packages.
# Dry run
bun run cli packages:create-lib-react --dry-run
# Generate files
bun run cli packages:create-lib-reactGenerate configuration files for React element packages.
bun run cli packages:create-react-elementsInitialize package scaffolding for synced elements.
bun run cli packages:init-synced-elementsGenerate framework-agnostic HTML docs artifacts for elements from per-element docs.contract.json descriptors.
The element demo runs this during prebuild/predev; the generated static/element-docs
directory is a local build artifact and is not committed.
# Generate docs for all elements
bun run cli docs:generate
# Generate for one framework/element
bun run cli docs:generate --framework svelte --element simple-cloze
# Seed missing contracts before generation
bun run cli docs:generate --seed-contractsVerify that all targeted elements have valid docs.contract.json descriptors and that local generated docs match the current generator output.
# Verify all frameworks
bun run cli docs:verify
# Verify one framework/element
bun run cli docs:verify --framework svelte --element simple-clozeVerify controller package exports before publishing.
bun run cli verify:controllersVerify that all React elements build successfully.
bun run cli verify:react-buildInspect package imports and classify dependency usage as direct, transitive, hoist-reliant, or broken.
# Scan all element/lib-react packages
bun run cli verify:dependency-integrity
# Scan one package
bun run cli verify:dependency-integrity --package @pie-element/ebsr
# Fail on hoist-reliant imports too (not only broken)
bun run cli verify:dependency-integrity --fail-on-hoist# Build the CLI
bun run build
# Run in development mode (with source maps)
bun run dev upstream:sync --help
# Lint
bun run lintThe CLI is built with oclif, following the same architecture as the pie-qti CLI.
- Commands: Located in
src/commands/organized by topic - Utilities: Shared utilities in
src/utils/ - Topics: Commands are grouped into topics (upstream, packages, docs, verify)
This CLI replaces the scripts in ./scripts directory:
| Old Script | New CLI Command |
|---|---|
bun scripts/sync-upstream.ts |
bun run cli upstream:sync |
bun scripts/check-upstream.ts |
bun run cli upstream:check |
bun scripts/track-upstream.ts show |
bun run cli upstream:track show |
bun scripts/check-deps.ts |
bun run cli upstream:deps |
bun scripts/analyze-esm-compatibility.ts |
bun run cli upstream:analyze-esm |
bun scripts/enable-react-publishing.ts |
bun run cli packages:enable-publishing |
bun scripts/create-controller-packages.ts |
bun run cli packages:create-controllers |
bun scripts/create-lib-react-packages.ts |
bun run cli packages:create-lib-react |
bun scripts/create-react-packages.ts |
bun run cli packages:create-react-elements |
bun scripts/verify-react-build.ts |
bun run cli verify:react-build |
Same as parent project.