# taggor sites

> Sites. One site has two environments, each with its own snippet and domains: production (the live website) and staging (the test copy and localhost)

## taggor sites

Sites. One site has two environments, each with its own snippet and domains: production (the live website) and staging (the test copy and localhost).

Subcommands: `taggor sites list`, `taggor sites create`, `taggor sites show`, `taggor sites update`, `taggor sites disable`, `taggor sites enable`, `taggor sites snippet`, `taggor sites props`, `taggor sites protection`, `taggor sites domains`, `taggor sites server-keys`, `taggor sites delete`.

## taggor sites list

List the workspace's sites, with the site key and domains of each environment.

```sh title="Usage"
npx taggor sites list [options]
```

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites list
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites create

Create a site and print its two snippets: the production one for the live website, the staging one for the test copy and localhost.

```sh title="Usage"
npx taggor sites create [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `--name <value>` | Name of the site, to tell sites apart. | - |
| `--production-domain <value>` | Hostname of the LIVE website, where the production snippet works, e.g. example.com or \*.shop.example.com (repeat or comma-separate). Can be given more than once. | - |
| `--staging-domain <value>` | Hostname of the TEST copy of the website, where the staging snippet works, e.g. staging.example.com (repeat or comma-separate). localhost and 127.0.0.1 always work on staging: no need to list them. Can be given more than once. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites create --name "Shop" --production-domain shop.example.com --staging-domain staging.shop.example.com
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites show

Show one site: the snippet and domains of each environment, and the version of each component every environment serves and why.

```sh title="Usage"
npx taggor sites show [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites show st_0123456789abcdefghjkmnpqrs
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites update

Change a site's name (keys, snippets and what it serves stay the same).

```sh title="Usage"
npx taggor sites update [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |
| `--name <value>` | The new name of the site. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites update st_0123456789abcdefghjkmnpqrs --name "Online shop"
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites disable

Switch a site off: nothing of it is delivered and its pages show no component, until taggor sites enable.

```sh title="Usage"
npx taggor sites disable [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |
| `--yes` | Skip the question a terminal asks before switching the site off (never needed without a terminal). | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites disable st_0123456789abcdefghjkmnpqrs --yes
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites enable

Switch a site back on after taggor sites disable.

```sh title="Usage"
npx taggor sites enable [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites enable st_0123456789abcdefghjkmnpqrs
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites snippet

Print the snippets of a site, each labeled with its environment (`--environment` prints one); `--preload` and `--hold` add head hints and a time-limited hold for an early load (docs: /docs/load-early/).

```sh title="Usage"
npx taggor sites snippet [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |
| `--environment <value>` | Print only this environment's snippet: production or staging. Default: both, each labeled. | - |
| `--url` | Print only the loader URL, not the HTML tag. | - |
| `--preload` | Add preconnect, loader preload and runtime modulepreload links before the tag, for a page that is mostly components; paste it all in `<head>`. | - |
| `--hold <value>` | Seconds (1 to 3) to keep the page's .taggor-region invisible until its components are defined, then show your fallback; adds a `<style>` for `<head>`. Off by default. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites snippet st_0123456789abcdefghjkmnpqrs --environment production --preload
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites props

Save the values a site gives its components (props).

Subcommands: `taggor sites props set`.

## taggor sites props set

Save one prop value of a component on a site, e.g. a link a form shows.

```sh title="Usage"
npx taggor sites props set <component> <prop> <value> [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `<component>` | Component tag or id (cmp_...), already attached to the site. Required. | - |
| `<prop>` | Prop name as the manifest declares it (ctaUrl), or its page attribute (cta-url). Required. | - |
| `<value>` | The value to save, public in the site's manifest: no secret. Required. | - |
| `--site <value>` | The site: its id or either of its site keys (always spelled out; a site's props are public). | - |
| `--as <value>` | How to read the value: string (default), number, boolean or json. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites props set price-card ctaUrl https://example.com/buy --site st_0123456789abcdefghjkmnpqrs
npx taggor sites props set price-card maxItems 6 --as number --site st_0123456789abcdefghjkmnpqrs
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites protection

Choose what a site does with suspect submissions and its daily cap.

Subcommands: `taggor sites protection set`.

## taggor sites protection set

Set what a site does with a suspect submission (keep or drop) and its daily cap of submissions.

```sh title="Usage"
npx taggor sites protection set [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `--site <value>` | The site: its id or either of its site keys (always spelled out). The protection is one for both environments. | - |
| `--suspects <value>` | keep (default: store it marked suspect), drop (answer it but do not store it) or default. | - |
| `--daily-cap <value>` | Most submissions a day the site stores (up to the platform's ceiling), or default. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites protection set --site st_0123456789abcdefghjkmnpqrs --suspects drop --daily-cap 500
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites domains

The hostnames each environment of a site works on.

Subcommands: `taggor sites domains set`.

## taggor sites domains set

Replace the whole list of hostnames ONE environment of a site works on (no `--domain` clears it).

```sh title="Usage"
npx taggor sites domains set [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `--site <value>` | The site: its id, or either of its two site keys (taggor sites list shows them). | - |
| `--environment <value>` | production (the live website) or staging (the test copy and localhost). Required when the site is named by its id; a site key already says which environment. | - |
| `--domain <value>` | A hostname this environment works on (example.com, \*.shop.example.com); repeat it or separate with commas. example.com already covers www.example.com. Can be given more than once. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites domains set --site st_0123456789abcdefghjkmnpqrs --environment production --domain shop.example.com --domain www.example.org
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites server-keys

Manage the server keys of a site: the secret its server sends for server rendering (SSR). A key renders ONE environment of the site.

Subcommands: `taggor sites server-keys list`, `taggor sites server-keys create`, `taggor sites server-keys revoke`.

## taggor sites server-keys list

List a site's server keys of both environments (id, environment, start of the key, when, by whom; never the secret).

```sh title="Usage"
npx taggor sites server-keys list [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `--site <value>` | The site: its id or either of its site keys (always spelled out). | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites server-keys list --site st_0123456789abcdefghjkmnpqrs
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites server-keys create

Create a server key for ONE environment of a site (turns server rendering on there). The secret is shown once: choose `--out <file>` or `--reveal`.

```sh title="Usage"
npx taggor sites server-keys create [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `--site <value>` | The site: its id or either of its site keys (always spelled out). | - |
| `--environment <value>` | The environment the key renders: production (the live website) or staging (the test copy). Required when the site is named by its id; a site key already says which. The server sends the key together with the site key of the same environment. | - |
| `--out <value>` | Write TAGGOR_SERVER_KEY=`<secret>` into this NEW file, readable only by you; the secret is not printed (use this from an agent). | - |
| `--reveal` | Print the secret once in this output instead (it is never shown again). | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites server-keys create --site st_0123456789abcdefghjkmnpqrs --environment production --out .env.taggor
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites server-keys revoke

Revoke a server key; the edge stops accepting it within about two minutes (revoking the last one of an environment turns server rendering off there).

```sh title="Usage"
npx taggor sites server-keys revoke <key> [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `<key>` | The key id (ssk_...), from taggor sites server-keys list. Required. | - |
| `--site <value>` | The site: its id or either of its site keys (always spelled out). | - |
| `--yes` | Answer yes to the confirmation. Needed whenever there is no terminal to ask on: a revoked key never works again. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites server-keys revoke ssk_0123456789abcdefghjkmnpqrs --site st_0123456789abcdefghjkmnpqrs --yes
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).

## taggor sites delete

Delete a site for good: its two snippets stop serving and nothing brings it back (the components and the data stay). Asks for a clear yes; pass `--yes` to answer it in the command.

```sh title="Usage"
npx taggor sites delete [<site>] [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `[<site>]` | The site: its id, or either of its two site keys (taggor sites list shows them). Also taken as `--site <site>`. | - |
| `--yes` | Answer yes to the confirmation. Needed whenever there is no terminal to ask on: a deleted site does not come back. | - |

Also takes the [common options](https://taggor.dev/docs/reference/cli.md#common-options): `--api-url`, `--workspace`, `--verbose`, `--store`, `--json`, `--no-input`.

```sh title="Examples"
npx taggor sites delete st_0123456789abcdefghjkmnpqrs --yes
```

Exit codes: `0` ok, `1` generic, `2` usage, `3` unauthenticated, `4` not_found, `5` conflict, `7` rate_limited, `8` network, `9` forbidden. [What each code means](https://taggor.dev/docs/reference/cli.md#exit-codes).
