@tvashtr/cli
v1.0.2
Published
> Local developer scaffolding CLI to spin up fully configured, white-label e-commerce storefronts in seconds.
Downloads
56
Readme
tvashtr-cli
Local developer scaffolding CLI to spin up fully configured, white-label e-commerce storefronts in seconds.
tvashtr-cli is the command-line utility for the Tvashtr Suite monorepo. It automates the creation of new tenant storefronts, copying a boilerplate template and pre-configuring names and environment variables so you can focus entirely on branding and catalog sheets.
🚀 Scaffolding a New Store
You can execute the CLI tool directly from the root of the monorepo workspace:
npx tvashtr create <your-store-name>🛠️ How it Works under the Hood
When you execute create <project-name>, the CLI script (bin/tvashtr.js) automates these standard setup tasks:
- Safety Boundary: Verifies if
apps/<your-store-name>already exists, preventing accidental directory overwrites. - Template Replication: Recursively copies files from the
packages/tvashtr-cli/templatedirectory into the newapps/<your-store-name>workspace. - Identity Setup: Parses
package.jsonin the newly scaffolded app, dynamically replacing the generic"name": "store-template"value with your chosen<your-store-name>. - Environment Initialization: Automatically copies
.env.exampleinto a local.envfile, allowing you to configure backend secrets instantly.
📁 Scaffolded Template Structure
The boilerplate template contains everything needed to run a production-grade store on Cloudflare Pages and Workers:
apps/<your-store-name>/
├── app/
│ ├── assets/
│ │ └── main.css # Custom Tailwind v4 styling variables
│ └── app.vue # Entrypoint layout
│
├── cloudflare/
│ ├── schema.sql # D1 Database SQLite schema definition
│ └── wrangler.toml # Cloudflare pages deployment configurations
│
├── .env.example # Template environment variables
├── app.config.ts # Nuxt App options
├── nuxt.config.ts # Nuxt 4 configs extending @tvashtr/ui Layer
├── store.config.ts # Store Branding Single Source of Truth
└── tailwind.config.ts # Store Tailwind overrides🛠️ Next Steps After Scaffolding
Once scaffolded, launch your store using simple shell commands:
# 1. Enter the app directory
cd apps/<your-store-name>
# 2. Run the development server
npm run dev🏗️ Design Philosophy
- Zero External Dependencies: The CLI employs only native Node.js core libraries (
fs,path,url), keeping execution fast, safe, and independent of external package installations. - Deterministic Boilerplates: Scaffolds standard config patterns that seamlessly link to the
@tvashtr/uilayer, ensuring any platform updates immediately apply to all tenant stores. - No-Code Brand Configuration: Standardizes custom styling around the
store.config.tsandapp/assets/main.cssfiles, separating e-commerce logic from storefront branding.
