@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)

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
-c, --cacheCache browser profile between launches
--no-cacheDisable profile cache for this run
-r, --reportEnable Rsdoctor build report
--debugEnable debug mode

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.