CLI Commands
Hexa CLI command groups:
hexa newhexa buildhexa addhexa generate
hexa new
Scaffold a new extension project.
hexa new [name] [--platform chrome,firefox,...]
| Argument / Option | Values | Notes |
|---|---|---|
[name] | string | Prompted if omitted |
--platform | chrome, firefox, safari, opera, edge, brave | Comma-separated list |
hexa build
Compile and generate extension artifacts.
hexa build [--platform chrome] [--mode production] [--target all] [--watch]
| Option | Values | Default |
|---|---|---|
--platform | chrome, firefox, safari, opera, edge, brave | chrome |
--mode | development, production | config or production |
--target | all, ui, content, background | all |
--verbose | flag | false |
--watch | flag | false |
Notes:
- Watch mode is driven by
hexa build --watch. - There is no separate
hexa devcommand.
Compiler options (hexa-cli.config.json)
compilerOptions supports Vite-style build flags with Hexa camelCase keys:
| Key | Type | Notes |
|---|---|---|
minify | boolean | "esbuild" | "terser" | true maps to "esbuild" |
cssMinify | boolean | "esbuild" | "lightningcss" | CSS minifier strategy |
sourceMap | boolean | "inline" | "hidden" | Mapped to Vite build.sourcemap |
terserOptions | object | Used only when minify: "terser" |
Example profiles:
{
"compilerOptions": {
"minify": false,
"cssMinify": false,
"sourceMap": true,
"terserOptions": {}
},
"environments": {
"production": {
"compilerOptions": {
"minify": "terser",
"cssMinify": "lightningcss",
"sourceMap": false,
"terserOptions": {
"compress": {
"drop_console": true
}
}
}
}
}
}
UI options (hexa-cli.config.json)
| Key | Type | Default | Notes |
|---|---|---|---|
ui.parallelBuild | boolean | true | Runs managed popup + managed devtools builds in parallel during standard build mode. Set to false to force sequential managed UI builds. |
hexa add
Add feature blocks to an existing project.
add content
hexa add content <name> <urlList> [--run-at document-idle]
add background
hexa add background <name> [--allow-multiple]
add ui
hexa add ui popup
hexa add ui devtools
add handler
hexa add handler <name> <contentClass>
Shared options for add subcommands:
--cwd <path>--dry-run--force--verbose
hexa generate
Generate classes and store scaffolds.
generate controller
hexa generate controller <name> [--namespace value]
generate handler
hexa generate handler <name> [--namespace value]
generate service
hexa generate service <name> <context>
Contexts: background, content, general, ui.
generate reducer
hexa generate reducer <name> <context>
Contexts: background, content.
generate state
hexa generate state <name> <context>
Requires an existing matching reducer file.
Shared options for generate subcommands:
--cwd <path>--dry-run--force--verbose
generate output directories
CLI schematics commands (hexa generate ... and hexa add handler ...) use fixed source-root directories:
- controllers:
src/background - handlers:
src/content - services:
src/services
For reducers and state generation, directories are context-based under src/background/store and src/content/store.
Where to go next
- Build internals and AOT behavior: Build Pipeline
- Output merge semantics: Manifest Patching
- Live reload behavior by platform: HMR