Skip to main content
command CX Codex

setup-pm — Claude Code command: select your package manager

setup-pm — a command to configure which package manager (npm, pnpm, yarn, or bun) Claude Code uses in your project or globally. Use it when you want to enforce a specific manager across your workflow.

MIT ★ 6,739 updated 2026-01-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Open on GitHub

What setup-pm does

setup-pm lets you pick your package manager through multiple methods: set a global preference, configure it per project, or pass it via the CLAUDE_PACKAGE_MANAGER environment variable. The command checks in a specific sequence — environment variable first, then project config, then the packageManager field in package.json, then lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb), global config at ~/.claude/package-manager.json, and finally defaults to the first available manager from pnpm → bun → yarn → npm.

Configuration lives in JSON files: globally in ~/.claude/package-manager.json, per-project in .claude/package-manager.json, or in your package.json. The command supports --detect mode to show current settings, --global and --project flags to set preferences, and --list to display available managers.

What it helps with

  • use pnpm or bun instead of npm as default in Claude Code
  • enforce the same package manager across all projects without repetition
  • quickly check which manager your system is currently using
  • override the manager via environment variable for a single session

Example prompts for the agent

  • Detect and show me what package manager is currently active
  • Set pnpm as the global package manager preference
  • Configure bun as the manager for this project only

How to install setup-pm

1Plugin marketplace

/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code

2Manually: put the files in place

.claude/commands/setup-pm.md

Call it with /setup-pm. For all projects use ~/.claude/commands/

Questions about setup-pm

How do I install setup-pm in Claude Code?

In Claude Code, run /plugin marketplace add WorldFlowAI/everything-claude-code, then /plugin install everything-claude-code@everything-claude-code. The command will be available at .claude/commands/setup-pm.md.

What does setup-pm do?

It configures which package manager (npm, pnpm, yarn, or bun) Claude Code will use when working with dependencies. You can set a preference globally, for a single project, or override it with an environment variable.

What order does setup-pm check for the package manager?

It checks the CLAUDE_PACKAGE_MANAGER environment variable first, then project config at .claude/package-manager.json, the packageManager field in package.json, lock files (package-lock.json, yarn.lock, and others), global config at ~/.claude/package-manager.json, and finally defaults to the first available manager among pnpm, bun, yarn, and npm.

Source text

setup-pm.md · MIT
---
description: Configure your preferred package manager (npm/pnpm/yarn/bun)
disable-model-invocation: true
---

# Package Manager Setup

Configure your preferred package manager for this project or globally.

## Usage

```bash
# Detect current package manager
node scripts/setup-package-manager.js --detect

# Set global preference
node scripts/setup-package-manager.js --global pnpm

# Set project preference
node scripts/setup-package-manager.js --project bun

# List available package managers
node scripts/setup-package-manager.js --list
```

## Detection Priority

When determining which package manager to use, the following order is checked:

1. **Environment variable**: `CLAUDE_PACKAGE_MANAGER`
2. **Project config**: `.claude/package-manager.json`
3. **package.json**: `packageManager` field
4. **Lock file**: Presence of package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb
5. **Global config**: `~/.claude/package-manager.json`
6. **Fallback**: First available package manager (pnpm > bun > yarn > npm)

## Configuration Files

### Global Configuration
```json
// ~/.claude/package-manager.json
{
  "packageManager": "pnpm"
}
```

### Project Configuration
```json
// .claude/package-manager.json
{
  "packageManager": "bun"
}
```

### package.json
```json
{
  "packageManager": "[email protected]"
}
```

## Environment Variable

Set `CLAUDE_PACKAGE_MANAGER` to override all other detection methods:

```bash
# Windows (PowerShell)
$env:CLAUDE_PACKAGE_MANAGER = "pnpm"

# macOS/Linux
export CLAUDE_PACKAGE_MANAGER=pnpm
```

## Run the Detection

To see current package manager detection results, run:

```bash
node scripts/setup-package-manager.js --detect
```

© Affaan Mustafa · MIT · WorldFlowAI/everything-claude-code

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set29

The whole set →
hooks The hooks rule defines actions before and after tool calls, plus a final session check. It helps run code checks and review Git-related changes. CX Codex +1 ★ 6,739repo stars agents Defines nine agents in ~/.claude/agents/ for different development tasks: planning, design, testing, code review, and more. Run them in parallel for independent work. CX Codex +1 ★ 6,739repo stars checkpoint Saves named Git checkpoints during a Claude Code workflow and compares changed files, test results, and test coverage against earlier marks. CX Codex +1 ★ 6,739repo stars learn The learn slash command turns reusable lessons from the current session into skills. Run it after a difficult fix, debugging session, or project-specific discovery. CX Codex +1 ★ 6,739repo stars code-reviewer The code-reviewer subagent reviews code changes for security vulnerabilities, bugs, performance problems, and style violations. Run it immediately after writing or modifying code to catch issues before they reach production. CX Codex ★ 6,739repo stars planner planner generates structured implementation plans and refactoring roadmaps for Claude Code projects. CX Codex ★ 6,739repo stars orchestrate orchestrate routes a complex task through a sequence of agents and combines their findings into a report. Choose a workflow for a feature, bug fix, refactor, or security review. CX Codex +1 ★ 6,739repo stars plan Command invokes a planner sub-agent that breaks down the task into phases, assesses risks, and waits for confirmation before touching any code. CX Codex +1 ★ 6,739repo stars

Project sponsors

Companies that keep this analytics open