# taggor attach

> Attach a component to a site, for both environments (safe to repeat); prints the version each environment serves. Usage, options, examples and exit codes.

## taggor attach

Attach a component to a site, for both environments (safe to repeat); prints the version each environment serves.

```sh title="Usage"
npx taggor attach <component> [options]
```

| Argument | What it does | Default |
| --- | --- | --- |
| `<component>` | Component tag or id (cmp_...). Required. | - |
| `--site <value>` | The site: its id, or either of its two site keys (taggor sites list shows them). | - |
| `--loading <value>` | When the loader imports the bundle: eager (on load, the default) or idle (once the page is idle, so it does not compete with what the visitor sees first). | - |

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 attach price-card --site st_0123456789abcdefghjkmnpqrs --loading idle
```

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).
