Skip to content

Repository files navigation

@waelio/cli

npm version license node

TypeScript CLI + browser UI toolkit for building waelio/siteforge from the terminal or a local web interface.

πŸ”— Live demo: cli.waelio.workers.dev

Built with Vite 8 Β· TypeScript Β· Vue 3 Β· Commander.


✨ Features

  • 🩺 Doctor β€” checks that required local tools are installed
  • πŸ“‹ Dry-run β€” previews the build plan before running it
  • πŸ”§ Build β€” clones waelio/siteforge, installs deps, and runs the build
  • πŸ—οΈ Scaffold β€” generates full Next.js + NestJS projects from a blueprint JSON
  • πŸ–₯️ Browser UI β€” a Vue dashboard with live logs, scaffold forms, and public site listings
  • 🌐 12 locales β€” ar de en es fr he id it ru sv tr zh (RTL-ready)

πŸ“¦ Install

Run without installing:

npx @waelio/cli --help

Or install globally:

npm install -g @waelio/cli

πŸš€ CLI Commands

waelio --help

Print the top-level help and list all available commands.

waelio doctor

Check that all required tools (git, npm, go) are installed and accessible:

waelio doctor

waelio build

Clone and build the waelio/siteforge website:

waelio build

Options:

Flag Description Default
--repo <url> Custom repository URL waelio/siteforge
--ref <ref> Branch, tag, or commit to checkout main
--source <path> Skip cloning, use an existing checkout β€”
--workdir <path> Directory to clone into ./tmp
--dry-run Print the plan without running anything false

Examples:

# default β€” clone and build waelio/siteforge
waelio build

# preview what would happen without executing
waelio build --dry-run

# build a specific branch
waelio build --ref feat/new-homepage

# build from a local checkout
waelio build --source ~/Code/GitHub/waelio/siteforge

# build a fork
waelio build --repo https://github.com/yourname/siteforge.git

waelio ui

Start the local web UI and API server:

waelio ui
waelio ui --port 4000   # default: 3011

Open http://localhost:3011 in your browser.

UI Views:

View Description
Scaffold Form-based generator to produce and deploy Siteforge blueprints
Public Sites Dashboard listing scaffolded client sites served via /api/public-sites
Negotiation Manage 2-AI negotiation sessions (kickoff, auth, status, handoff) via proxied API routes

waelio scaffold <blueprint>

Scaffold a full Next.js (frontend) + NestJS (backend) project from a Siteforge blueprint JSON:

waelio scaffold ./blueprint.json

Options:

Flag Description Default
--out <dir> Output root directory siteforge/sites
--no-git Skip git init and the initial commit false

Examples:

# scaffold with defaults
waelio scaffold ./blueprint.json

# scaffold into a custom directory
waelio scaffold ./blueprint.json --out ~/projects/my-site

# scaffold without initialising a git repository
waelio scaffold ./blueprint.json --no-git

The blueprint JSON describes the project name, slug, pages, features, integrations, locales, roles, brand tones, visual styles, content models, and SEO focuses. The scaffolder generates both workspaces from those selections.


πŸ›οΈ Project Structure

@waelio/cli
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts          # CLI entry point (Commander)
β”‚   β”œβ”€β”€ server.ts         # Express API server
β”‚   β”œβ”€β”€ siteforge.ts      # Build orchestration
β”‚   β”œβ”€β”€ scaffold.ts       # Blueprint scaffolder
β”‚   β”œβ”€β”€ localRepos.ts     # Local repo discovery
β”‚   └── locals/           # i18n locale files (12 languages)
β”œβ”€β”€ ui/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.vue       # Root Vue component
β”‚   β”‚   └── views/        # ScaffoldView, PublicSitesView
β”‚   └── dist/             # Built static assets
β”œβ”€β”€ templates/            # Multi-framework scaffold templates
β”œβ”€β”€ public-sites/         # Scaffolded demo sites (acme-dental, agent-007, e2e-test-site)
β”œβ”€β”€ wrangler.toml         # Cloudflare Workers deployment config
β”œβ”€β”€ vite.config.ts        # Vite build config
└── package.json

πŸ› οΈ Development

Install dependencies

pnpm install

Run in development

pnpm dev

Starts concurrently:

  • API server on http://localhost:3011
  • Vite UI on http://localhost:5173 (proxies /api β†’ :3011)

Build everything

pnpm run build

Run the production server

pnpm start

Quality checks

pnpm run typecheck   # tsc --noEmit + vue-tsc for the UI
pnpm test            # run *.test.ts via tsx --test
pnpm run check       # typecheck + tests

☁️ Deployment

The UI is deployed to Cloudflare Workers as a static site.

Deploy manually

pnpm run build
npx wrangler deploy

The wrangler.toml configuration serves the built Vue app from ui/dist:

name = "cli"
compatibility_date = "2024-12-01"

[assets]
directory = "./ui/dist"

Live URL: https://cli.waelio.workers.dev


πŸ”Œ API Endpoints

Build & Scaffold

Method Endpoint Description
POST /api/build Trigger a siteforge build
POST /api/scaffold Scaffold from a blueprint
GET /api/public-sites List scaffolded demo sites
GET /api/negotiate/health Check negotiation service health
POST /api/negotiate/kickoff Create session + authenticate prompt A + save handoff
POST /api/negotiate/auth Authenticate prompt A or prompt B
GET /api/negotiate/status?sessionId=... Fetch negotiation session status
GET /api/negotiate/handoff?sessionId=... Fetch shared handoff markdown

Local Repository Discovery

Method Endpoint Description
GET /api/local-repos Returns the local repository index
GET /api/local-repos/tree?repoId=...&path=... Browse a repo's file tree

Safety rules:

  • Repository IDs map to scanned local repos only
  • Folder browsing is restricted to paths inside the selected repository
  • Path traversal (..) is rejected
  • .git directories are hidden from listings
  • Default scan root: ~/Code/GitHub (override with WAELIO_LOCAL_ROOT)

🌍 Localization

UI strings live in src/locals/<lang>/<lang>.json with a top-level src/locals/manifest.json.

Supported locales:

ar Β· de Β· en Β· es Β· fr Β· he Β· id Β· it Β· ru Β· sv Β· tr Β· zh

RTL locales (ar, he) are supported β€” keep them in mind when editing UI copy.


πŸ“š Related Packages

Package Description
@waelio/utils Shared utilities and UI helpers
@waelio/ustore Universal storage and state patterns
@waelio/agent AI agent frontend toolkit
@waelio/sync Real-time sync utilities

πŸ“„ License

MIT Β© Waelio

About

Building website

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages