@elenajs/cli
v1.0.0
Published
Elena CLI for scaffolding Progressive Web Components.
Downloads
124
Readme
Elena CLI for scaffolding Progressive Web Components
Table of contents
Install
npm install --save-dev @elenajs/cliUsage
Interactive mode
Run without arguments to be guided through all options:
npx elena-createWith a component name
Pass a kebab-case name (must contain at least one hyphen) to skip the name prompt:
npx elena-create my-button
npx elena-create my-stackPrompts
The CLI walks you through the following steps:
| Prompt | Description | Default |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------- | ---------------- |
| Component name | Kebab-case name with at least one hyphen (e.g. my-button, my-stack). Skipped if passed as argument. | |
| Component features | Feature toggles for the generated code. See Component features below. | None selected |
| Language | JavaScript, TypeScript, or HTML. | |
| Output directory | Where to generate the component folder. | src/components |
Component features
Toggle features to include in the generated code:
| Option | Description |
| --------------------- | ----------------------------------------------------------------------- |
| Props | Adds example props with @property / @type JSDoc annotations. |
| Events | Adds events option and @event JSDoc annotations. |
| Methods | Adds an example method stub. |
| CSS Variables | Adds @cssprop JSDoc annotations and CSS custom property declarations. |
| CSS Encapsulation | Adds the all: unset reset to prevent global styles from leaking in. |
| CSS Pre-hydration | Adds :scope:not([hydrated]) styles for pre-hydration rendering. |
| Code Comments | Includes JSDoc annotations and CSS comments in the generated code. |
Generated files
For a component named my-button, the CLI creates:
src/components/my-button/
├── my-button.js (or .ts)
└── my-button.cssWhen using the HTML language, a single file is generated instead:
src/components/my-button/
└── my-button.htmlThe generated files include:
Elena()factory withtagNameand optionalprops/events- A
render()method returning anhtmltagged template - JSDoc annotations for
@displayNameand@status, plus@eventand@csspropwhen selected - Scoped CSS with
@scope, optional encapsulation reset, and CSS custom properties
License
MIT
Copyright
Copyright © 2026 Ariel Salminen
