Skip to content

Getting started

Build your project first, then run wgw-deploy from the project root.

Terminal window
npm run build
npx wgw-deploy

The default command resolves the project from the current working directory and deploys dist.

If your output directory has another name, pass it with --dir.

Terminal window
npx wgw-deploy --dir public
npx wgw-deploy --dir out

If you are running the command from outside the project, pass --cwd.

Terminal window
npx wgw-deploy --cwd /path/to/app --dir build

The CLI does not accept positional deploy paths. Use --dir for directories and files.

Terminal window
npx wgw-deploy --dir ./site/index.html

A successful deploy prints the project, revision, live URL, and pinned URL.

project example-project
revision abc123def4567890
live https://example-project.wgw.lol/
pinned https://example-project--abc123def4567890.wgw.lol/

Use the live URL when you want people to always see the latest deploy. Use the pinned URL when you need a link that keeps showing the same revision.

For machine-readable output, add --json.

Terminal window
npx wgw-deploy --json

The JSON output includes projectSlug, productionUrl, revisionUrl, projectHash, revisionId, files, bytes, and uploadedAssets.

Run the same command again after rebuilding.

Terminal window
npm run build
npx wgw-deploy

If the local files are unchanged and the local deploy cache is still fresh, the CLI reuses the current revision and reports a cached deploy. Otherwise it checks remote assets, uploads the missing assets, and finalizes a new revision.

Use --domain to assign a wgw.lol subdomain or a custom hostname to the locally tracked project.

Terminal window
npx wgw-deploy --domain preview.wgw.lol
npx wgw-deploy --domain preview.example.com

--domain is a domain operation. It creates or updates the project domain and then exits. Run npx wgw-deploy again if you also need to publish new files.

For a custom hostname, the CLI prints the CNAME record to create. For a wgw.lol subdomain, no external DNS record is needed.

Remove the assigned domain with:

Terminal window
npx wgw-deploy --delete-domain

List locally tracked projects:

Terminal window
npx wgw-deploy --list

Delete the project matched by the current --cwd and --dir:

Terminal window
npx wgw-deploy --delete

--delete removes the local project state and asks the remote service to delete the project.