Package Exports
- @voltx/cli
Readme
@voltx/cli
CLI tools for the VoltX framework
Command-line tools for the VoltX framework. Full-stack dev server (Vite + Hono), production build with SSR, code generation, and project scaffolding.
Installation
npm install @voltx/cliCommands
Development
voltx dev # Start Vite dev server with HMR + backend
voltx build # Build for production (client + SSR + server)
voltx start # Start production servervoltx dev starts a single process that serves both the React frontend and Hono API backend with hot module replacement. No separate frontend/backend servers needed.
Create a New Project
voltx create my-app
voltx create my-app --template chatbot
voltx create my-app --template agent-app --shadcn
voltx create my-app --template rag-app --auth jwtFor the full interactive experience with tool selection, RAG toggle, shadcn/ui, and API key management, use
npx create-voltx-appinstead.
Code Generation
voltx generate route api/users # New API route
voltx generate agent assistant # New agent definition
voltx generate tool search # New tool for agentsBuild Pipeline
voltx build runs a 3-phase build when SSR is detected:
- Client build — Vite builds
src/entry-client.tsx→dist/client/ - SSR build — Vite builds
src/entry-server.tsx→dist/server/ - Server build — tsup bundles
server.ts→dist/index.js
Falls back to a 2-phase build (client + server) if no src/entry-server.tsx exists.
Project Structure
All templates generate a full-stack project:
my-app/
├── api/ # Backend API routes (file-based routing)
│ ├── index.ts # GET /api — health check
│ ├── chat.ts # POST /api/chat (chatbot/agent-app)
│ └── agent.ts # POST /api/agent (agent-app)
├── src/ # Frontend (React + Vite)
│ ├── app.tsx # Root component
│ ├── layout.tsx # Layout wrapper
│ ├── globals.css # Tailwind CSS v4
│ ├── entry-client.tsx # Client hydration
│ ├── entry-server.tsx # SSR rendering
│ ├── components/ # React components
│ ├── hooks/ # Custom hooks
│ └── lib/ # Utilities (cn() if shadcn enabled)
├── agents/ # AI agents (agent-app)
├── tools/ # Agent tools (agent-app)
├── public/ # Static assets (favicon, robots.txt, manifest)
├── server.ts # Hono app entry
├── vite.config.ts # Vite + Tailwind + dev server
├── components.json # shadcn/ui config (if enabled)
├── voltx.config.ts # VoltX config
└── tsconfig.json # TypeScript (with @/* path alias)What's Included
- Tailwind CSS v4 — native Vite plugin, no PostCSS config needed
- Path aliases —
@/*maps tosrc/*in both TypeScript and Vite - shadcn/ui (optional) —
--shadcnflag pre-configurescomponents.json,cn()utility, and CSS variables - React SSR — streaming server-side rendering via
@voltx/server - Auto .env loading —
@voltx/coreloads.envfiles automatically
Programmatic Usage
import { createProject } from "@voltx/cli";
await createProject({
name: "my-app",
template: "chatbot",
auth: "jwt",
shadcn: true,
});Part of VoltX
This package is part of the VoltX framework. See the monorepo for full documentation.
License
MIT — Made by the Promptly AI Team