@holix/cli
@holix/cli
Command-line interface for Holix applications.
Installation
pnpm add -D @holix/cli
Usage
Commands
dev
Start development mode with hot reload.
holix dev
Options:
--open- Auto open Electron window (default: true)--clear- Clear output directory before build (default: true)
build
Build application for production.
holix build
Options:
--clear- Clear output directory before build (default: true)
start
Start the built application.
holix start
Configuration
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/:id
The 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
Related Packages
Version History
| Version | Released | License |
|---|---|---|
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.3 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT | |
| 0.3.0 | MIT | |
| 0.2.0 | MIT | |
| 0.1.0 | MIT |