smol-cli
v0.1.3
Published
CLI and framework tools for smol.js
Readme
@smol/cli
Command line tools for smol.js - The minimal Web Component framework
Installation
npm install -g @smol/cliOr run via npx:
npx @smol/cli <command>Commands
smol new <type> <name>
Scaffolds new projects, libraries, components, or services.
Types
project Creates a new full-stack SSR application.
smol new project my-appFeatures: Vite, SSR, Express server, Auto-hydration
library Creates a reusable component library.
smol new library my-libFeatures: TypeScript, Storybook, Example component, Vite lib mode
component creates a new Web Component bundle in
src/components/.smol new component my-buttonCreates:
my-button.ts,my-button.html,my-button.cssservice Creates a new global state service in
src/services/.smol new service authCreates:
auth-service.ts
smol dev
Starts the development server with Hot Module Replacement (HMR).
smol dev
# Options:
# -p, --port <port> Port number (default: 3000)smol build
Builds the project for production.
smol build
# Options:
# --ssr Build with Server-Side Rendering support (generates dist/client and dist/server)smol ssr
Starts the production SSR server. Expects a built project (run smol build --ssr first).
smol ssr
# Options:
# -p, --port <port> Port number (default: 4000)Templates
The CLI includes templates for:
Smol Project (App)
- Vite config with SSR plugin
- Express server for SSR preview
- Client-side hydration
- HTML template plugin setup
Smol Library
- Vite library mode configuration
- Storybook 8 with Web Components support
- Type declaration generation (
d.ts)
License
MIT
