Skip to content

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:

bash
./cmd/bin.js

See Configuration Types and Default Values for the complete config structure and defaults.

API

dev

Start development mode. Creates frontend-serve and electron-serve concurrently.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
--serve<mode>Comma-separated services to start: frontend, electron, or both (default)
bash
ee-bin dev
ee-bin dev --serve=frontend
ee-bin dev --serve=electron

Watch 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.

OptionParameterDescription
--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)
bash
ee-bin build --cmds=frontend
ee-bin build --cmds=frontend,electron
ee-bin build --cmds=frontend,electron,mac_arm64

Build steps: frontendelectron → 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.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
bash
ee-bin start

exec

Execute user-defined custom commands from the exec config section.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
--cmds<flag>Comma-separated custom command names
bash
ee-bin exec --cmds=go

move

Copy resources between directories (performs copy, not move). Supports atomic backup strategy.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
--flag<flag>Comma-separated move config keys (e.g. frontend_dist)
bash
ee-bin move --flag=frontend_dist
ee-bin move --flag=go_static,go_config,go_package,go_images

encrypt

Code encryption using javascript-obfuscator and bytenode.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
--out<folder>Output directory (default: ./)

Encryption types:

TypeDescription
confusionObfuscation only (javascript-obfuscator)
bytecodeBytecode only (bytenode, electron only)
strictObfuscation + bytecode combined
noneSkip encryption
bash
ee-bin encrypt
ee-bin encrypt --out ./public

Frontend vs Electron

  • Frontend: only supports confusion (browser V8 ≠ compile-time V8, bytecode is incompatible)
  • Electron: supports confusion, bytecode, and strict

clean

Remove encrypted output files.

OptionParameterDescription
-d / --dir<folder>Directory to clean (default: ./public/electron)
bash
ee-bin clean
ee-bin clean --dir ./public/electron

icon

Generate platform-specific app icons from a source image.

OptionParameterDescription
-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.

bash
# Install dependency (optional)
npm install icon-gen -D

# Generate icons
ee-bin icon

Note

If the dependency installation fails, please use Other Software

updater

Generate incremental update packages.

OptionParameterDescription
--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
bash
ee-bin updater --platform=macos_apple

See alsoUpdaterConfig

ohos

Extract build artifacts to HarmonyOS (OpenHarmony) HAP resource directories.

OptionParameterDescription
--config<folder>Path to custom bin.js config file
--cmds<flag>Comma-separated ohos config keys (e.g. resources)
bash
ee-bin ohos --cmds=resources

See alsoOhosConfig