Webview Bundle

CLI reference

The wvb command-line tool — pack, serve, upload, deploy, download, and the local remote.

The wvb command-line tool (package @wvb/cli, also installed as webview-bundle) packs bundles and drives the remote update workflow. Install it as a dev dependency:

npm install -D @wvb/cli
npx wvb --help

Most commands read defaults from a wvb.config.ts found in the working directory. Pass --config <path> to use a specific file and --cwd <dir> to change the working directory.

Authoring bundles

wvb pack [SRC_DIR]

Pack a directory of web assets into a .wvb archive.

wvb pack ./dist
wvb pack ./dist --outfile ./app.wvb
wvb pack ./dist --ignore '*.map' --ignore 'node_modules/**'
wvb pack ./dist --header '*.html' 'cache-control' 'max-age=3600'
OptionDescription
SRC_DIRSource directory (or pack.srcDir in config).
--outfile, -OOutput file name. Defaults to the package.json name; .wvb is appended if missing.
--outdirOutput directory. Defaults to .wvb.
--ignoreGlob(s) of files to exclude (repeatable).
--header, -HSet headers for matching files: --header <glob> <key> <value> (repeatable).
--writeSet --no-write to simulate without writing.
--overwriteOverwrite an existing output file. Default true.

wvb extract [FILE]

Extract a .wvb archive's files back onto disk.

wvb extract ./app.wvb --outdir ./unpacked
OptionDescription
FILEBundle file to extract.
--outdir, -ODestination directory.
--cleanRemove the out directory first. Default false.
--writeSet --no-write to simulate.

wvb serve [FILE]

Serve a single bundle's files over HTTP — useful for previewing a packed bundle in a browser.

wvb serve ./app.wvb              # http://localhost:4312
wvb serve ./app.wvb --port 8080 --hostname 0.0.0.0
OptionDescription
FILEBundle to serve (or serve.file in config).
--hostname, -HBind hostname. Default localhost. (HOSTNAME env)
--port, -PPort. Default 4312. (PORT env)
--silentDisable request logging.

Publishing & updating

These commands require remote.* settings in your config. See Remote updates for the full workflow and a local-testing walkthrough.

wvb upload [BUNDLE] [VERSION]

Upload a packed bundle to the remote, optionally computing integrity, signing it, and deploying.

wvb upload                       # uses config defaults
wvb upload app 1.2.0 --deploy
wvb upload app 1.2.0 --deploy --channel beta
wvb upload --file ./dist/app.wvb --force
OptionDescription
BUNDLE, VERSIONBundle name and version (else from config / package.json).
--file, -FPath to the .wvb to upload.
--forceOverwrite if the version already exists.
--deployDeploy after upload. Default true.
--channelChannel to deploy to (with --deploy).
--skip-integrityDon't compute an integrity hash.
--skip-signatureDon't sign the bundle.

wvb deploy [BUNDLE] VERSION

Deploy a previously uploaded version (make it the current version clients receive).

wvb deploy app 1.2.0
wvb deploy app 1.2.0 --channel beta

wvb download [BUNDLE] [VERSION]

Download a bundle from the remote and (by default) save it to disk.

wvb download app --endpoint https://updates.example.com
wvb download app 1.2.0 --out ./bundles/app.wvb --overwrite
wvb download app --skip-write          # fetch + print info only
OptionDescription
--out, -OOutput path. Defaults to <name>.wvb.
--endpoint, -ERemote endpoint (else remote.endpoint).
--channelChannel to download from.
--writeSet --no-write to skip saving.
--overwriteOverwrite an existing file. Default false.
--progressShow a progress bar. Default true.

wvb builtin

Download the currently deployed bundles from the remote into a local directory, to ship as builtin fallbacks with your app.

wvb builtin --endpoint https://updates.example.com --out .wvb/builtin/bundles
wvb builtin --include 'app*' --exclude 'internal*'
OptionDescription
--out, -OOutput directory. Default .wvb/builtin/bundles.
--endpoint, -ERemote endpoint.
--channelChannel to pull from.
--include / --excludeGlob filters over remote bundles (repeatable).
--cleanClear the output directory first. Default true.
--concurrencyParallel downloads.

Inspecting & testing the remote

wvb remote list

List bundles deployed on the remote.

wvb remote list --endpoint https://updates.example.com
wvb remote list --channel beta

wvb remote current [BUNDLE]

Show the current deployed version and metadata for a bundle.

wvb remote current app --endpoint https://updates.example.com

wvb remote local

Start a local update server backed by a directory (default ~/.wvb/local). It implements the same HTTP contract as a production server, so you can test the full update loop offline.

wvb remote local                       # http://localhost:4313, serving ~/.wvb/local
wvb remote local --base-dir ./.wvb/local --port 4313 --allow-other-versions
OptionDescription
--base-dirDirectory to serve. Default ~/.wvb/local.
--allow-other-versionsAllow downloading non-current versions. Default false.
--hostname, -HBind hostname. Default localhost. (HOSTNAME env)
--port, -PPort. Default 4313. (PORT env)
--silentDisable request logging.

See Remote updates → Testing locally for how to wire this up with @wvb/remote-local.

On this page