Installation

Updated Jul 27, 2026
BUN_INSTALL=/tmp BUN_TMPDIR=/tmp bun install
npm install -g agent-browser
agent-browser install

agent-browser install downloads the Chrome browser used by the default backend. css-view does not download Chromium, Firefox, or WebKit during postinstall.

Install Playwright browsers only when the local Playwright backend is needed, for example walker mode or an explicit Playwright CDP capture:

BUN_INSTALL=/tmp BUN_TMPDIR=/tmp bunx playwright install chromium

Use firefox or webkit in that command only when launching those engines with --backend playwright --browser <engine>. The Playwright installer warns if shared libraries are missing. Install the packages flagged in the warning before attempting a local Playwright capture run.

Global installation

To expose the CLI globally, pack the project and install the generated archive by absolute path:

bun pm pack
bun install -g "$(pwd)/css-view-<VERSION>.tgz"

Add the Bun binary directory (~/.bun/bin by default) to PATH, so the css-view command resolves everywhere. The package has no browser-download postinstall hook. Install agent-browser for the default backend, or install Playwright browsers manually for local Playwright captures. bun install -g . currently fails on Bun 1.3.11 with an internal dependency-loop error, so avoid installing directly from the package directory.

When installing from a packaged tarball, provide an absolute path:

bun install -g "$(pwd)/css-view-<VERSION>.tgz"

If a failed bun install -g . left the global Bun manifest with an empty dependency entry, remove the stale global package first with bun remove -g css-view, then remove the bad "" entry from $(dirname "$(bun pm bin -g)")/install/global/package.json. The helper script performs both cleanup steps automatically before reinstalling.

The helper script scripts/install.sh packs the project, resolves the absolute archive path, and invokes the global install.