# respira exec — run TypeScript scripts with SDK access

> Reference for respira exec. Execute TypeScript scripts with @respira/sdk available as a global respira object.

Source: https://www.respira.press/cli/docs/commands/exec

---

```
respira exec <script.ts>
respira exec --stdin
respira exec <script.ts> --dry-run
respira exec <script.ts> --site=mysite.com
```

## Example script

```
// audit.ts
const sites = await respira.sites.list();
for (const site of sites) {
  const ds = await respira.read.designSystem(site.url);
  console.log(JSON.stringify({ site: site.url, colors: ds.colors.length }));
}
```

```
respira exec audit.ts
```

The runner compiles the script with [tsx](https://tsx.is/) and injects `respira` \+ `createRespiraClient` into the global scope.
