Getting started
Getting started
Section titled “Getting started”Build your project first, then run wgw-deploy from the project root.
npm run buildnpx wgw-deployThe default command resolves the project from the current working directory and deploys dist.
If your output directory has another name, pass it with --dir.
npx wgw-deploy --dir publicnpx wgw-deploy --dir outIf you are running the command from outside the project, pass --cwd.
npx wgw-deploy --cwd /path/to/app --dir buildThe CLI does not accept positional deploy paths. Use --dir for directories and files.
npx wgw-deploy --dir ./site/index.htmlRead the output
Section titled “Read the output”A successful deploy prints the project, revision, live URL, and pinned URL.
project example-projectrevision abc123def4567890live 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.
npx wgw-deploy --jsonThe JSON output includes projectSlug, productionUrl, revisionUrl, projectHash, revisionId, files, bytes, and uploadedAssets.
Re-deploy
Section titled “Re-deploy”Run the same command again after rebuilding.
npm run buildnpx wgw-deployIf 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.
Assign a domain
Section titled “Assign a domain”Use --domain to assign a wgw.lol subdomain or a custom hostname to the locally tracked project.
npx wgw-deploy --domain preview.wgw.lolnpx 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:
npx wgw-deploy --delete-domainList and delete local projects
Section titled “List and delete local projects”List locally tracked projects:
npx wgw-deploy --listDelete the project matched by the current --cwd and --dir:
npx wgw-deploy --delete--delete removes the local project state and asks the remote service to delete the project.