CLI

This page lists the supported addfox CLI commands and options.

Basic Usage

addfox <command> [options]

Configure scripts in package.json

{
  "scripts": {
    "dev": "addfox dev",
    "dev:firefox": "addfox dev -b firefox",
    "build": "addfox build",
    "build:chrome": "addfox build -b chrome",
    "test": "addfox test"
  }
}

Commands

CommandDescription
devStart development mode with hot reload support.
buildBuild production output.
testRun tests (forward args to rstest).

Common Options (Defaults + Config Mapping)

OptionBuilt-in Defaultaddfox.config FieldDescription
-b, --browser <browser>chromiumNo direct field (command-level target/launch selection)Target/launch browser. See Supported Browsers List below.
--port <port>3000No direct fieldRsbuild dev server port. Only applies to dev.
-c, --cachetruecacheEnable browser profile cache for current run.
--no-cachefalse (for this run)cacheDisable browser profile cache for current run.
-r, --reportfalsereportEnable Rsdoctor build report.
--no-openfalse (default is auto-open)No direct fieldDo not auto-open browser.
--debugfalsedebugEnable debug mode (error monitor in dev).
--help--Print help.
--version--Print version.

Supported Browsers List

The -b, --browser option supports the following browsers:

BrowserDescription
chromiumChromium (default)
chromeGoogle Chrome
edgeMicrosoft Edge
braveBrave Browser
vivaldiVivaldi
operaOpera
santaSanta Browser
arcArc Browser
yandexYandex Browser
browserosBrowserOS
customCustom browser (requires browser.custom in config)
firefoxMozilla Firefox

Examples

# Development (Chromium)
addfox dev -b chromium

# Development on a custom port
addfox dev --port 3100 -b edge

# Development (Firefox) with debug monitor
addfox dev -b firefox --debug

# Production build
addfox build -b chrome

# Build without opening browser
addfox build -b chrome --no-open

# Build with report
addfox build -r

Entry Paths and HTML Templates

Entry paths passed to entry or discovered by the framework can point to either a script (.ts/.tsx/.js/.jsx) or an HTML template (.html).

  • Script path: the framework uses the script as the build entry and auto-generates HTML for entries that need it.
  • HTML path: you can write the entry path as popup/index.html, but you must still tell the framework which script is the entry. Do this by adding data-addfox-entry to a <script type="module"> tag in the HTML, or by placing a sibling script file (index.ts / index.tsx) next to the HTML so the framework can resolve it automatically.

See Config-based Entry for details and examples.