Installation
Option 1: Scaffold a project (Recommended)
Use the official scaffold to quickly create a project with pre-configured dev environment:
Interactive Setup Steps (Latest)
The scaffold will guide you through the following steps:
- Project name — Enter your project directory name (default:
my-extension) - Framework — Select your preferred framework:
- Vanilla
- Vue
- React
- Preact
- Svelte
- Solid
- Style engine — Choose
none/tailwindcss/unocss/less/sass - Language — Select TypeScript or JavaScript
- Package manager — Choose pnpm, npm, yarn, or bun
- Entries — Select which extension entries to include:
- Background (Service Worker / Background script)
- Content Script
- Popup
- Options Page
- Side Panel
- DevTools
- Test setup (optional) — Choose whether to initialize:
- Unit (rstest)
- E2E (rstest + Playwright)
- Rsdoctor (optional) — Choose whether to install
@rsdoctor/rspack-plugin - Install Skills — Optionally install addfox skills to your project
Scaffold Options
You can also pass options directly (based on the current create-addfox-app CLI):
Note:
--style,--unit,--e2e, and--rsdoctorare primarily used in non-interactive mode when--frameworkand--languageare provided.
Examples:
After creation, the CLI will display the next steps:
Option 2: Add to an existing project
If you already have a project, you can manually integrate Addfox:
1. Install addfox
Install addfox as a dev dependency (one package includes CLI and build):
2. Add config file
Create addfox.config.ts (or addfox.config.js) at the project root, and ensure you have background, content, popup, options, sidepanel entries under the root or under appDir.
3. Minimal config example
4. Packages and imports
- Core:
defineConfig, types, entry discovery, manifest helpers are exported fromaddfox. Use:import { defineConfig } from "addfox". - Runtime: For the
browserAPI (Chrome/Firefox), install webextension-polyfill and useimport browser from "webextension-polyfill". Content UI:@addfox/utilsprovidesdefineContentUI/mountContentUIfor injecting UI in content scripts; useimport { defineContentUI, mountContentUI } from "@addfox/utils".
5. Run commands
- Dev:
addfox devor use your package manager's run script (e.g.pnpm dev,npm run dev,yarn dev,bun run devif"dev": "addfox dev"in package.json). - Build:
addfox build; output goes tooutputRoot/outDir/extension-<browser>(default.addfox/extension/extension-chromium).
Use -b chrome|chromium|edge|brave|vivaldi|opera|santa|arc|yandex|browseros|custom|firefox for target browser:
Default is Chrome when not specified.

