@holix/cli
v0.3.0
Published
Holix Application Framework CLI
Readme
@holix/cli
Command-line interface for Holix applications.
Installation
pnpm add -D @holix/cliUsage
Commands
dev
Start development mode with hot reload.
holix devOptions:
--open- Auto open Electron window (default: true)--clear- Clear output directory before build (default: true)
build
Build application for production.
holix buildOptions:
--clear- Clear output directory before build (default: true)
start
Start the built application.
holix startConfiguration
Create holix.config.ts in your project root:
import { defineHolixConfig } from '@holix/cli/config'
export default defineHolixConfig({
// Application ID
appID: 'com.example.myapp',
// Client entry
app: {
entry: 'src/index.tsx'
},
// Preload scripts
preload: {
preload: 'src/preload.ts'
},
// Or multiple preload scripts
preload: {
main: 'src/preload-main.ts',
worker: 'src/preload-worker.ts'
},
// Directory configuration
directories: {
pages: 'src/pages'
},
// Output directory
outDir: 'dist',
// Vite configuration
vite: {
plugins: [],
server: {
port: 3000
}
},
// Or use external Vite config
viteConfigFile: './vite.config.ts',
// Plugins
plugins: []
})Package.json Scripts
Add these scripts to your package.json:
{
"scripts": {
"dev": "holix dev",
"build": "holix build",
"start": "holix start"
}
}Development Workflow
Start Development
pnpm devThis will:
- Build main and preload processes
- Start Vite dev server for renderer
- Launch Electron with hot reload
- Watch for file changes
Build for Production
pnpm buildThis will:
- Build all processes (main, preload, renderer)
- Optimize for production
- Output to
dist/directory
Run Production Build
pnpm start
Hot Reload
The development server automatically:
- Reloads renderer process on file changes
- Restarts main process on file changes
- Maintains application state where possible
File-based Routing
Place page components in src/pages/:
src/pages/
├── index.tsx # /
├── about.tsx # /about
└── users/
└── [id].tsx # /users/:idThe CLI will automatically generate routes based on the file structure.
API
defineHolixConfig(config: HolixConfig): HolixConfig
Define and validate Holix configuration with full TypeScript support.
import { defineHolixConfig } from '@holix/cli/config'
export default defineHolixConfig({
// Your configuration
})Environment Variables
NODE_ENV- Set todevelopmentorproductionHOLIX_DEBUG- Enable debug logging
License
MIT
