Skip to main content
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:

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