> ## Documentation Index
> Fetch the complete documentation index at: https://cli.soralabs.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Monorepo Workspaces

> Managing UI components across Turborepo, Bun, and pnpm workspaces

In monorepo setups, components typically live inside a shared UI package (such as `packages/ui` or `apps/web/src/components`) rather than the repository root.

## The `--cwd` Flag

Use the `--cwd` (or `-c`) flag to instruct the CLI to operate inside a specific package directory:

```bash theme={null}
npx @soralabs/cli add card --cwd packages/ui
```

### Why `--cwd` instead of `--path`?

* `--path` only overrides where files are written on disk without updating context.
* `--cwd` treats the specified folder as the active root:
  * Detects `components.json` and path aliases from `packages/ui/tsconfig.json`.
  * Installs npm packages directly into `packages/ui/package.json`.
  * Resolves lockfiles from the monorepo root automatically.

## Common Monorepo Examples

```bash Turborepo / pnpm theme={null}
pnpm dlx @soralabs/cli add text-effect --cwd packages/ui
```

```bash Bun Workspaces theme={null}
bunx @soralabs/cli add text-effect --cwd packages/ui
```

```bash Next.js App in Monorepo theme={null}
npx @soralabs/cli add text-effect --cwd apps/web
```


## Related topics

- [Introduction](https://cli.soralabs.studio/index.md)
- [add](https://cli.soralabs.studio/commands/add.md)
- [doctor](https://cli.soralabs.studio/commands/doctor.md)
- [diff](https://cli.soralabs.studio/commands/diff.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.