@addfox/cli

The addfox CLI entry point: it parses arguments, runs the config → entry → Rsbuild pipeline, wraps terminal output, and drives Rsbuild for dev / build.

You can use it programmatically to build custom extension tooling on top of Addfox.

Installation

npm install @addfox/cli

What it does

  • Parses addfox dev | build | test [options] from process.argv
  • Loads and resolves addfox.config.ts
  • Discovers or validates extension entries
  • Builds the final Rsbuild configuration
  • Starts the dev server or runs a production build
  • Optionally launches the browser with the extension loaded

Commands

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

addfox test reads its config from rstest.config.* or the test field in addfox.config; when both exist, rstest.config.* takes precedence.

Common Options

OptionDescription
-b, --browser <browser>Target/launch browser
--port <port>Rsbuild dev server port (dev only, default 3000)
--no-openDo not auto-open browser
--keep-browser-profileKeep browser profile between launches
--no-keep-browser-profileUse a fresh browser profile for this run
-r, --reportEnable Rsdoctor build report
--debugEnable debug mode

-c, --cache and --no-cache are deprecated aliases of --keep-browser-profile / --no-keep-browser-profile; they still work but print a deprecation warning.

Dev server and HMR

addfox dev uses Rsbuild dev server with writeToDisk: true so the extension can be loaded from .addfox/<outDir>. The @addfox/rsbuild-plugin-extension-hmr plugin handles full extension reload when build output changes, so the extension works from both disk and chrome-extension:// origins.

Programmatic usage

Most users will call the CLI binary. If you need to embed the CLI in another tool, import from @addfox/cli and call the same pipeline functions used by the binary.