Introduction
CLI module for development, build, encryption, packaging, and resource management. Provides 10 commands to manage the full lifecycle of an Electron application. Dual CJS + ESM module support.
Configuration File
All commands read from the project configuration file:
./cmd/bin.jsSee Configuration Types and Default Values for the complete config structure and defaults.
API
dev
Start development mode. Creates frontend-serve and electron-serve concurrently.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--serve | <mode> | Comma-separated services to start: frontend, electron, or both (default) |
ee-bin dev
ee-bin dev --serve=frontend
ee-bin dev --serve=electronWatch Mode
Set dev.electron.watch: true in ./cmd/bin.js to enable file watching with auto-rebuild and restart. Use dev.electron.delay to debounce rapid file changes.
build
Build frontend, electron bundle, and platform packages.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--cmds | <flag> | Comma-separated build steps (e.g. frontend,electron,win64) |
--env | <env> | Build environment: dev or prod (default: prod) |
ee-bin build --cmds=frontend
ee-bin build --cmds=frontend,electron
ee-bin build --cmds=frontend,electron,mac_arm64Build steps: frontend → electron → platform (win32, win64, win_e, win_7z, mac, mac_arm64, linux, linux_arm64).
start
Production preview mode (requires prior build). No bundling — directly runs Electron.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
ee-bin startexec
Execute user-defined custom commands from the exec config section.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--cmds | <flag> | Comma-separated custom command names |
ee-bin exec --cmds=gomove
Copy resources between directories (performs copy, not move). Supports atomic backup strategy.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--flag | <flag> | Comma-separated move config keys (e.g. frontend_dist) |
ee-bin move --flag=frontend_dist
ee-bin move --flag=go_static,go_config,go_package,go_imagesencrypt
Code encryption using javascript-obfuscator and bytenode.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--out | <folder> | Output directory (default: ./) |
Encryption types:
| Type | Description |
|---|---|
confusion | Obfuscation only (javascript-obfuscator) |
bytecode | Bytecode only (bytenode, electron only) |
strict | Obfuscation + bytecode combined |
none | Skip encryption |
ee-bin encrypt
ee-bin encrypt --out ./publicFrontend vs Electron
- Frontend: only supports
confusion(browser V8 ≠ compile-time V8, bytecode is incompatible) - Electron: supports
confusion,bytecode, andstrict
clean
Remove encrypted output files.
| Option | Parameter | Description |
|---|---|---|
-d / --dir | <folder> | Directory to clean (default: ./public/electron) |
ee-bin clean
ee-bin clean --dir ./public/electronicon
Generate platform-specific app icons from a source image.
| Option | Parameter | Description |
|---|---|---|
-i / --input | <file> | Source image (default: /public/images/logo.png) |
-o / --output | <folder> | Output directory (default: /build/icons/) |
-s / --size | <flag> | Icon sizes (default: 16,32,64,256,512) |
-c / --clear | (boolean) | Clear output directory before generating |
-m / --images | <flag> | Copy icons to /public/images/ |
Post-processing: 16px → tray.png, 32px → window icon, others → NxN.png.
# Install dependency (optional)
npm install icon-gen -D
# Generate icons
ee-bin iconNote
If the dependency installation fails, please use Other Software
updater
Generate incremental update packages.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--app-file | <file> | Application file path (e.g. app.asar) |
--platform | <flag> | Target platform |
--force | <flag> | Force update flag |
ee-bin updater --platform=macos_appleSee also:UpdaterConfig
ohos
Extract build artifacts to HarmonyOS (OpenHarmony) HAP resource directories.
| Option | Parameter | Description |
|---|---|---|
--config | <folder> | Path to custom bin.js config file |
--cmds | <flag> | Comma-separated ohos config keys (e.g. resources) |
ee-bin ohos --cmds=resourcesSee also:OhosConfig
