---
title: CLI
description: Deploy, list, delete, and manage domains with the wgw-deploy CLI.
---

# CLI

`wgw-deploy` publishes a static directory or a single file to a public `wgw.lol` URL. The default command deploys `dist` from the current working directory.

```bash
npx wgw-deploy
```

Use `--dir` when your build output is somewhere else. Use `--cwd` when the project root is not the shell's current directory.

```bash
npx wgw-deploy --dir public
npx wgw-deploy --cwd /path/to/app --dir build
```

The local project identity is based on `--cwd` plus `--dir`. Reuse the same values when listing, deleting, or changing the domain for a project.

## JSON output

Add `--json` when another tool or agent needs to parse the result. Progress output is suppressed and the CLI prints one JSON object on success.

```bash
npx wgw-deploy --dir dist --json
```

Example deploy output:

```json
{
  "projectSlug": "bright-field-mqstr7zz",
  "productionUrl": "https://bright-field-mqstr7zz.wgw.lol/",
  "revisionUrl": "https://bright-field-mqstr7zz--26704cb219eb67f3.wgw.lol/",
  "projectHash": "4d0c...",
  "revisionId": "26704cb219eb67f3",
  "files": 18,
  "bytes": 428911,
  "uploadedAssets": 18
}
```

The `productionUrl` always points at the latest deploy for the project. The `revisionUrl` is pinned to one immutable revision.

## List local projects

`--list` reads locally tracked projects from the CLI config directory. By default that is `~/.config/wgw-deploy/projects`; `WGW_DEPLOY_CONFIG_DIR` overrides it, and `XDG_CONFIG_HOME` is respected.

```bash
npx wgw-deploy --list
npx wgw-deploy --list --json
```

JSON list output is an array. Each item includes the `cwd`, `deployDir`, `statePath`, current `domain`, `productionUrl`, revision IDs, timestamps, and `expired`.

## Domains

Assign a WGW subdomain:

```bash
npx wgw-deploy --domain preview-build
npx wgw-deploy --domain preview-build.wgw.lol --json
```

Assign an external hostname:

```bash
npx wgw-deploy --domain docs.example.com --json
```

External hostname output includes DNS instructions:

```json
{
  "projectSlug": "bright-field-mqstr7zz",
  "productionUrl": "https://docs.example.com/",
  "projectHash": "4d0c...",
  "revisionId": "26704cb219eb67f3",
  "revisionUrl": "https://docs.example.com/_rev/26704cb219eb67f3/",
  "dns": {
    "type": "CNAME",
    "name": "docs.example.com",
    "value": "cname.wgw.lol"
  }
}
```

Remove the assigned custom domain and return the project to its generated `*.wgw.lol` domain:

```bash
npx wgw-deploy --delete-domain
npx wgw-deploy --delete-domain --cwd /path/to/app --dir build --json
```

## Delete a project

`--delete` removes the remote project and deletes the local project state for the selected `--cwd` and `--dir`.

```bash
npx wgw-deploy --delete
npx wgw-deploy --delete --cwd /path/to/app --dir build --json
```

JSON delete output:

```json
{
  "projectHash": "4d0c...",
  "projectSlug": "bright-field-mqstr7zz",
  "deleted": true
}
```

## Agent skill

`--skill` prints the packaged WGW Deploy skill markdown. It exits after printing the skill and does not deploy.

```bash
npx wgw-deploy --skill
```

## Options

- `--dir <path>`: deploy a directory or a single file. Defaults to `dist`.
- `--cwd <path>`: resolve `--dir` from another project directory.
- `--domain <host>`: assign a WGW subdomain or external custom hostname.
- `--list`: list locally tracked projects.
- `--delete-domain`: remove the assigned custom domain.
- `--delete`: delete the selected project locally and remotely.
- `--json`: print machine-readable success output.
- `--quiet`, `-q`: suppress progress output.
- `--skill`: print the agent skill markdown.
- `--help`, `-h`: print CLI help.

The CLI rejects positional arguments. Use `--dir` for deploy targets.
