> ## Documentation Index
> Fetch the complete documentation index at: https://better-pm.fdarian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# pm install

> Install dependencies with monorepo awareness

## Overview

The `pm install` (or `pm i`) command installs dependencies with intelligent monorepo awareness. It automatically scopes installation to the current package when you're inside a workspace package, and provides safety warnings when running at the monorepo root.

## Syntax

```bash theme={null}
pm i [options]
pm install [options]
```

## Options

<ParamField path="-y, --sure" type="boolean" default="false">
  Skip confirmation prompt when installing all packages from monorepo root
</ParamField>

<ParamField path="-F, --filter" type="string[]">
  Filter installation to specific workspace package(s). Can be specified multiple times.
</ParamField>

## Behavior

### From Workspace Package Directory

When running `pm i` from inside a workspace package, Better PM automatically filters the installation to only that package and its dependencies:

<CodeGroup>
  ```bash Terminal theme={null}
  cd apps/web
  pm i
  ```

  ```bash Output theme={null}
  Running pnpm install filtered to @myapp/web (cmd: 'pnpm' 'install' '--filter' '@myapp/web...')
  ```
</CodeGroup>

This prevents accidentally installing all packages in your monorepo when you only need one.

### From Monorepo Root

When running `pm i` from the monorepo root, Better PM shows a warning and lists all workspace packages:

<CodeGroup>
  ```bash Terminal theme={null}
  pm i
  ```

  ```bash Output theme={null}
  [WARNING] You are at the monorepo root. This will install ALL packages.

  Workspace packages:
  ├── packages/
  │   ├── core "@myapp/core"
  │   └── utils "@myapp/utils"
  └── apps/
      └── web "@myapp/web"

  To install a specific package:
    pm i -F <package-name>

  To install everything:
    pm i -y
  ```
</CodeGroup>

<Note>
  In non-interactive environments (like CI with `CLAUDECODE=1`), the command will not prompt for confirmation and will display the usage instructions instead.
</Note>

## Examples

### Install Current Package

```bash theme={null}
# From inside a workspace package
pm i
```

### Install Specific Package(s)

```bash theme={null}
# Install a single package
pm i -F @myapp/web

# Install multiple packages
pm i -F @myapp/web -F @myapp/api
```

### Install All Packages

```bash theme={null}
# From monorepo root with confirmation
pm i -y

# Or use --sure
pm i --sure
```

### Install with Filters

```bash theme={null}
# Install package and its dependents
pm i -F @myapp/core...

# Install package and its dependencies
pm i -F ...@myapp/web
```

## Related Commands

* [pm add](/commands/add) - Add new dependencies
* [pm pls](/commands/pls) - List workspace packages
* [pm cd](/commands/cd) - Navigate to workspace packages
